receiver: check that device can retrieve host names before trying that
This commit is contained in:
parent
b3cc4361e8
commit
330fadfbce
|
@ -898,7 +898,8 @@ def get_host_names(device):
|
|||
state = feature_request(device, FEATURE.HOSTS_INFO, 0x00)
|
||||
host_names = {}
|
||||
if state:
|
||||
_ignore, _ignore, numHosts, currentHost = _unpack('!BBBB', state[:4])
|
||||
capability_flags, _ignore, numHosts, currentHost = _unpack('!BBBB', state[:4])
|
||||
if capability_flags & 0x01: # device can get host names
|
||||
for host in range(0, numHosts):
|
||||
hostinfo = feature_request(device, FEATURE.HOSTS_INFO, 0x10, host)
|
||||
_ignore, status, _ignore, numPages, nameLen, _ignore = _unpack('!BBBBBB', hostinfo[:6])
|
||||
|
|
Loading…
Reference in New Issue