mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-24 22:43:35 +00:00
added terminate command
This commit is contained in:
parent
e407faff86
commit
c8b84afc4f
@ -88,6 +88,8 @@ static uint8_t counter = 0;
|
|||||||
static int update_client = 0;
|
static int update_client = 0;
|
||||||
static int client_configuration = 0;
|
static int client_configuration = 0;
|
||||||
|
|
||||||
|
static uint16_t handle = 0;
|
||||||
|
|
||||||
static void app_run();
|
static void app_run();
|
||||||
static void show_usage();
|
static void show_usage();
|
||||||
static void update_advertisements();
|
static void update_advertisements();
|
||||||
@ -258,6 +260,8 @@ static void app_packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *
|
|||||||
switch (packet[2]) {
|
switch (packet[2]) {
|
||||||
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
case HCI_SUBEVENT_LE_CONNECTION_COMPLETE:
|
||||||
advertisements_enabled = 0;
|
advertisements_enabled = 0;
|
||||||
|
handle = READ_BT_16(packet, 4);
|
||||||
|
printf("Connection handle 0x%04x", handle);
|
||||||
// request connection parameter update - test parameters
|
// request connection parameter update - test parameters
|
||||||
// l2cap_le_request_connection_parameter_update(READ_BT_16(packet, 4), 20, 1000, 100, 100);
|
// l2cap_le_request_connection_parameter_update(READ_BT_16(packet, 4), 20, 1000, 100, 100);
|
||||||
break;
|
break;
|
||||||
@ -359,6 +363,8 @@ void show_usage(){
|
|||||||
printf("7 - AD Slave Preferred Connection Interval Range\n");
|
printf("7 - AD Slave Preferred Connection Interval Range\n");
|
||||||
printf("8 - AD Tx Power Level\n");
|
printf("8 - AD Tx Power Level\n");
|
||||||
printf("---\n");
|
printf("---\n");
|
||||||
|
printf("t - terminate connection\n");
|
||||||
|
printf("---\n");
|
||||||
printf("Ctrl-c - exit\n");
|
printf("Ctrl-c - exit\n");
|
||||||
printf("---\n");
|
printf("---\n");
|
||||||
}
|
}
|
||||||
@ -438,6 +444,9 @@ int stdin_process(struct data_source *ds){
|
|||||||
advertisement_index = buffer - '0';
|
advertisement_index = buffer - '0';
|
||||||
update_advertisements();
|
update_advertisements();
|
||||||
break;
|
break;
|
||||||
|
case 't':
|
||||||
|
hci_send_cmd(&hci_disconnect, handle, 0x13);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
show_usage();
|
show_usage();
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user