Exemple #1
0
 def _handle_control_packet(self, l2cap_packet):
     packet_bytes = l2cap_packet.payload
     l2cap_view = l2cap_packets.BasicFrameView(
         bt_packets.PacketViewLittleEndian(list(packet_bytes)))
     if l2cap_view.GetChannelId() != 1:
         return
     l2cap_control_view = l2cap_packets.ControlView(l2cap_view.GetPayload())
     fn = self.control_table.get(l2cap_control_view.GetCode())
     if fn is not None:
         fn(l2cap_control_view)
Exemple #2
0
 def _control_frame(packet):
     if packet.GetChannelId() != 1:
         return None
     return l2cap_packets.ControlView(packet.GetPayload())