GATT Database#

GATT Database.

These commands and events are used for managing the local GATT database.

Many commands in this class return the handles of created attributes. These handles may change during commit if attributes are not created in the order they present in the database. For example, when creating a new service using the sl_bt_gattdb_add_service command, the service declaration handle returned from this command becomes invalid later when an attribute is added or removed in front of this service. If the user requires that the attribute handles returned from these commands must remain valid after the database update has been committed, attributes must be created in the order they present in the database.

Modules#

GATT Service Property Flags

GATT Attribute Security Requirement Flags

GATT Database Flags

GATT Characteristic Property Flags

GATT Descriptor Property Flags

GATT Attribute State Flags

Enumerations#

enum
sl_bt_gattdb_primary_service = 0x0
sl_bt_gattdb_secondary_service = 0x1
}

This enum defines GATT service types.

enum
sl_bt_gattdb_category_service = 0x1
sl_bt_gattdb_category_include = 0x2
sl_bt_gattdb_category_characteristic_declaration = 0x3
sl_bt_gattdb_category_characteristic_value = 0x4
sl_bt_gattdb_category_descriptor = 0x5
}

This enum defines the high-level category of an attribute in the local GATT database.

enum
sl_bt_gattdb_fixed_length_value = 0x1
sl_bt_gattdb_variable_length_value = 0x2
sl_bt_gattdb_user_managed_value = 0x3
}

This enum defines characteristic and descriptor value types.

Functions#

sl_status_t
sl_bt_gattdb_new_session(uint16_t *session)
sl_status_t
sl_bt_gattdb_add_service(uint16_t session, uint8_t type, uint8_t property, size_t uuid_len, const uint8_t *uuid, uint16_t *service)
sl_status_t
sl_bt_gattdb_remove_service(uint16_t session, uint16_t service)
sl_status_t
sl_bt_gattdb_add_included_service(uint16_t session, uint16_t service, uint16_t included_service, uint16_t *attribute)
sl_status_t
sl_bt_gattdb_remove_included_service(uint16_t session, uint16_t attribute)
sl_status_t
sl_bt_gattdb_add_uuid16_characteristic(uint16_t session, uint16_t service, uint16_t property, uint16_t security, uint8_t flag, sl_bt_uuid_16_t uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t *value, uint16_t *characteristic)
sl_status_t
sl_bt_gattdb_add_uuid128_characteristic(uint16_t session, uint16_t service, uint16_t property, uint16_t security, uint8_t flag, uuid_128 uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t *value, uint16_t *characteristic)
sl_status_t
sl_bt_gattdb_remove_characteristic(uint16_t session, uint16_t characteristic)
sl_status_t
sl_bt_gattdb_add_uuid16_descriptor(uint16_t session, uint16_t characteristic, uint16_t property, uint16_t security, sl_bt_uuid_16_t uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t *value, uint16_t *descriptor)
sl_status_t
sl_bt_gattdb_add_uuid128_descriptor(uint16_t session, uint16_t characteristic, uint16_t property, uint16_t security, uuid_128 uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t *value, uint16_t *descriptor)
sl_status_t
sl_bt_gattdb_remove_descriptor(uint16_t session, uint16_t descriptor)
sl_status_t
sl_bt_gattdb_start_service(uint16_t session, uint16_t service)
sl_status_t
sl_bt_gattdb_stop_service(uint16_t session, uint16_t service)
sl_status_t
sl_bt_gattdb_start_characteristic(uint16_t session, uint16_t characteristic)
sl_status_t
sl_bt_gattdb_stop_characteristic(uint16_t session, uint16_t characteristic)
sl_status_t
sl_bt_gattdb_commit(uint16_t session)
sl_status_t
sl_bt_gattdb_abort(uint16_t session)
sl_status_t
sl_bt_gattdb_get_attribute_state(uint16_t attribute, uint8_t *state)

Macros#

#define
#define
#define
#define

Enumeration Documentation#

sl_bt_gattdb_service_type_t#

sl_bt_gattdb_service_type_t

This enum defines GATT service types.

Enumerator
sl_bt_gattdb_primary_service

(0x0) Primary service

sl_bt_gattdb_secondary_service

