SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
Description
This function is responsible for registering a IAS 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 a IAS 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 a 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
The following function is responsible for writing the Alert Level Control Point to connected remote device. It can be executed only by a Client. This function will return zero on successful execution and a negative value on errors.
Parameters
SetRingerSetting has only one parameter which is an integer value that represents the Alert Level. This value is 0 = cpNoAlert, 1 = cpMildAlert, 2 = cpHighAlert.
Possible Return Values
(0) Ringer Setting successfully set
(-4) FUNCTION_ERROR
(-1000)IAS_ERROR_INVALID_PARAMETER
(-1003)IAS_ERROR_SERVICE_ALREADY_REGISTERED
(-1004)IAS_ERROR_INVALID_INSTANCE_ID
(-1005)IAS_ERROR_MALFORMATTED_DATA
API Call
GATT_Write_Without_Response_Request(BluetoothStackID, ConnectionID, DeviceInfo->IAS_ClientInfo.Control_Point, IAS_ALERT_LEVEL_CONTROL_POINT_VALUE_LENGTH, ((void *)Buffer))
API Prototype
int BTPSAPI GATT_Write_Without_Response_Request(unsigned int BluetoothStackID, unsigned int ConnectionID, Word_t AttributeHandle, Word_t AttributeLength, void *AttributeValue)
Description of API
The following function is provided to allow a means of performing a write without response request to 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, followed by the length of the value data to write (in bytes), followed by the actual value to write. This function will return the number of bytes written on success or a negative error code.