disable LE Peripheral code in daemon

This commit is contained in:
mila@ringwald.ch 2014-09-10 07:57:25 +00:00
parent 3b585bee6e
commit 82da37461e

View File

@ -1052,6 +1052,10 @@ static void daemon_retry_parked(void){
retry_mutex = 0; retry_mutex = 0;
} }
#if 0
Minimal Code for LE Peripheral
typedef enum { typedef enum {
SET_ADVERTISEMENT_PARAMS = 1 << 0, SET_ADVERTISEMENT_PARAMS = 1 << 0,
SET_ADVERTISEMENT_DATA = 1 << 1, SET_ADVERTISEMENT_DATA = 1 << 1,
@ -1096,11 +1100,10 @@ static void app_run(){
return; return;
} }
} }
#endif
static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){
app_run();
switch (packet_type) { switch (packet_type) {
case HCI_EVENT_PACKET: case HCI_EVENT_PACKET:
deamon_status_event_handler(packet, size); deamon_status_event_handler(packet, size);
@ -1108,9 +1111,10 @@ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16
case BTSTACK_EVENT_STATE: case BTSTACK_EVENT_STATE:
// setup advertisement data // setup advertisement data
if (packet[2] != HCI_STATE_WORKING) break; // if (packet[2] != HCI_STATE_WORKING) break;
todos = SET_ADVERTISEMENT_PARAMS | SET_ADVERTISEMENT_DATA | ENABLE_ADVERTISEMENTS; // todos = SET_ADVERTISEMENT_PARAMS | SET_ADVERTISEMENT_DATA | ENABLE_ADVERTISEMENTS;
app_run(); // app_run();
log_info("Daemon: BTstack working");
break; break;
case HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS: case HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS:
@ -1147,7 +1151,7 @@ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16
#if defined(HAVE_BLE) && defined(HAVE_MALLOC) #if defined(HAVE_BLE) && defined(HAVE_MALLOC)
case HCI_EVENT_DISCONNECTION_COMPLETE:{ case HCI_EVENT_DISCONNECTION_COMPLETE:{
// re-enable advertisements // re-enable advertisements
todos = ENABLE_ADVERTISEMENTS; // todos = ENABLE_ADVERTISEMENTS;
uint16_t handle = READ_BT_16(packet, 3); uint16_t handle = READ_BT_16(packet, 3);
daemon_remove_gatt_client_handle(connection, handle); daemon_remove_gatt_client_handle(connection, handle);