https://github.com/dmazzella/uble
解析HCI包
代码: 全选
MicroPython v1.8.7-79-g221f88d-dirty on 2017-01-26; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> from bluetooth_low_energy.protocols.hci import (cmd, uart)
>>> buf = b''
>>> hci_uart = uart.HCI_UART.from_buffer(buf)
>>> print(hci_uart)
>>> hci_cmd = cmd.HCI_COMMAND.from_buffer(hci_uart.data)
>>> print(hci_cmd)
>>> hci_cmd.to_buffer()
b''
>>>
代码: 全选
MicroPython v1.8.7-79-g221f88d-dirty on 2017-01-26; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> from bluetooth_low_energy.protocols.hci import cmd
>>> hci_cmd = cmd.HCI_COMMAND(ogf=cmd.OGF_LE_CTL, ocf=cmd.OCF_LE_RAND)
>>> print(hci_cmd)
>>> hci_cmd.to_buffer()
b' '
>>>