SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
Description
The RegisterHTS command is responsible for registering a HTP Service. This command will return zero on successful execution and a negative value on all 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 an HTP Server
(-4) FUNCTION_ERROR
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1002) HTS_ERROR_INSUFFICIENT_RESOURCES
(-1003) HTS_ERROR_SERVICE_ALREADY_REGISTERED
API Call
HTS_Initialize_Service(BluetoothStackID, HTS_EventCallback, NULL, &HTSInstanceID);
API Prototype
int BTPSAPI HTS_Initialize_Service(unsigned int BluetoothStackID, HTS_Event_Callback_t EventCallback, unsigned long CallbackParameter, unsigned int *ServiceID)
Description of API
This function is responsible for opening a HTS 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 HTS 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
The UnRegisterHTS command is responsible for unregistering a HTP Service. This command 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.
Possible Return Values
(0) Successfully unregistered the HTP Server
(-4) FUNCTION_ERROR
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Cleanup_Service(BluetoothStackID, HTSInstanceID);
API Prototype
int BTPSAPI HTS_Cleanup_Service(unsigned int BluetoothStackID, unsigned int InstanceID)
Description of API
This function is responsible for closing a previously opened HTS 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 successfull call to HTS_Initialize_Service(). This function returns a zero if successful or a negative return error code if an error occurs.
Description
The DiscoverHTS command is responsible for performing a HTP Service Discovery Operation. This command 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 performed HTP Service Discovery Operation
(-4) FUNCTION_ERROR
API Call
GDIS_Service_Discovery_Start(BluetoothStackID, ConnectionID, (sizeof(UUID)/sizeof(GATT_UUID_t)), UUID, GDIS_Event_Callback, sdHTS);
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 GDIS_Service_Discover_Start is in an application module called GDIS that is provided to allow an easy way to perform GATT service discovery. This module can and should be modified for the customers use. This function is called to start a service discovery operation by the GDIS module.
Description
The ConfigureRemoteHTS command is responsible for configuring a HTP Service on a remote device. This command will return zero on successful execution and a negative value on errors.
Parameters
This function required three parameters. The first is Temperature Measurement Indicate, 0 = disable, 1 = enable. The second is Measurement Interval Indicate, 0 = disable, 1 = enable. The third is Intermediate Temperature Notify, 0 = disable, 1 = enable.
Command Call Examples
"ConfigureRemoteHTS 1 1 1" enables support for all three; Temperature Measurement Indicate, Measurement Interval Indicate, and Intermediate Temperature Notify.
Possible Return Values
(0) Successfully configured the HTP Service.
(-4) FUNCTION_ERROR
Description
The IndicateTemperature command is responsible for sending a temperature measurement indication to a connected remote device. This command returns zero on successful execution and a negative value on errors.
Parameters
This function requires five parameters. The first is exponent (1 byte). The second is Mantissa (3 bytes). The third is units, 0 = Celcius, 1 = Fahrenheit. The fourth is the time stamp in the form yyyymmddhhmmss which is the send time in year-month-day-hour-minute-second, 0 = don't send. The fifth is the temperature type, 0 = dot send, 1-9 = send type.
Command Call Examples
"IndicateTemperature 0 100 1 20120724095000 2" sets a temperature of 100 F with a timestamp of 7/24/2012 9:50AM.
Possible Return Values
(0) Successfully sent Temperature Indication
(-4) FUNCTION_ERROR
(-8) INVALID_STACK_ID_ERROR (-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1002) HTS_ERROR_INSUFFICIENT_RESOURCES
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Indicate_Temperature_Measurement(BluetoothStackID, HTSInstanceID, ConnectionID, &TemperatureMeasurement)
API Prototype
int BTPSAPI HTS_Indicate_Temperature_Measurement(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, HTS_Temperature_Measurement_Data_t *Temperature_Measurement)
Description of API
This function is responsible for sending a Temperature Measurement indication to a specified remote device. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to HTS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the indication to. The final parameter is the Temperature Measurement data to indicate. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The IndicateMeasurementInterval command is responsible for sending a measurement interval indication to a connected remote device. This command 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 sent the measurement interval indication.
(-4) FUNCTION_ERROR
(-8) INVALID_STACK_ID_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
(-1006) HTS_ERROR_INDICATION_OUTSTANDING
API Call
HTS_Indicate_Measurement_Interval(BluetoothStackID, HTSInstanceID, ConnectionID)
API Prototype
int BTPSAPI HTS_Indicate_Measurement_Interval(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID)
Description of API
This function is responsible for sending a Measurement Interval indication to a specified remote device. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to HTS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. This function returns a zero if successful or a negative return error code if an error occurs.
Description
the NotifyIntermediateTemperature command is responsible for sending an intermediate temperature notification to a connected remote device. This command will return zero on successful execution and a negative value on errors.
Parameters
This command requires five parameters. The first is the exponent (1 byte). The second is Mantissa (the temperature) (3 bytes). The third is units, 0 = Celcius, 1 = Fahrenheit. The fourth is the time stamp in the form yyyymmddhhmmss which is the send time in year-month-day-hour-minute-second, 0 = don't send. The fifth is the temperature type, 0 = don't send, 1-9 = send type.
Command Call Examples
"NotifyIntermediateTemperature 0 100 1 20120724095000 2" sends a temperature of 100 F with a timestamp of 7/24/2012 9:50AM.
Possible Return Values
(0) Successfully sent intermediate temperature notification
(-4) FUNCTION_ERROR
(-8) INVALID_STACK_ID_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE (-1000) HTS_ERROR_INVALID_PARAMETER
(-1002) HTS_ERROR_INSUFFICIENT_RESOURCES (-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Notify_Intermediate_Temperature(BluetoothStackID, HTSInstanceID, ConnectionID, &TemperatureMeasurement)
API Prototype
int BTPSAPI HTS_Notify_Intermediate_Temperature(unsigned int BluetoothStackID, unsigned int InstanceID, unsigned int ConnectionID, HTS_Temperature_Measurement_Data_t *Temperature_Measurement)
Description of API
This function is responsible for sending an Intermediate Temperature notification to a specified remote device. The first parameter is the Bluetooth Stack ID of the Bluetooth Device. The second parameter is the InstanceID returned from a successful call to HTS_Initialize_Server(). The third parameter is the ConnectionID of the remote device to send the notification to. The final parameter is the Intermediate Temperature data to notify. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The GetTemperatureType command is responsible for reading the temperature type. It can be executed by a Server or 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 command 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 queried the temperature type
(-4) FUNCTION_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Query_Temperature_Type(BluetoothStackID, HTSInstanceID, &tempType)
API Prototype
int BTPSAPI HTS_Query_Temperature_Type(unsigned int BluetoothStackID, unsigned int InstanceID, Byte_t *Temperature_Type)
Description of API
This function is responsible for querying the current Temperature Type on the specified HTS 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 HTS_Initialize_Server(). The final parameter is a pointer to return the current Temperature Type for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The SetTemperatureType command is responsible for writing the temperature type. It can be executed only by a Server. This command will return zero upon successful execution and a negative value on errors.
Parameters
This Command requires one parameter which is the temperature type (1-9).
HTS_TEMPERATURE_TYPE_ARMPIT 1
HTS_TEMPERATURE_TYPE_BODY 2
HTS_TEMPERATURE_TYPE_EAR 3
HTS_TEMPERATURE_TYPE_FINGER 4
HTS_TEMPERATURE_TYPE_GASTRO_INTESTINAL_TRACT 5
HTS_TEMPERATURE_TYPE_MOUTH 6
HTS_TEMPERATURE_TYPE_RECTUM 7
HTS_TEMPERATURE_TYPE_TOE 8
HTS_TEMPERATURE_TYPE_TYMPANUM 9
Command Call Examples
"SetTemperatureType 3" Sets the Temperature Type to EAR.
"SetTemperatureType 8" Sets the Temperature Type to TOE.
Possible Return Values
(0) Successfully set the Temperature Type.
(-4) FUNCTION_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Set_Temperature_Type(BluetoothStackID, HTSInstanceID, (Byte_t)TempParam->Params[0].intParam)
API Prototype
int BTPSAPI HTS_Set_Temperature_Type(unsigned int BluetoothStackID, unsigned int InstanceID, Byte_t Temperature_Type)
Description of API
This function is responsible for setting the Temperature Type on the specified HTS 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 HTS_Initialize_Server(). The final parameter is the Temperature Type to set for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs. The Temperature_Type parameter should be an enumerated value of the form HTS_TEMPERATURE_TYPE_XXX.
Description
The GetMeasurementInterval command is responsible for reading the measurement interval. It can be executed by a Server or 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 command 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 read the measurement interval
(-4) FUNCTION_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE (-1000) HTS_ERROR_INVALID_PARAMETER (-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Query_Measmureent_Interval(BluetoothStackID, HTSInstanceID, &Interval)
API Prototype
int BTPSAPI HTS_Query_Measurement_Interval(unsigned int BluetoothStackID, unsigned int InstanceID, Word_t *Measurement_Interval)
Description of API
This function is responsible for querying the current Measurement Interval on the specified HTS 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 HTS_Initialize_Server(). The final parameter is a pointer to return the current Measurement Interval for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The SetMeasurementInterval command is responsible for writing the measurement interval. 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 command will return zero on successful execution and a negative value on errors.
Parameters
This command requires one parameter which is the Measurement Interval.
Command Call Examples
"SetMeasurementInterval 2000" sets the Measurement Interval to 2000
Possible Return Values
(0) Successfully set the Measurement Interval
(-4) FUNCTION_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Set_Measurement_Interval(BluetoothStackID, HTSInstanceID, (Word_t)TempParam->Params[0].intParam)
API Prototype
int BTPSAPI HTS_Set_Measurement_Interval(unsigned int BluetoothStackID, unsigned int InstanceID, Word_t Measurement_Interval)
Description of API
This function is responsible for setting the Measurement Interval on the specified HTS 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 HTS_Initialize_Server(). The final parameter is the Measurement Interval to set for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The GetValidRange command is responsible for reading the valid range. It can be executed by a Server or as a Client with an open connection to a remote Server if Client write access to the measurement interval is supported. 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 command 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 read the range
(-4) FUNCTION_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Query_Valid_Range(BluetoothStackID, HTSInstanceID, &ValidRange)
API Prototype
int BTPSAPI HTS_Query_Valid_Range(unsigned int BluetoothStackID, unsigned int InstanceID, HTS_Valid_Range_Data_t *ValidRange)
Description of API
This function is responsible for querying the Valid Range descriptor value on the specified HTS 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 HTS_Initialize_Server(). The final parameter is a pointer to store the Valid Range structure for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs.
Description
The SetValidRange command is responsible for writing the valid range. It can be executed only by a Server. This command will return zero on successful execution and a negative value on errors.
Parameters
This command requires two parameters. The first is the lower bound of the range and the second is the upper bound.
Possible Return Values
(0) Successfully set the range
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-103) BTPS_ERROR_FEATURE_NOT_AVAILABLE
(-1000) HTS_ERROR_INVALID_PARAMETER
(-1004) HTS_ERROR_INVALID_INSTANCE_ID
API Call
HTS_Set_Valid_Range(BluetoothStackID, HTSInstanceID, &ValidRange)
API Prototype
int BTPSAPI HTS_Set_Valid_Range(unsigned int BluetoothStackID, unsigned int InstanceID, HTS_Valid_Range_Data_t *ValidRange)
Description of API
This function is responsible for setting the Valid Range descriptor value on the specified HTS 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 HTS_Initialize_Server(). The final parameter is the Valid Range to set for the specified HTS Instance. This function returns a zero if successful or a negative return error code if an error occurs.