uart bt dongle需要先使用hciattach
sudohciattach ttyS1 any 115200 noflow
any:
{ "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200, FLOW_CTL, NULL, NULL },
struct uart_t {
char *type;
int m_id;
int p_id;
int proto;
int init_speed;
int speed;
int flags;
char *bdaddr;
int (*init) (int fd, struct uart_t *u, struct termios *ti);
int (*post) (int fd, struct uart_t *u, struct termios *ti);
};
后续操作uart bt dongle和usb bt dongle相同。
hciconfig:
sudohciconfig hci0 up
hcitool:
sudo hcitool lescan
sudo hcitool lecc
sudo hcitool cmd
gatttool:
sudo gatttool -i hcix -b <bdaddr> -t public/random -I
bluez-utils: