NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches
Bluetooth Generic Attribute Profile (GATT)

Bluetooth Generic Attribute Profile (GATT) More...

Classes

struct  ble_gatt_cpfd
 
struct  ble_gatt_access_ctxt
 
struct  ble_gatt_register_ctxt
 

Macros

#define BLE_GATT_CHR_FORMAT_BOOLEAN   0x01
 
#define BLE_GATT_CHR_UNIT_UNITLESS   0x2700 /* Unitless */
 
#define BLE_GATT_CHR_NAMESPACE_BT_SIG   0x01
 
#define BLE_GATT_CHR_BT_SIG_DESC_UNKNOWN   0x0000
 
#define BLE_GATT_CHR_BT_SIG_DESC_FRONT   0x0100
 

Typedefs

typedef int ble_gatt_attr_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attr, void *arg)
 
typedef int ble_gatt_attr_mult_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attrs, uint8_t num_attrs, void *arg)
 
typedef int ble_gatt_reliable_attr_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attrs, uint8_t num_attrs, void *arg)
 

Functions

int ble_gattc_exchange_mtu (uint16_t conn_handle, ble_gatt_mtu_fn *cb, void *cb_arg)
 
int ble_gattc_disc_all_svcs (uint16_t conn_handle, ble_gatt_disc_svc_fn *cb, void *cb_arg)
 
int ble_gattc_disc_svc_by_uuid (uint16_t conn_handle, const ble_uuid_t *uuid, ble_gatt_disc_svc_fn *cb, void *cb_arg)
 
int ble_gattc_find_inc_svcs (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, ble_gatt_disc_svc_fn *cb, void *cb_arg)
 
int ble_gattc_disc_all_chrs (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, ble_gatt_chr_fn *cb, void *cb_arg)
 
int ble_gattc_disc_chrs_by_uuid (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, const ble_uuid_t *uuid, ble_gatt_chr_fn *cb, void *cb_arg)
 
int ble_gattc_disc_all_dscs (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, ble_gatt_dsc_fn *cb, void *cb_arg)
 
