20 #ifndef MBED_GATT_SERVER_H__ 21 #define MBED_GATT_SERVER_H__ 23 #include "platform/mbed_toolchain.h" 25 #include "ble/common/CallChainOfFunctionPointersWithContext.h" 26 #include "ble/common/blecommon.h" 28 #include "ble/gatt/GattService.h" 29 #include "ble/gatt/GattAttribute.h" 30 #include "ble/gatt/GattCallbackParamTypes.h" 34 #if !defined(DOXYGEN_ONLY) 38 #endif // !defined(DOXYGEN_ONLY) 120 (void)connectionHandle;
401 const uint8_t *value,
403 bool localOnly =
false 430 const uint8_t *value,
432 bool localOnly =
false 479 bool isOnDataReadAvailable()
const;
491 "been replaced by GattServer::setEventHandler. Use that function instead.")
492 void onDataSent(const DataSentCallback_t &
callback);
503 template <typename T>
505 "been replaced by
GattServer::setEventHandler. Use that function instead.")
506 void onDataSent(T *objPtr,
void (T::*memberPtr)(
unsigned count))
508 onDataSent({objPtr, memberPtr});
517 "been replaced by GattServer::setEventHandler. Use that function instead.")
530 "been replaced by GattServer::setEventHandler. Use that function instead.")
542 template <
typename T>
544 "been replaced by GattServer::setEventHandler. Use that function instead.")
550 onDataWritten({objPtr, memberPtr});
565 "been replaced by GattServer::setEventHandler. Use that function instead.")
587 "been replaced by GattServer::setEventHandler. Use that function instead.")
598 template <
typename T>
600 "been replaced by GattServer::setEventHandler. Use that function instead.")
606 return onDataRead({objPtr, memberPtr});
621 "been replaced by GattServer::setEventHandler. Use that function instead.")
638 "been replaced by GattServer::setEventHandler. Use that function instead.")
652 template <
typename T>
654 "been replaced by GattServer::setEventHandler. Use that function instead.")
655 void onShutdown(T *objPtr,
void (T::*memberPtr)(const
GattServer *))
657 onShutdown({objPtr, memberPtr});
672 "been replaced by GattServer::setEventHandler. Use that function instead.")
682 "been replaced by GattServer::setEventHandler. Use that function instead.")
692 "been replaced by GattServer::setEventHandler. Use that function instead.")
704 "been replaced by GattServer::setEventHandler. Use that function instead.")
707 #if !defined(DOXYGEN_ONLY) 708 GattServer(impl::GattServer* impl) : impl(impl) {}
711 #endif // !defined(DOXYGEN_ONLY) 714 impl::GattServer *impl;
FunctionPointerWithContext< unsigned > DataSentCallback_t
Event handler invoked when the server has sent data to a client.
Function like object adapter over freestanding and member functions.
CallChainOfFunctionPointersWithContext< unsigned > DataSentCallbackChain_t
Callchain of DataSentCallback_t objects.
Construct and operates a GATT server.
uintptr_t connection_handle_t
Opaque reference to a connection.
virtual void onConfirmationReceived(const GattConfirmationReceivedCallbackParams ¶ms)
Function invoked when an ACK has been received for an indication sent to the client.
FunctionPointerWithContext< GattAttribute::Handle_t > EventCallback_t
Event handler that handles subscription to characteristic updates, unsubscription from characteristic...
virtual void onDataWritten(const GattWriteCallbackParams ¶ms)
Function invoked when a client writes an attribute.
CallChainOfFunctionPointersWithContext< const GattServer * > GattServerShutdownCallbackChain_t
Callchain of GattServerShutdownCallback_t.
CallChainOfFunctionPointersWithContext< const GattReadCallbackParams * > DataReadCallbackChain_t
Callchain of DataReadCallback_t.
virtual void onDataSent(const GattDataSentCallbackParams ¶ms)
Function invoked when the server has sent data to a client as part of a notification/indication.
ble::attribute_handle_t Handle_t
Representation of an attribute handle.
Gatt Data Sent Attribute related events.
virtual void onUpdatesEnabled(const GattUpdatesEnabledCallbackParams ¶ms)
Function invoked when the client has subscribed to characteristic updates.
virtual void onDataRead(const GattReadCallbackParams ¶ms)
Function invoked when a client reads an attribute.
Definition of the general handler of GattServer related events.
GATT Write event definition.
GATT Read event definition.
Representation of a GattServer characteristic.
virtual void onAttMtuChange(ble::connection_handle_t connectionHandle, uint16_t attMtuSize)
Function invoked when the connections changes the ATT_MTU which controls the maximum size of an attri...
Function like object hosting a list of FunctionPointerWithContext.
FunctionPointerWithContext< const GattReadCallbackParams * > DataReadCallback_t
Event handler invoked when the client has read an attribute of the server.
Representation of a GattServer service.
FunctionPointerWithContext< const GattWriteCallbackParams * > DataWrittenCallback_t
Event handler invoked when the client has written an attribute of the server.
virtual void onUpdatesDisabled(const GattUpdatesDisabledCallbackParams ¶ms)
Function invoked when the client has unsubscribed to characteristic updates.
Entry namespace for all BLE API definitions.
CallChainOfFunctionPointersWithContext< const GattWriteCallbackParams * > DataWrittenCallbackChain_t
Callchain of DataWrittenCallback_t objects.
FunctionPointerWithContext< const GattServer * > GattServerShutdownCallback_t
Event handler invoked when the GattServer is reset.
virtual void onShutdown(const GattServer &server)
Function invoked when the GattServer instance is about to be shut down.
ble_error_t
Error codes for the BLE API.