(0x1) Secondary service


Definition at line 8503 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_attribute_category_t#

sl_bt_gattdb_attribute_category_t

This enum defines the high-level category of an attribute in the local GATT database.

Enumerator
sl_bt_gattdb_category_service

(0x1) The attribute is a service declaration

sl_bt_gattdb_category_include

(0x2) The attribute is an include declaration

sl_bt_gattdb_category_characteristic_declaration

(0x3) The attribute is a characteristic declaration

sl_bt_gattdb_category_characteristic_value

(0x4) The attribute is a characteristic value

sl_bt_gattdb_category_descriptor

(0x5) The attribute is a descriptor


Definition at line 8513 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_value_type_t#

sl_bt_gattdb_value_type_t

This enum defines characteristic and descriptor value types.

Enumerator
sl_bt_gattdb_fixed_length_value

(0x1) A fixed-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

sl_bt_gattdb_variable_length_value

(0x2) A variable-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

sl_bt_gattdb_user_managed_value

(0x3) A value managed by the user application for responding the read and write requests of remote GATT clients.


Definition at line 8539 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

Function Documentation#

sl_bt_gattdb_new_session#

sl_status_t sl_bt_gattdb_new_session (uint16_t * session)
Parameters
[out]session

The database update session ID

Start a new GATT database update session. If the operation is successful, the Bluetooth stack returns a session ID, with which the GATT database can be updated by calling other database management APIs of this class. Changes in the database are not immediately saved. Unsaved changes are invisible to a connected remote GATT client.

After all changes were performed successfully, commit the changes using the sl_bt_gattdb_commit command. The Bluetooth stack will save the changes and handle GATT caching as needed. Unsaved database changes can also be canceled by calling the sl_bt_gattdb_abort command. In either case, after a commit or abort command is called, the current session is closed and the session ID becomes invalid.

Only one session is allowed at a time. Error SL_STATUS_ALREADY_EXISTS is returned if another session has been started already.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8724 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_service#

sl_status_t sl_bt_gattdb_add_service (uint16_t session, uint8_t type, uint8_t property, size_t uuid_len, const uint8_t * uuid, uint16_t * service)
Parameters
[in]session

The database update session ID

[in]type

Enum sl_bt_gattdb_service_type_t. The service type. Values:

  • sl_bt_gattdb_primary_service (0x0): Primary service

  • sl_bt_gattdb_secondary_service (0x1): Secondary service

[in]property

Service properties. Value: 0 or bit flag SL_BT_GATTDB_ADVERTISED_SERVICE

[in]uuid_len

Length of data in uuid

[in]uuid

The service UUID in little endian format

[out]service

The service declaration attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add a service into the local GATT database. When successful, the service is appended to the service list and is in stopped state. Use sl_bt_gattdb_start_service command to set it visible to remote GATT clients.

The user application is not allowed to add the Generic Attribute Profile service. If the application needs GATT caching, enable the feature in the configuration of this component and the GATT server will handle GATT caching according to the procedures specified by the Bluetooth core specification.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8753 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_remove_service#

sl_status_t sl_bt_gattdb_remove_service (uint16_t session, uint16_t service)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service

Remove a service and its characteristics from the local GATT database.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8770 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_included_service#

sl_status_t sl_bt_gattdb_add_included_service (uint16_t session, uint16_t service, uint16_t included_service, uint16_t * attribute)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service which the included-service attribute is added to

[in]included_service

The service declaration attribute handle of the service to be included

[out]attribute

The included-service attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add an included-service attribute to a service.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8788 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_remove_included_service#

sl_status_t sl_bt_gattdb_remove_included_service (uint16_t session, uint16_t attribute)
Parameters
[in]session

The database update session ID

[in]attribute

The included-service attribute handle

Remove an included-service attribute from a service.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8803 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_uuid16_characteristic#

sl_status_t sl_bt_gattdb_add_uuid16_characteristic (uint16_t session, uint16_t service, uint16_t property, uint16_t security, uint8_t flag, sl_bt_uuid_16_t uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t * value, uint16_t * characteristic)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service which the characteristic is added to

[in]property

Characteristic value properties. Value: bitmask of GATT Characteristic Property Flags

