TPS Exported Functions
- group TPS_Exported_Functions
Functions
-
bool tps_set_parameter(T_TPS_PARAM_TYPE param_type, uint8_t len, void *p_value)
Set a Tx power service parameter.
This function can be called with a tx power service parameter type and it will set the tx power service parameter. Tx power service parameters are defined in T_TPS_PARAM_TYPE. If the “len” field is set to the size of a “uint16_t”, the “p_value” field must point to data with the type of “uint16_t”.
Example usage
void test(void) { bool ret = tps_set_parameter(TPS_PARAM_TX_POWER, 1, &tx_power); }
- Parameters:
param_type – [in] Tx power service parameter type: T_TPS_PARAM_TYPE.
len – [in] Length of data to write.
p_value – [in] Pointer to data to write. This is dependent on the parameter type and will be cast to the appropriate data type (example: data type of uint16 will be cast to uint16 pointer).
- Return values:
true – Operation success.
false – Operation failure.
- Returns:
Operation result.
-
T_SERVER_ID tps_add_service(void *p_func)
Add tx power service to the Bluetooth Host.
Example usage
void profile_init() { server_init(service_num); tps_id = tps_add_service(app_handle_profile_message); }
- Parameters:
p_func – [in] Callback when service attribute was read, write or CCCD update.
- Return values:
0xFF – Operation failure.
others – Service ID assigned by Bluetooth Host.
- Returns:
Service ID generated by the Bluetooth Host: T_SERVER_ID.
-
bool tps_set_parameter(T_TPS_PARAM_TYPE param_type, uint8_t len, void *p_value)