int ble_gattc_read (uint16_t conn_handle, uint16_t attr_handle, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_read_by_uuid (uint16_t conn_handle, uint16_t start_handle, uint16_t end_handle, const ble_uuid_t *uuid, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_read_long (uint16_t conn_handle, uint16_t handle, uint16_t offset, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_read_mult (uint16_t conn_handle, const uint16_t *handles, uint8_t num_handles, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_write_no_rsp (uint16_t conn_handle, uint16_t attr_handle, struct os_mbuf *om)
 
int ble_gattc_write_no_rsp_flat (uint16_t conn_handle, uint16_t attr_handle, const void *data, uint16_t data_len)
 
int ble_gattc_signed_write (uint16_t conn_handle, uint16_t attr_handle, struct os_mbuf *txom)
 
int ble_gattc_write (uint16_t conn_handle, uint16_t attr_handle, struct os_mbuf *om, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_write_flat (uint16_t conn_handle, uint16_t attr_handle, const void *data, uint16_t data_len, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_write_long (uint16_t conn_handle, uint16_t attr_handle, uint16_t offset, struct os_mbuf *om, ble_gatt_attr_fn *cb, void *cb_arg)
 
int ble_gattc_write_reliable (uint16_t conn_handle, struct ble_gatt_attr *attrs, int num_attrs, ble_gatt_reliable_attr_fn *cb, void *cb_arg)
 
int ble_gatts_notify_custom (uint16_t conn_handle, uint16_t att_handle, struct os_mbuf *om)
 
int ble_gattc_notify_custom (uint16_t conn_handle, uint16_t att_handle, struct os_mbuf *om)
 
int ble_gatts_notify (uint16_t conn_handle, uint16_t chr_val_handle)
 
int ble_gattc_notify (uint16_t conn_handle, uint16_t chr_val_handle)
 
int ble_gatts_indicate_custom (uint16_t conn_handle, uint16_t chr_val_handle, struct os_mbuf *txom)
 
int ble_gattc_indicate_custom (uint16_t conn_handle, uint16_t chr_val_handle, struct os_mbuf *txom)
 
int ble_gatts_indicate (uint16_t conn_handle, uint16_t chr_val_handle)
 
int ble_gattc_indicate (uint16_t conn_handle, uint16_t chr_val_handle)
 
int ble_gatts_add_svcs (const struct ble_gatt_svc_def *svcs)
 
int ble_gatts_svc_set_visibility (uint16_t handle, int visible)
 
int ble_gatts_count_cfg (const struct ble_gatt_svc_def *defs)
 
void ble_gatts_chr_updated (uint16_t chr_val_handle)
 
int ble_gatts_find_svc (const ble_uuid_t *uuid, uint16_t *out_handle)
 
int ble_gatts_find_chr (const ble_uuid_t *svc_uuid, const ble_uuid_t *chr_uuid, uint16_t *out_def_handle, uint16_t *out_val_handle)
 
int ble_gatts_find_dsc (const ble_uuid_t *svc_uuid, const ble_uuid_t *chr_uuid, const ble_uuid_t *dsc_uuid, uint16_t *out_dsc_handle)
 
void ble_gatts_show_local (void)
 
int ble_gatts_reset (void)
 
int ble_gatts_start (void)
 
int ble_gatts_peer_cl_sup_feat_update (uint16_t conn_handle, struct os_mbuf *om)
 
int ble_gatts_peer_cl_sup_feat_get (uint16_t conn_handle, uint8_t *out_supported_feat, uint8_t len)
 
int ble_gatts_get_cfgable_chrs (void)
 

Detailed Description

Bluetooth Generic Attribute Profile (GATT)

Macro Definition Documentation

◆ BLE_GATT_CHR_BT_SIG_DESC_FRONT

#define BLE_GATT_CHR_BT_SIG_DESC_FRONT   0x0100

0x0001 - 0x00FF represent themselves. See Ref for more info

◆ BLE_GATT_CHR_BT_SIG_DESC_UNKNOWN

#define BLE_GATT_CHR_BT_SIG_DESC_UNKNOWN   0x0000

Client Presentation Format GATT Description for Name Space BT_SIG Ref: Assigned Numbers Specification

◆ BLE_GATT_CHR_FORMAT_BOOLEAN

#define BLE_GATT_CHR_FORMAT_BOOLEAN   0x01

Client Presentation Format GATT Format Types Ref: Assigned Numbers Specification

◆ BLE_GATT_CHR_NAMESPACE_BT_SIG

#define BLE_GATT_CHR_NAMESPACE_BT_SIG   0x01

Client Presentation Format GATT Name Space Ref: Assigned Numbers Specification

◆ BLE_GATT_CHR_UNIT_UNITLESS

#define BLE_GATT_CHR_UNIT_UNITLESS   0x2700 /* Unitless */

Client Presentation Format GATT Unit UUIDs Ref: Assigned Numbers Specification

Typedef Documentation

◆ ble_gatt_attr_fn

typedef int ble_gatt_attr_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attr, void *arg)

The host will free the attribute mbuf automatically after the callback is executed. The application can take ownership of the mbuf and prevent it from being freed by assigning NULL to attr->om.

◆ ble_gatt_attr_mult_fn

typedef int ble_gatt_attr_mult_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attrs, uint8_t num_attrs, void *arg)

The host will free the attribute mbuf automatically after the callback is executed. The application can take ownership of the mbuf and prevent it from being freed by assigning NULL to attr->om.

◆ ble_gatt_reliable_attr_fn

typedef int ble_gatt_reliable_attr_fn(uint16_t conn_handle, const struct ble_gatt_error *error, struct ble_gatt_attr *attrs, uint8_t num_attrs, void *arg)

The host will free the attribute mbufs automatically after the callback is executed. The application can take ownership of the mbufs and prevent them from being freed by assigning NULL to each attribute's om field.

Function Documentation

◆ ble_gattc_disc_all_chrs()

int ble_gattc_disc_all_chrs ( uint16_t  conn_handle,
uint16_t  start_handle,
uint16_t  end_handle,
ble_gatt_chr_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Discover All Characteristics of a Service.

Parameters
conn_handleThe connection over which to execute the procedure.
start_handleThe handle to begin the search at (generally the service definition handle).
end_handleThe handle to end the search at (generally the last handle in the service).
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_disc_all_dscs()

int ble_gattc_disc_all_dscs ( uint16_t  conn_handle,
uint16_t  start_handle,
uint16_t  end_handle,
ble_gatt_dsc_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Discover All Characteristic Descriptors.

Parameters
conn_handleThe connection over which to execute the procedure.
chr_val_handleThe handle of the characteristic value attribute.
chr_end_handleThe last handle in the characteristic definition.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_disc_all_svcs()

int ble_gattc_disc_all_svcs ( uint16_t  conn_handle,
ble_gatt_disc_svc_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Discover All Primary Services.

Parameters
conn_handleThe connection over which to execute the procedure.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.

◆ ble_gattc_disc_chrs_by_uuid()

int ble_gattc_disc_chrs_by_uuid ( uint16_t  conn_handle,
uint16_t  start_handle,
uint16_t  end_handle,
const ble_uuid_t uuid,
ble_gatt_chr_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Discover Characteristics by UUID.

Parameters
conn_handleThe connection over which to execute the procedure.
start_handleThe handle to begin the search at (generally the service definition handle).
end_handleThe handle to end the search at (generally the last handle in the service).
chr_uuid128The 128-bit UUID of the characteristic to discover.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_disc_svc_by_uuid()

int ble_gattc_disc_svc_by_uuid ( uint16_t  conn_handle,
const ble_uuid_t uuid,
ble_gatt_disc_svc_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Discover Primary Service by Service UUID.

Parameters
conn_handleThe connection over which to execute the procedure.
service_uuid128The 128-bit UUID of the service to discover.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_exchange_mtu()

int ble_gattc_exchange_mtu ( uint16_t  conn_handle,
ble_gatt_mtu_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Exchange MTU.

Parameters
conn_handleThe connection over which to execute the procedure.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_find_inc_svcs()

int ble_gattc_find_inc_svcs ( uint16_t  conn_handle,
uint16_t  start_handle,
uint16_t  end_handle,
ble_gatt_disc_svc_fn *  cb,
void *  cb_arg 
)

Initiates GATT procedure: Find Included Services.

Parameters
conn_handleThe connection over which to execute the procedure.
start_handleThe handle to begin the search at (generally the service definition handle).
end_handleThe handle to end the search at (generally the last handle in the service).
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_indicate()

int ble_gattc_indicate ( uint16_t  conn_handle,
uint16_t  chr_val_handle 
)

Deprecated. Should not be used. Use ble_gatts_indicate instead.

◆ ble_gattc_indicate_custom()

int ble_gattc_indicate_custom ( uint16_t  conn_handle,
uint16_t  chr_val_handle,
struct os_mbuf txom 
)

Deprecated. Should not be used. Use ble_gatts_indicate_custom instead.

◆ ble_gattc_notify()

int ble_gattc_notify ( uint16_t  conn_handle,
uint16_t  chr_val_handle 
)

Deprecated. Should not be used. Use ble_gatts_notify instead.

◆ ble_gattc_notify_custom()

int ble_gattc_notify_custom ( uint16_t  conn_handle,
uint16_t  att_handle,
struct os_mbuf om 
)

Deprecated. Should not be used. Use ble_gatts_notify_custom instead.

◆ ble_gattc_read()

int ble_gattc_read ( uint16_t  conn_handle,
uint16_t  attr_handle,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Read Characteristic Value.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to read.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_read_by_uuid()

int ble_gattc_read_by_uuid ( uint16_t  conn_handle,
uint16_t  start_handle,
uint16_t  end_handle,
const ble_uuid_t uuid,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Read Using Characteristic UUID.

Parameters
conn_handleThe connection over which to execute the procedure.
start_handleThe first handle to search (generally the handle of the service definition).
end_handleThe last handle to search (generally the last handle in the service definition).
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_read_long()

int ble_gattc_read_long ( uint16_t  conn_handle,
uint16_t  handle,
uint16_t  offset,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Read Long Characteristic Values.

Parameters
conn_handleThe connection over which to execute the procedure.
handleThe handle of the characteristic value to read.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_read_mult()

int ble_gattc_read_mult ( uint16_t  conn_handle,
const uint16_t *  handles,
uint8_t  num_handles,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Read Multiple Characteristic Values.

Parameters
conn_handleThe connection over which to execute the procedure.
handlesAn array of 16-bit attribute handles to read.
num_handlesThe number of entries in the "handles" array.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_signed_write()

int ble_gattc_signed_write ( uint16_t  conn_handle,
uint16_t  attr_handle,
struct os_mbuf txom 
)

Initiates GATT procedure: Signed Write. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
txomThe value to write to the characteristic.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write()

int ble_gattc_write ( uint16_t  conn_handle,
uint16_t  attr_handle,
struct os_mbuf om,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Write Characteristic Value. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
txomThe value to write to the characteristic.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write_flat()

int ble_gattc_write_flat ( uint16_t  conn_handle,
uint16_t  attr_handle,
const void *  data,
uint16_t  data_len,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Write Characteristic Value (flat buffer version).

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
valueThe value to write to the characteristic.
value_lenThe number of bytes to write.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write_long()

int ble_gattc_write_long ( uint16_t  conn_handle,
uint16_t  attr_handle,
uint16_t  offset,
struct os_mbuf om,
ble_gatt_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Write Long Characteristic Values. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
txomThe value to write to the characteristic.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write_no_rsp()

int ble_gattc_write_no_rsp ( uint16_t  conn_handle,
uint16_t  attr_handle,
struct os_mbuf om 
)

Initiates GATT procedure: Write Without Response. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
txomThe value to write to the characteristic.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write_no_rsp_flat()

int ble_gattc_write_no_rsp_flat ( uint16_t  conn_handle,
uint16_t  attr_handle,
const void *  data,
uint16_t  data_len 
)

Initiates GATT procedure: Write Without Response. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attr_handleThe handle of the characteristic value to write to.
valueThe value to write to the characteristic.
value_lenThe number of bytes to write.
Returns
0 on success; nonzero on failure.

◆ ble_gattc_write_reliable()

int ble_gattc_write_reliable ( uint16_t  conn_handle,
struct ble_gatt_attr *  attrs,
int  num_attrs,
ble_gatt_reliable_attr_fn cb,
void *  cb_arg 
)

Initiates GATT procedure: Reliable Writes. This function consumes the supplied mbufs regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
attrsAn array of attribute descriptors; specifies which characteristics to write to and what data to write to them. The mbuf pointer in each attribute is set to NULL by this function.
num_attrsThe number of characteristics to write; equal to the number of elements in the 'attrs' array.
cbThe function to call to report procedure status updates; null for no callback.
cb_argThe optional argument to pass to the callback function.

◆ ble_gatts_add_svcs()

int ble_gatts_add_svcs ( const struct ble_gatt_svc_def *  svcs)

Queues a set of service definitions for registration. All services queued in this manner get registered when ble_gatts_start() is called.

Parameters
svcsAn array of service definitions to queue for registration. This array must be terminated with an entry whose 'type' equals 0.
Returns
0 on success; BLE_HS_ENOMEM on heap exhaustion.

◆ ble_gatts_chr_updated()

void ble_gatts_chr_updated ( uint16_t  chr_val_handle)

Send notification (or indication) to any connected devices that have subscribed for notification (or indication) for specified characteristic.

Parameters
chr_val_handleCharacteristic value handle

◆ ble_gatts_count_cfg()

int ble_gatts_count_cfg ( const struct ble_gatt_svc_def *  defs)

Adjusts a host configuration object's settings to accommodate the specified service definition array. This function adds the counts to the appropriate fields in the supplied configuration object without clearing them first, so it can be called repeatedly with different inputs to calculate totals. Be sure to zero the GATT server settings prior to the first call to this function.

Parameters
defsThe service array containing the resource definitions to be counted.
Returns
0 on success; BLE_HS_EINVAL if the svcs array contains an invalid resource definition.

◆ ble_gatts_find_chr()

int ble_gatts_find_chr ( const ble_uuid_t svc_uuid,
const ble_uuid_t chr_uuid,
uint16_t *  out_def_handle,
uint16_t *  out_val_handle 
)

Retrieves the pair of attribute handles associated with a local GATT characteristic.

Parameters
svc_uuidThe UUID of the parent service.
chr_uuidThe UUID of the characteristic to look up.
out_def_handleOn success, populated with the handle of the characteristic definition attribute. Pass null if you don't need this value.
out_val_handleOn success, populated with the handle of the characteristic value attribute. Pass null if you don't need this value.
Returns
0 on success; BLE_HS_ENOENT if the specified service or characteristic could not be found.

◆ ble_gatts_find_dsc()

int ble_gatts_find_dsc ( const ble_uuid_t svc_uuid,
const ble_uuid_t chr_uuid,
const ble_uuid_t dsc_uuid,
uint16_t *  out_dsc_handle 
)

Retrieves the attribute handle associated with a local GATT descriptor.

Parameters
svc_uuidThe UUID of the grandparent service.
chr_uuidThe UUID of the parent characteristic.
dsc_uuidThe UUID of the descriptor ro look up.
out_handleOn success, populated with the handle of the descriptor attribute. Pass null if you don't need this value.
Returns
0 on success; BLE_HS_ENOENT if the specified service, characteristic, or descriptor could not be found.

◆ ble_gatts_find_svc()

int ble_gatts_find_svc ( const ble_uuid_t uuid,
uint16_t *  out_handle 
)

Retrieves the attribute handle associated with a local GATT service.

Parameters
uuidThe UUID of the service to look up.
out_handleOn success, populated with the handle of the service attribute. Pass null if you don't need this value.
Returns
0 on success; BLE_HS_ENOENT if the specified service could not be found.

◆ ble_gatts_get_cfgable_chrs()

int ble_gatts_get_cfgable_chrs ( void  )

Returns the current number of configured characteristics

◆ ble_gatts_indicate()

int ble_gatts_indicate ( uint16_t  conn_handle,
uint16_t  chr_val_handle 
)

Sends a characteristic indication. The content of the message is read from the specified characteristic.

Parameters
conn_handleThe connection over which to execute the procedure.
chr_val_handleThe value attribute handle of the characteristic to include in the outgoing indication.
Returns
0 on success; nonzero on failure.

◆ ble_gatts_indicate_custom()

int ble_gatts_indicate_custom ( uint16_t  conn_handle,
uint16_t  chr_val_handle,
struct os_mbuf txom 
)

Sends a "free-form" characteristic indication. The provided mbuf contains the indication payload. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
chr_val_handleThe value attribute handle of the characteristic to include in the outgoing indication.
txomThe data to include in the indication.
Returns
0 on success; nonzero on failure.

◆ ble_gatts_notify()

int ble_gatts_notify ( uint16_t  conn_handle,
uint16_t  chr_val_handle 
)

Sends a characteristic notification. The content of the message is read from the specified characteristic.

Parameters
conn_handleThe connection over which to execute the procedure.
chr_val_handleThe value attribute handle of the characteristic to include in the outgoing notification.
Returns
0 on success; nonzero on failure.

◆ ble_gatts_notify_custom()

int ble_gatts_notify_custom ( uint16_t  conn_handle,
uint16_t  att_handle,
struct os_mbuf om 
)

Sends a "free-form" characteristic notification. This function consumes the supplied mbuf regardless of the outcome.

Parameters
conn_handleThe connection over which to execute the procedure.
chr_val_handleThe attribute handle to indicate in the outgoing notification.
txomThe value to write to the characteristic.
Returns
0 on success; nonzero on failure.

◆ ble_gatts_peer_cl_sup_feat_get()

int ble_gatts_peer_cl_sup_feat_get ( uint16_t  conn_handle,
uint8_t *  out_supported_feat,
uint8_t  len 
)

Gets Client Supported Features for specified connection.

Parameters
conn_handleConnection handle identifying connection for which Client Supported Features should be saved
out_supported_featClient supported features to be returned.
Returns
0 on success; BLE_HS_ENOTCONN if no matching connection was found BLE_HS_EINVAL if supplied buffer is empty or if any Client Supported Feature was attempted to be disabled. A BLE host core return code on unexpected error.

◆ ble_gatts_peer_cl_sup_feat_update()

int ble_gatts_peer_cl_sup_feat_update ( uint16_t  conn_handle,
struct os_mbuf om 
)

Saves Client Supported Features for specified connection.

Parameters
conn_handleConnection handle identifying connection for which Client Supported Features should be saved
omThe mbuf chain to set value from.
Returns
0 on success; BLE_HS_ENOTCONN if no matching connection was found BLE_HS_EINVAL if supplied buffer is empty or if any Client Supported Feature was attempted to be disabled. A BLE host core return code on unexpected error.

◆ ble_gatts_reset()

int ble_gatts_reset ( void  )

Resets the GATT server to its initial state. On success, this function removes all supported services, characteristics, and descriptors. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).

Returns
0 on success; BLE_HS_EBUSY if the GATT server could not be reset due to existing connections or active GAP procedures.

◆ ble_gatts_show_local()

void ble_gatts_show_local ( void  )

Prints dump of local GATT database. This is useful to log local state of database in human readable form.

◆ ble_gatts_start()

int ble_gatts_start ( void  )

Makes all registered services available to peers. This function gets called automatically by the NimBLE host on startup; manual calls are only necessary for replacing the set of supported services with a new one. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).

Returns
0 on success; A BLE host core return code on unexpected error.

◆ ble_gatts_svc_set_visibility()

int ble_gatts_svc_set_visibility ( uint16_t  handle,
int  visible 
)

Set visibility of local GATT service. Invisible services are not removed from database but are not discoverable by peer devices. Service Changed should be handled by application when needed by calling ble_svc_gatt_changed().

Parameters
handleHandle of service
visiblenon-zero if service should be visible
Returns
0 on success; BLE_HS_ENOENT if service wasn't found.