MCPcopy Create free account
hub / github.com/secdev/scapy / send_command

Method send_command

scapy/layers/bluetooth.py:3154–3162  ·  view source on GitHub ↗
(self, cmd)

Source from the content-addressed store, hash-verified

3152 sock_address=sa)
3153
3154 def send_command(self, cmd):
3155 opcode = cmd[HCI_Command_Hdr].opcode
3156 self.send(cmd)
3157 while True:
3158 r = self.recv()
3159 if r.type == 0x04 and r.code == 0xe and r.opcode == opcode:
3160 if r.status != 0:
3161 raise BluetoothCommandError("Command %x failed with %x" % (opcode, r.status)) # noqa: E501
3162 return r
3163
3164 def recv(self, x=MTU):
3165 return HCI_Hdr(self.ins.recv(x))

Callers

nothing calls this directly

Calls 3

recvMethod · 0.95
sendMethod · 0.45

Tested by

no test coverage detected