SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
Description
This function is responsible for registering a LLS Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)LLS_ERROR_INVALID_PARAMETER
(-1002)LLS_ERROR_INSUFFICIENT_RESOURCES
(-1003)LLS_ERROR_SERVICE_ALREADY_REGISTERED
API Call
LLS_Initialize_Service(BluetoothStackID, PASS_EventCallback, NULL, &PASSInstanceID)
API Prototype
int BTPSAPI LLS_Initialize_Service(unsigned int BluetoothStackID, LLS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)
Description of API
The following function is responsible for opening a LLS Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the Callback function to call when an event occurs on this Server Port. The third parameter is a user-defined callback parameter that will be passed to the callback function with each event. The final parameter is a pointer to store the GATT Service ID of the registered LLS service. This can be used to include the service registered by this call. This function returns the positive, non-zero, Instance ID or a negative error code.
Description
This function is responsible for unregistering the Link Loss Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)LLS_ERROR_INVALID_PARAMETER
(-1004)LLS_ERROR_INVALID_INSTANCE_ID
API Call
LLS_Cleanup_Service(BluetoothStackID, LLSInstanceID)
API Prototype
int BTPSAPI LLS_Cleanup_Service(unsigned int BluetoothStackID, unsigned int InstanceID)
Description of API
The following function is responsible for closing a previously LLS Server. The first parameter is the Bluetooth Stack ID on which to close the Server. The second parameter is the InstanceID that was returned from a successful call to LLS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.
Description
This function is responsible for performing a LLS Service Discovery Operation. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) GDIS_Service_Discovery_Start success
(-4) Function_Error
(-1000)GDIS_ERROR_INVALID_PARAMETER
(-1001)GDIS_ERROR_NOT_INITIALIZED
(-1002)GDIS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003)GDIS_ERROR_INSUFFICIENT_RESOURCES
(-1009)GDIS_ERROR_SERVICE_DISCOVERY_OUTSTANDING
API Call
GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdLLS)
API Prototype
int BTPSAPI GDIS_Service_Discovery_Start(unsigned int BluetoothStackID, unsigned int ConnectionID, unsigned int NumberOfUUID, GATT_UUID_t *UUIDList, GDIS_Event_Callback_t ServiceDiscoveryCallback, unsigned long ServiceDiscoveryCallbackParameter)
Description of API
The following function is used to initiate the Service Discovery process or queue additional requests. The function takes as its first parameter the BluetoothStackID that is associated with the Bluetooth Device. The second parameter is the connection ID of the remote device that is to be searched. The third and fourth parameters specify an optional list of UUIDs to search for. The final two parameters define the Callback function and parameter to use when the service discovery is complete. The function returns zero on success and a negative return value if there was an error.
Description
The following function is responsible for reading the Alert Level. It can be executed by a Server or as a Client with an open connection to a remote Server. If executed as a Client, a GATT read request will be generated, and the results will be returned as a response in the GATT Client event callback. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Get Alert Level Request sent
(-4) FUNCTION_ERROR
(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID (-1004) LLS_ERROR_INVALID_INSTANCE_ID
API Call
GATT_Read_Value_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)
API Prototype
int BTPSAPI GATT_Read_Value_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, GATT_Client_Event_Callback_t ClientEventCallback, unsigned long CallbackParameter)
Description of API
The following function is provided to allow a means of performing a read request on a remote device for a specific attribute value. The first parameter is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the attribute handle to read the value from. The final two parameters specify the GATT Client event callback function and callback parameter (respectively) that will be called when a response is received from the remote device. This function will return the positive, non-zero, Transaction ID of the request or a negative error code.
Description
The following function is responsible for writing the Alert Level. It can be executed by a Server or as a Client with an open connection to a remote Server if Client write access is supported. If executed as a Client, a GATT write request will be generated and the results will be returned as a response in the GATT Client event callback. This function will return zero on successful execution and a negative value on errors.
Parameters
SetAlertLevel has only one parameter which is an integer value that represents a Alert Level. This value is 0 = No Alert, 1 = Mild Alert, 2 = High Alert
Possible Return Values
(0) Ringer Setting successfully set
(-4) FUNCTION_ERROR
(-1000)LLS_ERROR_INVALID_PARAMETER
(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1004)LLS_ERROR_INVALID_INSTANCE_ID
API Call
GATT_Write_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, sizeof(NonAlignedByte_t), (void *)&Data, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)
API Prototype
int BTPSAPI GATT_Write_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue, GATT_Client_Event_Callback_t ClientEventCallback, unsigned long CallbackParameter)
Description of API
The following function is provided to allow a means of performing a write request to a remote device for a specified attribute. The first parameter to this function is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the handle of the attribute to write the value of, followed by the length of the value (in bytes), followed by the the actual value data to write. The final two parameters specify the GATT Client event callback function and callback parameter (respectively) that will be called when a response is received from the remote device. This function will return the positive, non-zero, Transaction ID of the request or a negative error code.
Description
This function is responsible for registering the Immediate Alert Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)IAS_ERROR_INVALID_PARAMETER
(-1002)IAS_ERROR_INSUFFICIENT_RESOURCES
(-1003)IAS_ERROR_SERVICE_ALREADY_REGISTERED
API Call
IAS_Initialize_Service(BluetoothStackID,IAS_EventCallback,0,&IASInstanceID)
API Prototype
int BTPSAPI IAS_Initialize_Service(unsigned int BluetoothStackID, IAS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)
Description of API
The following function is responsible for opening a IAS Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the Callback function to call when an event occurs on this Server Port. The third parameter is a user-defined callback parameter that will be passed to the callback function with each event. The final parameter is a pointer to store the GATT Service ID of the registered IAS service. This can be used to include the service registered by this call. This function returns the positive, non-zero, Instance ID or a negative error code.
Description
This function is responsible for unregistering the Immediate Alert Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)IAS_ERROR_INVALID_PARAMETER
(-1004)IAS_ERROR_INVALID_INSTANCE_ID
API Call
IAS_Cleanup_Service(BluetoothStackID, IASInstanceID)
API Prototype
int BTPSAPI IAS_Cleanup_Service(unsigned int BluetoothStackID, unsigned int InstanceID)
Description of API
The following function is responsible for closing a previously IAS Server. The first parameter is the Bluetooth Stack ID on which to close the Server. The second parameter is the InstanceID that was returned from a successful call to IAS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.
Description
This function is responsible for performing an IAS Service Discovery Operation. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) GDIS_Service_Discovery_Start success
(-4) Function_Error
(-1000)GDIS_ERROR_INVALID_PARAMETER
(-1001)GDIS_ERROR_NOT_INITIALIZED
(-1002)GDIS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003)GDIS_ERROR_INSUFFICIENT_RESOURCES
(-1009)GDIS_ERROR_SERVICE_DISCOVERY_OUTSTANDING
API Call
GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdIAS)
API Prototype
int BTPSAPI GDIS_Service_Discovery_Start(unsigned int BluetoothStackID, unsigned int ConnectionID, unsigned int NumberOfUUID, GATT_UUID_t *UUIDList, GDIS_Event_Callback_t ServiceDiscoveryCallback, unsigned long ServiceDiscoveryCallbackParameter)
Description of API
The following function is used to initiate the Service Discovery process or queue additional requests. The function takes as its first parameter the BluetoothStackID that is associated with the Bluetooth Device. The second parameter is the connection ID of the remote device that is to be searched. The third and fourth parameters specify an optional list of UUIDs to search for. The final two parameters define the Callback function and parameter to use when the service discovery is complete. The function returns zero on success and a negative return value if there was an error.
Description
This function is responsible for performing an IAS Service Discovery Operation. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) GDIS_Service_Discovery_Start success
(-4) Function_Error
(-1000)GDIS_ERROR_INVALID_PARAMETER
(-1001)GDIS_ERROR_NOT_INITIALIZED
(-1002)GDIS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003)GDIS_ERROR_INSUFFICIENT_RESOURCES
(-1009)GDIS_ERROR_SERVICE_DISCOVERY_OUTSTANDING
API Call
GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdIAS)
API Prototype
int BTPSAPI GDIS_Service_Discovery_Start(unsigned int BluetoothStackID, unsigned int ConnectionID, unsigned int NumberOfUUID, GATT_UUID_t *UUIDList, GDIS_Event_Callback_t ServiceDiscoveryCallback, unsigned long ServiceDiscoveryCallbackParameter)
Description of API
The following function is used to initiate the Service Discovery process or queue additional requests. The function takes as its first parameter the BluetoothStackID that is associated with the Bluetooth Device. The second parameter is the connection ID of the remote device that is to be searched. The third and fourth parameters specify an optional list of UUIDs to search for. The final two parameters define the Callback function and parameter to use when the service discovery is complete. The function returns zero on success and a negative return value if there was an error.
Description
This function is responsible for registering a TPS Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)TPS_ERROR_INVALID_PARAMETER
(-1002)TPS_ERROR_INSUFFICIENT_RESOURCES
(-1003)TPS_ERROR_SERVICE_ALREADY_REGISTERED
API Call
TPS_Initialize_Service(BluetoothStackID, &TPSInstanceID)
API Prototype
int BTPSAPI TPS_Initialize_Service(unsigned int BluetoothStackID, unsigned int *ServiceID)
Description of API
The following function is responsible for opening a TPS Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the Callback function to call when an event occurs on this Server Port. The third parameter is a user-defined callback parameter that will be passed to the callback function with each event. The final parameter is a pointer to store the GATT Service ID of the registered TPS service. This can be used to include the service registered by this call. This function returns the positive, non-zero, Instance ID or a negative error code.
Description
This function is responsible for unregistering a TPS Service. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Successfully registered PASP Service
(-4) FUNCTION_ERROR
(-1000)LLS_ERROR_INVALID_PARAMETER
(-1004)LLS_ERROR_INVALID_INSTANCE_ID
API Call
TPS_Cleanup_Service(BluetoothStackID, TPSInstanceID)
API Prototype
int BTPSAPI TPS_Cleanup_Service(unsigned int BluetoothStackID, unsigned int InstanceID)
Description of API
The following function is responsible for closing a previously TPS Server. The first parameter is the Bluetooth Stack ID on which to close the Server. The second parameter is the InstanceID that was returned from a successful call to TPS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.
Description
This function is responsible for performing a TPS Service Discovery Operation. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) GDIS_Service_Discovery_Start success
(-4) Function_Error
(-1000)GDIS_ERROR_INVALID_PARAMETER
(-1001)GDIS_ERROR_NOT_INITIALIZED
(-1002)GDIS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003)GDIS_ERROR_INSUFFICIENT_RESOURCES
(-1009)GDIS_ERROR_SERVICE_DISCOVERY_OUTSTANDING
API Call
GATT_Start_Service_Discovery(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GATT_Service_Discovery_Event_Callback, sdTPS)
API Prototype
int BTPSAPI GDIS_Service_Discovery_Start(unsigned int BluetoothStackID, unsigned int ConnectionID, unsigned int NumberOfUUID, GATT_UUID_t *UUIDList, GDIS_Event_Callback_t ServiceDiscoveryCallback, unsigned long ServiceDiscoveryCallbackParameter)
Description of API
The following function is used to initiate the Service Discovery process or queue additional requests. The function takes as its first parameter the BluetoothStackID that is associated with the Bluetooth Device. The second parameter is the connection ID of the remote device that is to be searched. The third and fourth parameters specify an optional list of UUIDs to search for. The final two parameters define the Callback function and parameter to use when the service discovery is complete. The function returns zero on success and a negative return value if there was an error.
Description
The following function is responsible for writing the Tx Power Level. It can be executed only by a Server. This function will return zero on successful execution and a negative value on errors.
Parameters
SetAlertLevel has only one parameter which is an integer value that represents a Tx Power Level.
Possible Return Values
(0) Ringer Setting successfully set
(-4) FUNCTION_ERROR
(-1000)TPS_ERROR_INVALID_PARAMETER
(-1001) TPS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1004)TPS_ERROR_INVALID_INSTANCE_ID
API Call
TPS_Set_Tx_Power_Level(BluetoothStackID, TPSInstanceID, (SByte_t)TempParam->Params[0].intParam)
API Prototype
int BTPSAPI TPS_Set_Tx_Power_Level(unsigned int BluetoothStackID, unsigned int InstanceID, SByte_t Tx_Power_Level)
Description of API
The following function is responsible for setting the Tx Power Level on the specified TPS Instance. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to TPS_Initialize_Server(). The final parameter is the Tx Power Level to set for the specified TPS Instance. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The following command is responsible for reading the Tx Power Level. It can be executed by a Server or as a Client with an open connection to a remote Server. If executed as a Client, a GATT read request will be generated, and the results will be returned as a response in the GATT Client event callback. This function will return zero on successful execution and a negative value on errors.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the command.
Possible Return Values
(0) Get Alert Level Request sent
(-4) FUNCTION_ERROR
(-1001) LLS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1004) LLS_ERROR_INVALID_INSTANCE_ID
API Call
GATT_Read_Value_Request(BluetoothStackID, ConnectionID, DeviceInfo->LLS_ClientInfo.Alert_Level, GATT_ClientEventCallback_LLS, DeviceInfo->LLS_ClientInfo.Alert_Level)
API Prototype
int BTPSAPI GATT_Read_Value_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, GATT_Client_Event_Callback_t ClientEventCallback, unsigned long CallbackParameter)
Description of API
The following function is provided to allow a means of performing a read request on a remote device for a specific attribute value. The first parameter is the Bluetooth stack ID of the local Bluetooth stack, followed by the connection ID of the connected remote device, followed by the attribute handle to read the value from. The final two parameters specify the GATT Client event callback function and callback parameter (respectively) that will be called when a response is received from the remote device. This function will return the positive, non-zero, Transaction ID of the request or a negative error code.