fix crash due to 32-bit access of unaligned struct on Arduino Zero

This commit is contained in:
Matthias Ringwald 2015-06-21 23:18:58 +02:00
parent 8c6a668501
commit 23369bc578

View File

@ -191,8 +191,12 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
}
static void gatt_client_callback(le_event_t * event){
// le_characteristic_t characteristic;
// le_characteristic_value_event_t * value_event;
// if (hci) event is not 4-byte aligned, event->handle causes crash
// workaround: check event type, assuming GATT event types are contagious
if (event->type < GATT_QUERY_COMPLETE) return;
if (event->type > GATT_MTU) return;
gatt_complete_event_t * gatt_complete_event;
BLEDevice device(event->handle);