mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-10 06:40:23 +00:00
track loopback mode, allow sending SCO packets in loopback mode
This commit is contained in:
parent
1ae22036c4
commit
0e1ceea46c
@ -558,6 +558,9 @@ int hci_send_sco_packet_buffer(int size){
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t * packet = hci_stack->hci_packet_buffer;
|
uint8_t * packet = hci_stack->hci_packet_buffer;
|
||||||
|
|
||||||
|
// skip checks in loopback mode
|
||||||
|
if (!hci_stack->loopback_mode){
|
||||||
hci_con_handle_t con_handle = READ_ACL_CONNECTION_HANDLE(packet); // same for ACL and SCO
|
hci_con_handle_t con_handle = READ_ACL_CONNECTION_HANDLE(packet); // same for ACL and SCO
|
||||||
|
|
||||||
// check for free places on Bluetooth module
|
// check for free places on Bluetooth module
|
||||||
@ -575,6 +578,7 @@ int hci_send_sco_packet_buffer(int size){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
connection->num_sco_packets_sent++;
|
connection->num_sco_packets_sent++;
|
||||||
|
}
|
||||||
|
|
||||||
hci_dump_packet( HCI_SCO_DATA_PACKET, 0, packet, size);
|
hci_dump_packet( HCI_SCO_DATA_PACKET, 0, packet, size);
|
||||||
return hci_stack->hci_transport->send_packet(HCI_SCO_DATA_PACKET, packet, size);
|
return hci_stack->hci_transport->send_packet(HCI_SCO_DATA_PACKET, packet, size);
|
||||||
@ -2610,6 +2614,10 @@ int hci_send_cmd_packet(uint8_t *packet, int size){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_COMMAND(packet, hci_write_loopback_mode)){
|
||||||
|
hci_stack->loopback_mode = packet[3];
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BLE
|
#ifdef HAVE_BLE
|
||||||
if (IS_COMMAND(packet, hci_le_set_advertising_parameters)){
|
if (IS_COMMAND(packet, hci_le_set_advertising_parameters)){
|
||||||
hci_stack->adv_addr_type = packet[8];
|
hci_stack->adv_addr_type = packet[8];
|
||||||
|
@ -131,6 +131,7 @@ extern "C" {
|
|||||||
#define OGF_CONTROLLER_BASEBAND 0x03
|
#define OGF_CONTROLLER_BASEBAND 0x03
|
||||||
#define OGF_INFORMATIONAL_PARAMETERS 0x04
|
#define OGF_INFORMATIONAL_PARAMETERS 0x04
|
||||||
#define OGF_STATUS_PARAMETERS 0x05
|
#define OGF_STATUS_PARAMETERS 0x05
|
||||||
|
#define OGF_TESTING 0x06
|
||||||
#define OGF_LE_CONTROLLER 0x08
|
#define OGF_LE_CONTROLLER 0x08
|
||||||
#define OGF_BTSTACK 0x3d
|
#define OGF_BTSTACK 0x3d
|
||||||
#define OGF_VENDOR 0x3f
|
#define OGF_VENDOR 0x3f
|
||||||
@ -720,6 +721,8 @@ typedef struct {
|
|||||||
|
|
||||||
uint16_t sco_voice_setting;
|
uint16_t sco_voice_setting;
|
||||||
|
|
||||||
|
uint8_t loopback_mode;
|
||||||
|
|
||||||
// buffer for single connection decline
|
// buffer for single connection decline
|
||||||
uint8_t decline_reason;
|
uint8_t decline_reason;
|
||||||
bd_addr_t decline_addr;
|
bd_addr_t decline_addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user