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) 122 (void)connectionHandle;
199 MBED_DEPRECATED_SINCE(
"mbed-os-6.11.0",
"This event is never triggered. Indication triggers onDataSent" 200 "when confirmation is received.")
414 const uint8_t *value,
416 bool localOnly =
false 446 const uint8_t *value,
448 bool localOnly =
false 499 bool isOnDataReadAvailable()
const;
511 "been replaced by GattServer::setEventHandler. Use that function instead.")
512 void onDataSent(const DataSentCallback_t &
callback);
523 template <typename T>
525 "been replaced by
GattServer::setEventHandler. Use that function instead.")
526 void onDataSent(T *objPtr,
void (T::*memberPtr)(
unsigned count))
528 onDataSent({objPtr, memberPtr});
537 "been replaced by GattServer::setEventHandler. Use that function instead.")
550 "been replaced by GattServer::setEventHandler. Use that function instead.")
562 template <
typename T>
564 "been replaced by GattServer::setEventHandler. Use that function instead.")
570 onDataWritten({objPtr, memberPtr});
585 "been replaced by GattServer::setEventHandler. Use that function instead.")
607 "been replaced by GattServer::setEventHandler. Use that function instead.")
618 template <
typename T>
620 "been replaced by GattServer::setEventHandler. Use that function instead.")
626 return onDataRead({objPtr, memberPtr});
641 "been replaced by GattServer::setEventHandler. Use that function instead.")
658 "been replaced by GattServer::setEventHandler. Use that function instead.")
672 template <
typename T>
674 "been replaced by GattServer::setEventHandler. Use that function instead.")
675 void onShutdown(T *objPtr,
void (T::*memberPtr)(const
GattServer *))
677 onShutdown({objPtr, memberPtr});
692 "been replaced by GattServer::setEventHandler. Use that function instead.")
702 "been replaced by GattServer::setEventHandler. Use that function instead.")
712 "been replaced by GattServer::setEventHandler. Use that function instead.")
724 "been replaced by an event handler. Indication confirmation triggers" 725 "GattServer::onDataSent event instead.")
728 #if !defined(DOXYGEN_ONLY) 729 GattServer(impl::GattServer* impl) : impl(impl) {}
732 #endif // !defined(DOXYGEN_ONLY) 735 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.
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.
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.
Gatt Updates Changed Attribute related events.
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 from 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.