[in]security

Security requirement. Value: 0 or bitmask of GATT Attribute Security Requirement Flags. A security requirement flag for a property is ignored if the property is not set for the characteristic value.

[in]flag

Option flags. Value: 0 or bitmask of GATT Database Flags.

[in]uuid

The 16-bits UUID in little endian format

[in]value_type

Enum sl_bt_gattdb_value_type_t. The value type. Values:

  • sl_bt_gattdb_fixed_length_value (0x1): A fixed-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_variable_length_value (0x2): A variable-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_user_managed_value (0x3): A value managed by the user application for responding the read and write requests of remote GATT clients.

[in]maxlen

The maximum length of the characteristic value. Ignored if value_type is sl_bt_gattdb_user_managed_value.

[in]value_len

Length of data in value

[in]value

The initial characteristic value. Length of this value must be less than or equal to maxlen. Ignored if value_type is sl_bt_gattdb_user_managed_value.

[out]characteristic

The characteristic value attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add a 16-bits UUID characteristic to a service. On success, the characteristic is appended to the characteristic list of the service and it inherits the started or stopped state of the service. In addition, it can be started and stopped separately with the sl_bt_gattdb_start_characteristic and sl_bt_gattdb_stop_characteristic commands.

If the flag parameter does not set SL_BT_GATTDB_NO_AUTO_CCCD, the stack will automatically add a Client Characteristic Configuration descriptor to this characteristic when it has the notify or indicate property. If SL_BT_GATTDB_NO_AUTO_CCCD is set, the user application should add the descriptor separately as needed.

A Characteristic Extended Properties descriptor is automatically added if the reliable write property is set.

Use the sl_bt_gattdb_add_uuid128_characteristic command to add a 128-bits UUID characteristic.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8862 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_uuid128_characteristic#

sl_status_t sl_bt_gattdb_add_uuid128_characteristic (uint16_t session, uint16_t service, uint16_t property, uint16_t security, uint8_t flag, uuid_128 uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t * value, uint16_t * characteristic)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service which the characteristic is added to

[in]property

Characteristic value properties. Value: bitmask of GATT Characteristic Property Flags

[in]security

Security requirement. Value: 0 or bitmask of GATT Attribute Security Requirement Flags. A security requirement flag for a property is ignored if the property is not set for the characteristic value.

[in]flag

Option flags. Value: 0 or bitmask of GATT Database Flags.

[in]uuid

The 128-bits UUID in little endian format

[in]value_type

Enum sl_bt_gattdb_value_type_t. The value type. Values:

  • sl_bt_gattdb_fixed_length_value (0x1): A fixed-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_variable_length_value (0x2): A variable-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_user_managed_value (0x3): A value managed by the user application for responding the read and write requests of remote GATT clients.

[in]maxlen

The maximum length of the characteristic value. Ignored if value_type is sl_bt_gattdb_user_managed_value.

[in]value_len

Length of data in value

[in]value

The initial characteristic value. Length of this value must be less than or equal to maxlen. Ignored if value_type is sl_bt_gattdb_user_managed_value.

[out]characteristic

The characteristic value attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add a 128-bits UUID characteristic to a service. When successful, the characteristic is appended to the characteristic list of the service and inherits the started or stopped state of the service. Additionally, it can be started and stopped separately with the sl_bt_gattdb_start_characteristic and sl_bt_gattdb_stop_characteristic commands.

If the flag parameter does not set SL_BT_GATTDB_NO_AUTO_CCCD, the stack will automatically add a Client Characteristic Configuration descriptor to this characteristic when it has the notify or indicate property. If SL_BT_GATTDB_NO_AUTO_CCCD is set, the user application should add the descriptor separately as needed.

A Characteristic Extended Properties descriptor is automatically added if the reliable write property is set.

Use the sl_bt_gattdb_add_uuid16_characteristic command to add a 16-bits UUID characteristic.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8930 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_remove_characteristic#

sl_status_t sl_bt_gattdb_remove_characteristic (uint16_t session, uint16_t characteristic)
Parameters
[in]session

The database update session ID

[in]characteristic

The characteristic value attribute handle of the characteristic

Remove a characteristic and its descriptors from a service.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 8953 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_uuid16_descriptor#

