コード例 #1
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'Device Address: {}', 'Data Packet Length: {} ({})',
         'Num Data Packets: {} ({})', 'IRK: {}', 'CSRK: {}'
     ]).format(_bytes_to_hex_string(self.dev_addrs), hex(self.data_pkt_len),
               int(self.data_pkt_len), hex(self.num_data_pkts),
               int(self.num_data_pkts), _bytes_to_hex_string(self.irk),
               _bytes_to_hex_string(self.csrk))
コード例 #2
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'Event Type: {} ({})', 'Address Type: {} ({})', 'Address: {}',
         'RSSI: {} ({})', 'Data Length: {}', 'Data: {}'
     ]).format(hex(self.event_type),
               GAP_DeviceInformation.EventType(self.event_type).name,
               hex(self.address_type),
               GAP_DeviceInformation.AdressType(self.address_type).name,
               _bytes_to_hex_string(self.address), hex(self.rssi),
               int(self.rssi), hex(self.data_length), int(self.data_length),
               _bytes_to_hex_string(self.data))
コード例 #3
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'Connection Handle: {}, ({})', 'PDU Length: {} ({})',
         'Handle: {} ({})', 'Value: {}'
     ]).format(hex(self.conn_handle), int(self.conn_handle),
               hex(self.pdu_len), int(self.pdu_len), hex(self.handle),
               int(self.handle), _bytes_to_hex_string(self.value))
コード例 #4
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'Profile Role: {} ({})',
         'Max. Scan Responses: {} ({})',
         'IRK: {}',
         'CSRK: {}',
         'Sign Counter: {} ({})',
     ]).format(
         hex(self.profile_role),
         GAP_DeviceInit.ProfileRole(self.profile_role).name,
         hex(self.max_scan_responses),
         int(self.max_scan_responses),
         _bytes_to_hex_string(self.irk),
         _bytes_to_hex_string(self.csrk),
         hex(self.sign_counter),
         int(self.sign_counter),
     )
コード例 #5
0
 def __str__(self):
     return '\n'.join([
         'Event Type: {} ({})', 'Address Type: {} ({})', 'Address: {}'
     ]).format(
         hex(self.event_type),
         GAP_DeviceDiscoveryDone.EventType(self.event_type).name,
         hex(self.address_type),
         GAP_DeviceDiscoveryDone.AdressType(self.address_type).name,
         _bytes_to_hex_string(self.address))
コード例 #6
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'OpCode: {} ({})',
         'Data Length: {} ({})',
         'Param: {}']).format(
         hex(self.opcode),
         OpCode(self.opcode).name,
         hex(self.data_length),
         int(self.data_length),
         _bytes_to_hex_string(self.param_value)
     )
コード例 #7
0
 def __str__(self):
     return super().__str__() + '\n' + '\n'.join([
         'High Duty Cycle: {} ({})',
         'White List: {} ({})',
         'Address Type Peer: {} ({})',
         'Peer Address: {}',
     ]).format(
         hex(self.high_duty_cycle),
         GAP_EstablishLinkReq.HighDutyCycle(self.high_duty_cycle).name,
         hex(self.white_list),
         GAP_EstablishLinkReq.WhiteList(self.white_list).name,
         hex(self.addr_type_peer),
         GAP_EstablishLinkReq.AddrTypePeer(self.addr_type_peer).name,
         _bytes_to_hex_string(self.peer_addr),
     )
コード例 #8
0
 def __str__(self):
     CONN_INTERVAL_SCALE_CONST_MS = 1.25
     CONN_TIMEOUT_SCALE_CONST_MS = 10
     return super().__str__() + '\n' + '\n'.join([
         'Device Address Type: {} ({})', 'Device Address: {}',
         'Connection Handle: {} ({})', 'Connection Role: {} ({})',
         'Connection Interval: {} ({} ms)',
         'Connection Latency: {} ({} connection events)',
         'Connection Timeout: {} ({} ms)', 'Clock Accuracy: {} ({})'
     ]).format(
         hex(self.device_address_type),
         GAP_LinkEstablished.AdressType(self.device_address_type).name,
         _bytes_to_hex_string(self.device_address), hex(self.conn_handle),
         int(self.conn_handle), hex(self.connection_role),
         GAP_LinkEstablished.GAP_Profiles(self.connection_role).name,
         hex(self.connection_interval),
         int(self.connection_interval) * CONN_INTERVAL_SCALE_CONST_MS,
         hex(self.connection_latency), int(self.connection_latency),
         hex(self.connection_timeout),
         int(self.connection_timeout) * CONN_TIMEOUT_SCALE_CONST_MS,
         hex(self.clock_accuracy), int(self.clock_accuracy))
コード例 #9
0
ファイル: att_find_info_rsp.py プロジェクト: tmart234/BLE-LL
 def __str__(self):
     return '\n'.join(['Handle: {} ({})', 'uuid: {}'
                       ]).format(hex(self.handle), int(self.handle),
                                 _bytes_to_hex_string(self.uuid))