From 28e59aaa2f79b8f22f51f8cb0fddeaca3caee7bd Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Thu, 17 Oct 2013 14:52:10 +0000 Subject: [PATCH] remove set_advertisement_parameters call as defaults are fine --- MSP-EXP430F5438-CC256x/example-ble/ble_server.c | 6 +----- example/libusb/ble_server.c | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/MSP-EXP430F5438-CC256x/example-ble/ble_server.c b/MSP-EXP430F5438-CC256x/example-ble/ble_server.c index 5c0ff18d0..197dc22ab 100644 --- a/MSP-EXP430F5438-CC256x/example-ble/ble_server.c +++ b/MSP-EXP430F5438-CC256x/example-ble/ble_server.c @@ -143,7 +143,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha // bt stack activated, get started - set local name if (packet[2] == HCI_STATE_WORKING) { printf("Working!\n"); - hci_send_cmd(&hci_le_set_advertising_parameters, 0x0400, 0x0800, 0, 0, 0, &addr, 0x07, 0); + hci_send_cmd(&hci_le_set_advertising_data, sizeof(adv_data), adv_data); } break; @@ -184,10 +184,6 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha printf("BD ADDR: %s\n", bd_addr_to_str(addr)); break; } - if (COMMAND_COMPLETE_EVENT(packet, hci_le_set_advertising_parameters)){ - hci_send_cmd(&hci_le_set_advertising_data, sizeof(adv_data), adv_data); - break; - } if (COMMAND_COMPLETE_EVENT(packet, hci_le_set_advertising_data)){ hci_send_cmd(&hci_le_set_scan_response_data, 10, adv_data); break; diff --git a/example/libusb/ble_server.c b/example/libusb/ble_server.c index 992662732..afcf9e42e 100644 --- a/example/libusb/ble_server.c +++ b/example/libusb/ble_server.c @@ -92,7 +92,6 @@ static void att_packet_handler(uint8_t packet_type, uint16_t handle, uint8_t *pa // enable LE, setup ADV data static void packet_handler (void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ - bd_addr_t addr; uint8_t adv_data[] = { 02, 01, 05, 03, 02, 0xf0, 0xff }; switch (packet_type) { @@ -103,8 +102,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha // bt stack activated, get started - set local name if (packet[2] == HCI_STATE_WORKING) { printf("Working!\n"); - // only needed for BLE Peripheral, consider sending these as a default - hci_send_cmd(&hci_le_set_advertising_parameters, 0x0400, 0x0800, 0, 0, 0, &addr, 0x07, 0); + hci_send_cmd(&hci_le_set_advertising_data, sizeof(adv_data), adv_data); } break;