sl_status_t sl_bt_gattdb_add_uuid16_descriptor (uint16_t session, uint16_t characteristic, uint16_t property, uint16_t security, sl_bt_uuid_16_t uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t * value, uint16_t * descriptor)
Parameters
[in]session

The database update session ID

[in]characteristic

The characteristic value attribute handle of the characteristic the descriptor is added to

[in]property

The descriptor properties. Value: bitmask of GATT Descriptor Property Flags

[in]security

Security requirement. Value: 0 or bitmask of GATT Attribute Security Requirement Flags. A security requirement flag for a property is ignored if the property is not set for the descriptor.

[in]uuid

The 16-bits UUID in little endian format

[in]value_type

Enum sl_bt_gattdb_value_type_t. The value type. Ignored if this is a Client Characteristic Configuration descriptor. Values:

  • sl_bt_gattdb_fixed_length_value (0x1): A fixed-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_variable_length_value (0x2): A variable-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_user_managed_value (0x3): A value managed by the user application for responding the read and write requests of remote GATT clients.

[in]maxlen

The maximum length of the descriptor value. Ignored if value_type is sl_bt_gattdb_user_managed_value, or if this is a Client Characteristic Configuration descriptor.

[in]value_len

Length of data in value

[in]value

The initial descriptor value. Length of this value must be less than or equal to maxlen. Ingored if value type is sl_bt_gattdb_user_managed_value, or if this is a Client Characteristic Configuration descriptor.

[out]descriptor

The descriptor attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add a 16-bits UUID descriptor to a characteristic. When successful, the descriptor is appended to the descriptor list of the characteristic and inherits the started or stopped state of the characteristic.

This command does not support adding Characteristic Extended Properties descriptors. This descriptor is automatically added if the characteristic value has the reliable-write property or when a Characteristic User Description descriptor is added and the user description has the write property.

Use the sl_bt_gattdb_add_uuid128_descriptor command to add a 128-bits UUID descriptor.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9007 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_add_uuid128_descriptor#

sl_status_t sl_bt_gattdb_add_uuid128_descriptor (uint16_t session, uint16_t characteristic, uint16_t property, uint16_t security, uuid_128 uuid, uint8_t value_type, uint16_t maxlen, size_t value_len, const uint8_t * value, uint16_t * descriptor)
Parameters
[in]session

The database update session ID

[in]characteristic

The characteristic value attribute handle of the characteristic the descriptor is added to

[in]property

The descriptor properties. Value: bitmask of GATT Descriptor Property Flags

[in]security

Security requirement. Value: 0 or bitmask of GATT Attribute Security Requirement Flags. A security requirement flag for a property is ignored if the property is not set for the descriptor.

[in]uuid

The 128-bits UUID in little endian format

[in]value_type

Enum sl_bt_gattdb_value_type_t. The value type. Ignored if this is a Client Characteristic Configuration descriptor. Values:

  • sl_bt_gattdb_fixed_length_value (0x1): A fixed-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_variable_length_value (0x2): A variable-length value managed by the local GATT server for responding the read and write requests of remote GATT clients

  • sl_bt_gattdb_user_managed_value (0x3): A value managed by the user application for responding the read and write requests of remote GATT clients.

[in]maxlen

The maximum length of the descriptor value. Ignored if value_type is sl_bt_gattdb_user_managed_value, or if this is a Client Characteristic Configuration descriptor.

[in]value_len

Length of data in value

[in]value

The initial descriptor value. Length of this value must be less than or equal to maxlen. Ignored if value type is sl_bt_gattdb_user_managed_value, or if this is a Client Characteristic Configuration descriptor.

[out]descriptor

The descriptor attribute handle. This handle is ensured valid in current session. It may change after the session if attributes have been inserted or deleted in front of it.

Add a 128-bits UUID descriptor to a characteristic. When successful, the descriptor is appended to the descriptor list of the characteristic and inherits the started or stopped state of the characteristic.

This command does not support adding Characteristic Extended Properties descriptors. This descriptor is automatically added if the characteristic value has the reliable-write property or when a Characteristic User Description descriptor is added and the user description has the write property.

