mirror of https://github.com/ARMmbed/mbed-os.git
merge failure fix
parent
30ad32a465
commit
c8d8c4e159
|
@ -55,7 +55,6 @@
|
|||
#endif
|
||||
#endif // BLE_FEATURE_PRIVACY
|
||||
|
||||
|
||||
#if BLE_FEATURE_PERIODIC_ADVERTISING
|
||||
#if !(BLE_FEATURE_EXTENDED_ADVERTISING)
|
||||
#error "BLE feature 'PERIODIC ADVERTISING' requires the 'EXTENDED ADVERTISING' feature"
|
||||
|
|
|
@ -321,48 +321,7 @@ public:
|
|||
/**
|
||||
* Callback which handle attEvt_t and forward them to on_server_event.
|
||||
*/
|
||||
static void att_client_handler(const attEvt_t* event)
|
||||
{
|
||||
#if BLE_FEATURE_GATT_CLIENT
|
||||
// all handlers are stored in a static array
|
||||
static const event_handler_t handlers[] = {
|
||||
&timeout_event_handler,
|
||||
&event_handler<ErrorResponseConverter>,
|
||||
&event_handler<ExchangeMtuResponseConverter>,
|
||||
&event_handler<FindInformationResponseConverter>,
|
||||
&event_handler<FindByTypeValueResponseConverter>,
|
||||
&event_handler<ReadByTypeResponseConverter>,
|
||||
&event_handler<ReadResponseConverter>,
|
||||
&event_handler<ReadBlobResponseConverter>,
|
||||
&event_handler<ReadMultipleResponseConverter>,
|
||||
&event_handler<ReadBygroupTypeResponseConverter>,
|
||||
&event_handler<WriteResponseConverter>,
|
||||
&event_handler<PrepareWriteResponseConverter>,
|
||||
&event_handler<ExecuteWriteResponseConverter>,
|
||||
&event_handler<HandleValueIndicationConverter>,
|
||||
&event_handler<HandleValueNotificationConverter>
|
||||
};
|
||||
|
||||
// event->hdr.param: connection handle
|
||||
// event->header.event: opcode from the request
|
||||
// event->header.status: success or error code ...
|
||||
// event->pValue: starting after opcode for response; starting after opcode + handle for server initiated responses.
|
||||
// event->handle: handle for server initiated responses
|
||||
|
||||
// traverse all handlers and execute them with the event in input.
|
||||
// exit if an handler has handled the event.
|
||||
for(size_t i = 0; i < (sizeof(handlers)/sizeof(handlers[0])); ++i) {
|
||||
if (handlers[i](event)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif // BLE_FEATURE_GATT_CLIENT
|
||||
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
// pass events not handled to the server side
|
||||
ble::vendor::cordio::GattServer::getInstance().att_cb(event);
|
||||
#endif // BLE_FEATURE_GATT_SERVER
|
||||
}
|
||||
static void att_client_handler(const attEvt_t* event);
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace cordio {
|
|||
|
||||
void CordioAttClient::att_client_handler(const attEvt_t* event)
|
||||
{
|
||||
#if BLE_FEATURE_GATT_CLIENT
|
||||
if (event->hdr.status == ATT_SUCCESS && event->hdr.event == ATT_MTU_UPDATE_IND) {
|
||||
ble::vendor::cordio::BLE& ble = ble::vendor::cordio::BLE::deviceInstance();
|
||||
impl::PalGattClientImpl::EventHandler *handler = ble.getPalGattClient().get_event_handler();
|
||||
|
@ -64,9 +65,12 @@ void CordioAttClient::att_client_handler(const attEvt_t* event)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif // BLE_FEATURE_GATT_CLIENT
|
||||
|
||||
#if BLE_FEATURE_GATT_SERVER
|
||||
// pass events not handled to the server side
|
||||
ble::vendor::cordio::GattServer::getInstance().att_cb(event);
|
||||
#endif // BLE_FEATURE_GATT_SERVER
|
||||
}
|
||||
|
||||
} // cordio
|
||||
|
|
Loading…
Reference in New Issue