mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
removed hci_write_authentication_enable from code
This commit is contained in:
parent
219eea5f01
commit
c6d71a3daa
@ -556,10 +556,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
|||||||
BD_ADDR_COPY(&connAddr, address);
|
BD_ADDR_COPY(&connAddr, address);
|
||||||
connPSM = psm;
|
connPSM = psm;
|
||||||
connAuth = authentication;
|
connAuth = authentication;
|
||||||
|
|
||||||
// send write authentication enabled
|
|
||||||
bt_send_cmd(&hci_write_authentication_enable, authentication);
|
|
||||||
state = kW4AuthenticationEnableCommand;
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
@ -243,8 +243,10 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
case BTSTACK_EVENT_STATE:
|
case BTSTACK_EVENT_STATE:
|
||||||
// bt stack activated, get started - set local name
|
// bt stack activated, get started - set local name
|
||||||
if (packet[2] == HCI_STATE_WORKING) {
|
if (packet[2] == HCI_STATE_WORKING) {
|
||||||
// dumpCmds = 1;
|
printLine("Inquiry");
|
||||||
hci_send_cmd(&hci_write_authentication_enable, 1);
|
state = inquiry;
|
||||||
|
hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -293,12 +295,6 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_COMMAND_COMPLETE:
|
case HCI_EVENT_COMMAND_COMPLETE:
|
||||||
if (COMMAND_COMPLETE_EVENT(packet, hci_write_authentication_enable)){
|
|
||||||
printLine("Inquiry");
|
|
||||||
state = inquiry;
|
|
||||||
hci_send_cmd(&hci_inquiry, HCI_INQUIRY_LAP, INQUIRY_INTERVAL, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (COMMAND_COMPLETE_EVENT(packet, hci_inquiry_cancel) ) {
|
if (COMMAND_COMPLETE_EVENT(packet, hci_inquiry_cancel) ) {
|
||||||
// inq successfully cancelled
|
// inq successfully cancelled
|
||||||
// printLine("Connecting");
|
// printLine("Connecting");
|
||||||
|
@ -84,9 +84,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case BTSTACK_EVENT_STATE:
|
case BTSTACK_EVENT_STATE:
|
||||||
// bt stack activated, get started - set local name
|
// bt stack activated, get started
|
||||||
if (packet[2] == HCI_STATE_WORKING) {
|
if (packet[2] == HCI_STATE_WORKING) {
|
||||||
bt_send_cmd(&hci_write_authentication_enable, 0);
|
bt_send_cmd(&hci_write_class_of_device, 0x2540);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -177,8 +177,8 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_COMMAND_COMPLETE:
|
case HCI_EVENT_COMMAND_COMPLETE:
|
||||||
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_authentication_enable) ) {
|
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_class_of_device) ) {
|
||||||
bt_send_cmd(&hci_write_class_of_device, 0x2540);
|
printf("Ready\n");
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// other event
|
// other event
|
||||||
|
@ -106,16 +106,13 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
|||||||
run_loop_set_timer(&timer, 3000);
|
run_loop_set_timer(&timer, 3000);
|
||||||
// run_loop_add_timer(&timer);
|
// run_loop_add_timer(&timer);
|
||||||
} else {
|
} else {
|
||||||
bt_send_cmd(&hci_write_authentication_enable, 0);
|
bt_send_cmd(&hci_write_class_of_device, 0x38010c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HCI_EVENT_COMMAND_COMPLETE:
|
case HCI_EVENT_COMMAND_COMPLETE:
|
||||||
// use pairing yes/no
|
// use pairing yes/no
|
||||||
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_authentication_enable) ) {
|
|
||||||
bt_send_cmd(&hci_write_class_of_device, 0x38010c);
|
|
||||||
}
|
|
||||||
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_class_of_device) ) {
|
if ( COMMAND_COMPLETE_EVENT(packet, hci_write_class_of_device) ) {
|
||||||
bt_send_cmd(&l2cap_create_channel_mtu, addr, PSM_TEST, PACKET_SIZE);
|
bt_send_cmd(&l2cap_create_channel_mtu, addr, PSM_TEST, PACKET_SIZE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user