receiver: get device codename from Bolt receiver registers
This commit is contained in:
parent
9823e5ab8a
commit
c32a6ca91c
|
@ -154,6 +154,7 @@ INFO_SUBREGISTERS = _NamedInts(
|
||||||
extended_pairing_information=0x30, # 0x3N, by connected device
|
extended_pairing_information=0x30, # 0x3N, by connected device
|
||||||
device_name=0x40, # 0x4N, by connected device
|
device_name=0x40, # 0x4N, by connected device
|
||||||
bolt_pairing_information=0x50, # 0x5N, by connected device
|
bolt_pairing_information=0x50, # 0x5N, by connected device
|
||||||
|
bolt_device_name=0x60, # 0x6N01, by connected device,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Flags taken from https://drive.google.com/file/d/0BxbRzx7vEV7eNDBheWY0UHM5dEU/view?usp=sharing
|
# Flags taken from https://drive.google.com/file/d/0BxbRzx7vEV7eNDBheWY0UHM5dEU/view?usp=sharing
|
||||||
|
|
|
@ -143,11 +143,14 @@ class Receiver:
|
||||||
|
|
||||||
def device_codename(self, n):
|
def device_codename(self, n):
|
||||||
if self.receiver_kind == 'bolt':
|
if self.receiver_kind == 'bolt':
|
||||||
|
codename = self.read_register(_R.receiver_info, _IR.bolt_device_name + n, 0x01)
|
||||||
|
if codename:
|
||||||
|
codename = codename[3:3 + min(14, ord(codename[2:3]))]
|
||||||
|
return codename.decode('ascii')
|
||||||
return
|
return
|
||||||
codename = self.read_register(_R.receiver_info, _IR.device_name + n - 1)
|
codename = self.read_register(_R.receiver_info, _IR.device_name + n - 1)
|
||||||
if codename:
|
if codename:
|
||||||
codename_length = ord(codename[1:2])
|
codename = codename[2:2 + ord(codename[1:2])]
|
||||||
codename = codename[2:2 + codename_length]
|
|
||||||
return codename.decode('ascii')
|
return codename.decode('ascii')
|
||||||
|
|
||||||
def device_pairing_information(self, n):
|
def device_pairing_information(self, n):
|
||||||
|
|
Loading…
Reference in New Issue