Here shows the definitions of the GAP service for application.
◆ GAP_DEVICE_NAME_LENGH
#define GAP_DEVICE_NAME_LENGH 30 |
Default length of GAP server device name.
◆ GAP_DEVICE_NAME_LENGH_MAX
#define GAP_DEVICE_NAME_LENGH_MAX 248 |
Maximum length of GAP server device name.
◆ getGAP_ClientDataRead()
BleStackStatus getGAP_ClientDataRead |
( |
uint8_t |
hostId, |
|
|
uint16_t |
hdlNum |
|
) |
| |
Get data from server by reading request (Client ONLY)
- Parameters
-
[in] | hostId | : the link's host id |
[in] | hdlNum | : handle number of the data you want to read. |
- Return values
-
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_DB_PARSING_IN_PROGRESS | : parsing database process has NOT finished. |
BLESTACK_STATUS_ERR_INVALID_HANDLE | : Invalid attribute handle. |
BLESTACK_STATUS_ERR_BUSY | : Message queue buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
◆ getGAP_ServiceHandles()
BleStackStatus getGAP_ServiceHandles |
( |
uint8_t |
hostId, |
|
|
BLEATT_GAP_Info * |
info |
|
) |
| |
Get GAP Service Handle Numbers
- Attention
- - role = BLE_GATT_ROLE_CLIENT:
MUST call this API to get service information after received BLECMD_EVENT_ATT_DATABASE_PARSING_FINISHED
- role = BLE_GATT_ROLE_SERVER:
MUST call this API to get service information before connection established.
- Parameters
-
[in] | hostId | : the link's host id. |
[out] | info | : a pointer to GAP information |
- Return values
-
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
◆ setGAP_Appearance()
void setGAP_Appearance |
( |
uint16_t |
appearance | ) |
|
Set GAP Appearance
- Parameters
-
◆ setGAP_DeviceName()
BleStackStatus setGAP_DeviceName |
( |
uint8_t * |
name, |
|
|
uint8_t |
length |
|
) |
| |
Set GAP Device Name
- Parameters
-
[in] | name | : a pointer to the device name. |
[in] | length | : the length of the device name. |
- Return values
-
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
◆ setGAP_PeripheralConnectionParam()
BleStackStatus setGAP_PeripheralConnectionParam |
( |
BLE_Conn_Param * |
connParam | ) |
|
Set GAP Peripheral Preferred Connection Parameters
- Parameters
-
[in] | connParam | : a pointer to the preferred peripheral connection parameters. |
- Return values
-
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_SUCCESS | : Setting success. |
◆ setGAP_ServiceInit()
GAP Service Initialization
- Attention
- There is only one instance of GAP shall be exposed on a device (if role is BLE_GATT_ROLE_SERVER).
Callback shall be ignored if role is BLE_GATT_ROLE_SERVER).
- Parameters
-
[in] | hostId | : the link's host id. |
[in] | gattRole | : BLE GATT role. |
[in] | info | : a pointer to GAP information. |
[in] | callback | : a pointer to a callback function that receive the service events. |
- Return values
-
BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id. |
BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter. |
BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Registered services buffer full. |
BLESTACK_STATUS_SUCCESS | : Setting success. |