Use the sl_bt_gattdb_add_uuid16_descriptor command to add a 16-bits UUID descriptor.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9069 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_remove_descriptor#

sl_status_t sl_bt_gattdb_remove_descriptor (uint16_t session, uint16_t descriptor)
Parameters
[in]session

The database update session ID

[in]descriptor

The descriptor handle

Remove a descriptor from a characteristic.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9090 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_start_service#

sl_status_t sl_bt_gattdb_start_service (uint16_t session, uint16_t service)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service

Start a service, so that the service and its attributes including characteristics and descriptors become visible to remote GATT clients after this change has been committed.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9105 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_stop_service#

sl_status_t sl_bt_gattdb_stop_service (uint16_t session, uint16_t service)
Parameters
[in]session

The database update session ID

[in]service

The service declaration attribute handle of the service

Stop a service, so that the service and its attributes including characteristics and descriptors become invisible to remote GATT clients after this change has been committed.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9119 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_start_characteristic#

sl_status_t sl_bt_gattdb_start_characteristic (uint16_t session, uint16_t characteristic)
Parameters
[in]session

The database update session ID

[in]characteristic

The characteristic value attribute handle of the characteristic

Start a characteristic, so that the characteristic and its attributes become visible to remote GATT clients after this change has been committed. SL_STATUS_INVALID_STATE error is returned if the parent service is not started.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9135 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_stop_characteristic#

sl_status_t sl_bt_gattdb_stop_characteristic (uint16_t session, uint16_t characteristic)
Parameters
[in]session

The database update session ID

[in]characteristic

The characteristic value attribute handle of the characteristic

Stop a characteristic, so that the characteristic and its attributes become invisible to remote GATT clients after this change has been committed.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9150 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_commit#

sl_status_t sl_bt_gattdb_commit (uint16_t session)
Parameters
[in]session

The database update session ID

Save all changes performed in the current session and close the session. The stack will assign final handles to new and affected attributes and handle GATT caching as needed. The stack removes the client characteristic configurations of non-connected GATT clients except the service-changed configuration. For connected GATT clients during this database change, the stack removes the configurations to the removed characteristics. The session ID, temporary attribute handles returned during this session, and other existing attribute handles that are after newly added or removed attributes are invalidated.

Some attribute handles returned in this session may become invalid if attributes are not created in the order they present in the database. In this case, attribute handle cache of the database in the user application must be refreshed to avoid accidentally using an invalidated handle in subsequent operations.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9176 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_abort#

sl_status_t sl_bt_gattdb_abort (uint16_t session)
Parameters
[in]session

The database update session ID

Cancel all changes performed in the current session and close the session. The database remains in the same state it was in just before the session was started. The session ID and all temporary attribute handles returned during this session are invalidated.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9190 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_gattdb_get_attribute_state#

sl_status_t sl_bt_gattdb_get_attribute_state (uint16_t attribute, uint8_t * state)
Parameters
[in]attribute

Attribute handle

[out]state

State of the given attribute. Value: bitmask of GATT Attribute State Flags

Get the state of the given attribute.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 9203 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

Macro Definition Documentation#

sl_bt_cmd_gattdb_new_session_id#

#define sl_bt_cmd_gattdb_new_session_id
Value:
0x00460020

Definition at line 8463 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_service_id#

#define sl_bt_cmd_gattdb_add_service_id
Value:
0x01460020

Definition at line 8464 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_remove_service_id#

#define sl_bt_cmd_gattdb_remove_service_id
Value:
0x02460020

Definition at line 8465 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_included_service_id#

#define sl_bt_cmd_gattdb_add_included_service_id
Value:
0x03460020

Definition at line 8466 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_remove_included_service_id#

#define sl_bt_cmd_gattdb_remove_included_service_id
Value:
0x04460020

Definition at line 8467 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_uuid16_characteristic_id#

#define sl_bt_cmd_gattdb_add_uuid16_characteristic_id
Value:
0x05460020

Definition at line 8468 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_uuid128_characteristic_id#

#define sl_bt_cmd_gattdb_add_uuid128_characteristic_id
Value:
0x06460020

Definition at line 8469 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_remove_characteristic_id#

