try to bring Blutooth module into defined state by sending HCI RESET twice

This commit is contained in:
matthias.ringwald@gmail.com 2014-07-06 20:26:03 +00:00
parent 5127cc624b
commit 198279761c

View File

@ -163,6 +163,15 @@ static int h4_open(void *transport_config){
h4_state = H4_W4_PACKET_TYPE;
read_pos = 0;
// bring bluetooth module into defined state
int i;
uint8_t reset[] = { 0x01, 0x03, 0x0c, 0x00};
write(fd, &reset, sizeof(reset));
usleep(100000); // 100 ms
write(fd, &reset, sizeof(reset));
usleep(100000); // 100 ms
tcflush(fd, TCIOFLUSH);
return 0;
}