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;
197 MBED_DEPRECATED_SINCE(
"mbed-os-6.11.0",
"This event is never triggered. Indication triggers onDataSent" 198 "when confirmation is received.")
407 const uint8_t *value,
409 bool localOnly =
false 436 const uint8_t *value,
438 bool localOnly =
false 485 bool isOnDataReadAvailable()
const;
497 "been replaced by GattServer::setEventHandler. Use that function instead.")
498 void onDataSent(const DataSentCallback_t &
callback);
509 template <typename T>
511 "been replaced by
GattServer::setEventHandler. Use that function instead.")
512 void onDataSent(T *objPtr,
void (T::*memberPtr)(
unsigned count))
514 onDataSent({objPtr, memberPtr});
523 "been replaced by GattServer::setEventHandler. Use that function instead.")
536 "been replaced by GattServer::setEventHandler. Use that function instead.")
548 template <
typename T>
550 "been replaced by GattServer::setEventHandler. Use that function instead.")
556 onDataWritten({objPtr, memberPtr});
571 "been replaced by GattServer::setEventHandler. Use that function instead.")
593 "been replaced by GattServer::setEventHandler. Use that function instead.")
604 template <
typename T>
606 "been replaced by GattServer::setEventHandler. Use that function instead.")
612 return onDataRead({objPtr, memberPtr});
627 "been replaced by GattServer::setEventHandler. Use that function instead.")
644 "been replaced by GattServer::setEventHandler. Use that function instead.")
658 template <
typename T>
660 "been replaced by GattServer::setEventHandler. Use that function instead.")
661 void onShutdown(T *objPtr,
void (T::*memberPtr)(const
GattServer *))
663 onShutdown({objPtr, memberPtr});
678 "been replaced by GattServer::setEventHandler. Use that function instead.")
688 "been replaced by GattServer::setEventHandler. Use that function instead.")
698 "been replaced by GattServer::setEventHandler. Use that function instead.")
710 "been replaced by an event handler. Indication confirmation triggers" 711 "GattServer::onDataSent event instead.")
714 #if !defined(DOXYGEN_ONLY) 715 GattServer(impl::GattServer* impl) : impl(impl) {}
718 #endif // !defined(DOXYGEN_ONLY) 721 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 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.