#define sl_bt_cmd_gattdb_remove_characteristic_id
Value:
0x07460020

Definition at line 8470 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_uuid16_descriptor_id#

#define sl_bt_cmd_gattdb_add_uuid16_descriptor_id
Value:
0x08460020

Definition at line 8471 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_add_uuid128_descriptor_id#

#define sl_bt_cmd_gattdb_add_uuid128_descriptor_id
Value:
0x09460020

Definition at line 8472 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_remove_descriptor_id#

#define sl_bt_cmd_gattdb_remove_descriptor_id
Value:
0x0a460020

Definition at line 8473 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_start_service_id#

#define sl_bt_cmd_gattdb_start_service_id
Value:
0x0b460020

Definition at line 8474 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_stop_service_id#

#define sl_bt_cmd_gattdb_stop_service_id
Value:
0x0c460020

Definition at line 8475 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_start_characteristic_id#

#define sl_bt_cmd_gattdb_start_characteristic_id
Value:
0x0d460020

Definition at line 8476 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_stop_characteristic_id#

#define sl_bt_cmd_gattdb_stop_characteristic_id
Value:
0x0e460020

Definition at line 8477 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_commit_id#

#define sl_bt_cmd_gattdb_commit_id
Value:
0x0f460020

Definition at line 8478 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_abort_id#

#define sl_bt_cmd_gattdb_abort_id
Value:
0x10460020

Definition at line 8479 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_cmd_gattdb_get_attribute_state_id#

#define sl_bt_cmd_gattdb_get_attribute_state_id
Value:
0x11460020

Definition at line 8480 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_new_session_id#

#define sl_bt_rsp_gattdb_new_session_id
Value:
0x00460020

Definition at line 8481 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_service_id#

#define sl_bt_rsp_gattdb_add_service_id
Value:
0x01460020

Definition at line 8482 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_remove_service_id#

#define sl_bt_rsp_gattdb_remove_service_id
Value:
0x02460020

Definition at line 8483 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_included_service_id#

#define sl_bt_rsp_gattdb_add_included_service_id
Value:
0x03460020

Definition at line 8484 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_remove_included_service_id#

#define sl_bt_rsp_gattdb_remove_included_service_id
Value:
0x04460020

Definition at line 8485 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_uuid16_characteristic_id#

#define sl_bt_rsp_gattdb_add_uuid16_characteristic_id
Value:
0x05460020

Definition at line 8486 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_uuid128_characteristic_id#

#define sl_bt_rsp_gattdb_add_uuid128_characteristic_id
Value:
0x06460020

Definition at line 8487 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_remove_characteristic_id#

#define sl_bt_rsp_gattdb_remove_characteristic_id
Value:
0x07460020

Definition at line 8488 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_uuid16_descriptor_id#

#define sl_bt_rsp_gattdb_add_uuid16_descriptor_id
Value:
0x08460020

Definition at line 8489 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_add_uuid128_descriptor_id#

#define sl_bt_rsp_gattdb_add_uuid128_descriptor_id
Value:
0x09460020

Definition at line 8490 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_remove_descriptor_id#

#define sl_bt_rsp_gattdb_remove_descriptor_id
Value:
0x0a460020

Definition at line 8491 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_start_service_id#

#define sl_bt_rsp_gattdb_start_service_id
Value:
0x0b460020

Definition at line 8492 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_stop_service_id#

#define sl_bt_rsp_gattdb_stop_service_id
Value:
0x0c460020

Definition at line 8493 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_start_characteristic_id#

#define sl_bt_rsp_gattdb_start_characteristic_id
Value:
0x0d460020

Definition at line 8494 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_stop_characteristic_id#

#define sl_bt_rsp_gattdb_stop_characteristic_id
Value:
0x0e460020

Definition at line 8495 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_commit_id#

#define sl_bt_rsp_gattdb_commit_id
Value:
0x0f460020

Definition at line 8496 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_abort_id#

#define sl_bt_rsp_gattdb_abort_id
Value:
0x10460020

Definition at line 8497 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h

sl_bt_rsp_gattdb_get_attribute_state_id#

#define sl_bt_rsp_gattdb_get_attribute_state_id
Value:
0x11460020

Definition at line 8498 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h