From 36fd635d4f41c6e244c58ea53802712c490c3538 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Mon, 25 Mar 2019 00:03:41 +0000
Subject: [PATCH] Check if there is only one vendor-specific interface

---
 bcm20795.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/bcm20795.py b/bcm20795.py
index c689d18..8ae81be 100755
--- a/bcm20795.py
+++ b/bcm20795.py
@@ -86,8 +86,9 @@
 		bcm_interface = None
 		for interface in configuration:
 			if interface.bInterfaceClass == 0xff and interface.iInterface == 0x08:
+				if bcm_interface is not None:
+					raise Exception('More than one vendor-specific interface found!')
 				bcm_interface = interface
-				break
 		if bcm_interface is None:
 			raise Exception('Cannot find vendor-specific interface')
 		logger.debug('Interface found: {}'.format(bcm_interface._str()))

--
Gitblit v1.9.1