Mbed OS Reference
Loading...
Searching...
No Matches
DiscoveredService Class Reference

Representation of a GATT service discovered. More...

#include <DiscoveredService.h>

Public Member Functions

const UUIDgetUUID () const
 Get the UUID of the discovered service. More...
 
const GattAttribute::Handle_tgetStartHandle () const
 Get the start handle of the discovered service in the peer's GATT server. More...
 
const GattAttribute::Handle_tgetEndHandle () const
 Get the end handle of the discovered service in the peer's GATT server. More...
 
 DiscoveredService ()
 Construct a DiscoveredService instance. More...
 
void setup (const UUID &uuidIn, GattAttribute::Handle_t startHandleIn, GattAttribute::Handle_t endHandleIn)
 Set information about the discovered service. More...
 
void setup (GattAttribute::Handle_t startHandleIn, GattAttribute::Handle_t endHandleIn)
 Set the start and end handle of the discovered service. More...
 
void setupLongUUID (UUID::LongUUIDBytes_t longUUID, UUID::ByteOrder_t order=UUID::MSB)
 Set the long UUID of the discovered service. More...
 

Detailed Description

Representation of a GATT service discovered.

The discovery procedure discovers GATT Services are discovered on distant GATT servers, which can be initiated by calling GattClient::launchServiceDiscovery() or GattClient::discoverServices(). The discovery process passes instances of this class to the callback handling service discovered.

Discovered services are characterized by the UUID of the service discovered and the range of the GATT attributes belonging to the service.

The UUID can be queried by calling getUUID() while the begining of the attribute range can be obtained through getStartHandle() and the end of the attribute range with a call to getEndHandle().

The characteristics composing the service may be discovered by the function GattClient::launchServiceDiscovery().

Definition at line 53 of file gatt/DiscoveredService.h.

Constructor & Destructor Documentation

◆ DiscoveredService()

Construct a DiscoveredService instance.

Attention
This API is not meant to be used publicly. It is meant to be used by internal APIs of Mbed BLE.

Definition at line 92 of file gatt/DiscoveredService.h.

Member Function Documentation

◆ getUUID()

const UUID & getUUID ( ) const

Get the UUID of the discovered service.

Returns
A reference to the UUID of the discovered service.

Definition at line 60 of file gatt/DiscoveredService.h.

◆ getStartHandle()

const GattAttribute::Handle_t & getStartHandle ( ) const

Get the start handle of the discovered service in the peer's GATT server.

Returns
A reference to the start handle.

Definition at line 70 of file gatt/DiscoveredService.h.

◆ getEndHandle()

const GattAttribute::Handle_t & getEndHandle ( ) const

Get the end handle of the discovered service in the peer's GATT server.

Returns
A reference to the end handle.

Definition at line 80 of file gatt/DiscoveredService.h.

◆ setup() [1/2]

void setup ( const UUID uuidIn,
GattAttribute::Handle_t  startHandleIn,
GattAttribute::Handle_t  endHandleIn 
)

Set information about the discovered service.

Attention
This API is not meant to be used publicly. It is meant to be used by internal APIs of Mbed BLE.
Parameters
[in]uuidInThe UUID of the discovered service.
[in]startHandleInThe start handle of the discovered service in the peer's GATT server.
[in]endHandleInThe end handle of the discovered service in the peer's GATT server.

Definition at line 113 of file gatt/DiscoveredService.h.

◆ setup() [2/2]

void setup ( GattAttribute::Handle_t  startHandleIn,
GattAttribute::Handle_t  endHandleIn 
)

Set the start and end handle of the discovered service.

Attention
This API is not meant to be used publicly. It is meant to be used by internal APIs of Mbed BLE.
Parameters
[in]startHandleInThe start handle of the discovered service in the peer's GATT server.
[in]endHandleInThe end handle of the discovered service in the peer's GATT server.

Definition at line 134 of file gatt/DiscoveredService.h.

◆ setupLongUUID()

void setupLongUUID ( UUID::LongUUIDBytes_t  longUUID,
UUID::ByteOrder_t  order = UUID::MSB 
)

Set the long UUID of the discovered service.

Attention
This API is not meant to be used publicly. It is meant to be used by internal APIs of Mbed BLE.
Parameters
[in]longUUIDThe bytes composing the long UUID of this discovered service.
[in]orderThe byte ordering of longUUID.

Definition at line 152 of file gatt/DiscoveredService.h.