use SKIP_ADVERTISEMENT_PARAMAS_UPDATE

This commit is contained in:
matthias.ringwald@gmail.com 2014-01-25 14:05:43 +00:00
parent a029e94cdf
commit 93d4cd7934

View File

@ -95,8 +95,12 @@ static void show_usage();
static void update_advertisements(); static void update_advertisements();
// -> hier Adresse vom Tester eintragen für Directed Connectable Mode // -> hier Adresse vom Tester eintragen für Directed Connectable Mode
#define SKIP_ADVERTISEMENT_PARAMAS_UPDATE
#ifndef SKIP_ADVERTISEMENT_PARAMAS_UPDATE
static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x06, 0x07, 0x5F}; static bd_addr_t tester_address = {0x00, 0x1B, 0xDC, 0x06, 0x07, 0x5F};
static int tester_address_type = 0; static int tester_address_type = 0;
#endif
// some test data // some test data
static uint8_t adv_data_0[] = { 2, 01, 05, 03, 02, 0xf0, 0xff }; static uint8_t adv_data_0[] = { 2, 01, 05, 03, 02, 0xf0, 0xff };
@ -191,6 +195,7 @@ static int att_write_callback(uint16_t handle, uint16_t transaction_mode, uint16
return 1; return 1;
} }
#ifndef SKIP_ADVERTISEMENT_PARAMAS_UPDATE
static uint8_t gap_adv_type(){ static uint8_t gap_adv_type(){
if (gap_connectable){ if (gap_connectable){
if (gap_directed_connectable){ if (gap_directed_connectable){
@ -200,6 +205,7 @@ static uint8_t gap_adv_type(){
} }
return 0x03; return 0x03;
} }
#endif
static void gap_run(){ static void gap_run(){
if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return; if (!hci_can_send_packet_now(HCI_COMMAND_DATA_PACKET)) return;
@ -219,26 +225,28 @@ static void gap_run(){
return; return;
} }
// if (todos & SET_ADVERTISEMENT_PARAMS){ #ifndef SKIP_ADVERTISEMENT_PARAMAS_UPDATE
// todos &= ~SET_ADVERTISEMENT_PARAMS; if (todos & SET_ADVERTISEMENT_PARAMS){
// uint8_t adv_type = gap_adv_type(); todos &= ~SET_ADVERTISEMENT_PARAMS;
// bd_addr_t null_addr; uint8_t adv_type = gap_adv_type();
// memset(null_addr, 0, 6); bd_addr_t null_addr;
// uint16_t adv_int_min = 0x800; memset(null_addr, 0, 6);
// uint16_t adv_int_max = 0x800; uint16_t adv_int_min = 0x800;
// switch (adv_type){ uint16_t adv_int_max = 0x800;
// case 0: switch (adv_type){
// hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, 0, &null_addr, 0x07, 0x00); case 0:
// break; hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, 0, &null_addr, 0x07, 0x00);
// case 1: break;
// hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, tester_address_type, &tester_address, 0x07, 0x00); case 1:
// break; hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, tester_address_type, &tester_address, 0x07, 0x00);
// case 3: break;
// hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, 0, &null_addr, 0x07, 0x00); case 3:
// break; hci_send_cmd(&hci_le_set_advertising_parameters, adv_int_min, adv_int_max, adv_type, gap_privacy, 0, &null_addr, 0x07, 0x00);
// } break;
// return; }
// } return;
}
#endif
if (todos & SET_SCAN_RESPONSE_DATA){ if (todos & SET_SCAN_RESPONSE_DATA){
printf("GAP_RUN: set scan response data\n"); printf("GAP_RUN: set scan response data\n");