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;
405 const uint8_t *value,
407 bool localOnly =
false 434 const uint8_t *value,
436 bool localOnly =
false 483 bool isOnDataReadAvailable()
const;
495 "been replaced by GattServer::setEventHandler. Use that function instead.")
496 void onDataSent(const DataSentCallback_t &
callback);
507 template <typename T>
509 "been replaced by
GattServer::setEventHandler. Use that function instead.")
510 void onDataSent(T *objPtr,
void (T::*memberPtr)(
unsigned count))
512 onDataSent({objPtr, memberPtr});
521 "been replaced by GattServer::setEventHandler. Use that function instead.")
534 "been replaced by GattServer::setEventHandler. Use that function instead.")
546 template <
typename T>
548 "been replaced by GattServer::setEventHandler. Use that function instead.")
554 onDataWritten({objPtr, memberPtr});
569 "been replaced by GattServer::setEventHandler. Use that function instead.")
591 "been replaced by GattServer::setEventHandler. Use that function instead.")
602 template <
typename T>
604 "been replaced by GattServer::setEventHandler. Use that function instead.")
610 return onDataRead({objPtr, memberPtr});
625 "been replaced by GattServer::setEventHandler. Use that function instead.")
642 "been replaced by GattServer::setEventHandler. Use that function instead.")
656 template <
typename T>
658 "been replaced by GattServer::setEventHandler. Use that function instead.")
659 void onShutdown(T *objPtr,
void (T::*memberPtr)(const
GattServer *))
661 onShutdown({objPtr, memberPtr});
676 "been replaced by GattServer::setEventHandler. Use that function instead.")
686 "been replaced by GattServer::setEventHandler. Use that function instead.")
696 "been replaced by GattServer::setEventHandler. Use that function instead.")
708 "been replaced by GattServer::setEventHandler. Use that function instead.")
711 #if !defined(DOXYGEN_ONLY) 712 GattServer(impl::GattServer* impl) : impl(impl) {}
715 #endif // !defined(DOXYGEN_ONLY) 718 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.