fix compile for BLE, start gatt client for connection in deamon

This commit is contained in:
matthias.ringwald@gmail.com 2014-05-08 13:39:53 +00:00
parent fe8aced921
commit a10aa107de

View File

@ -163,6 +163,8 @@ static gatt_client_t * daemon_provide_gatt_client_context_for_handle(uint16_t ha
if (!context){
context = (gatt_client_t*)malloc(sizeof(gatt_client_t) + ATT_MAX_LONG_ATTRIBUTE_SIZE);
}
if (!context) return NULL;
gatt_client_start(context, handle);
return context;
}
@ -304,7 +306,17 @@ static int btstack_command_handler(connection_t *connection, uint8_t *packet, ui
uint8_t rfcomm_credits;
uint32_t service_record_handle;
client_state_t *client;
#if defined(HAVE_MALLOC) && defined(HAVE_BLE)
gatt_client_t * context;
uint8_t uuid128[16];
le_service_t service;
le_characteristic_t characteristic;
le_characteristic_descriptor_t descriptor;
uint16_t data_length;
uint8_t * data;
#endif
uint16_t serviceSearchPatternLen;
uint16_t attributeIDListLen;
@ -734,7 +746,7 @@ static int daemon_client_handler(connection_t *connection, uint16_t packet_type,
static void daemon_set_logging_enabled(int enabled){
if (enabled && !loggingEnabled){
// use logger: format HCI_DUMP_PACKETLOGGER, HCI_DUMP_BLUEZ or HCI_DUMP_STDOUT
hci_dump_open("/tmp/hci_dump.pklg", HCI_DUMP_PACKETLOGGER);
hci_dump_open("/data/btstack/hci_dump.pklg", HCI_DUMP_PACKETLOGGER);
}
if (!enabled && loggingEnabled){
hci_dump_close();