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 TPS parameter type T_TPS_PARAM_TYPE and it will set the TPS parameter. The 'p_value' field must point to an appropriate data type that meets the requirements for the corresponding parameter type. (For example, if required data length for parameter type is 1 octets, p_value should be cast to a pointer of uint8_t.)
Example usage
void test(void) { bool ret = tps_set_parameter(TPS_PARAM_TX_POWER, 1, &tx_power); }
- 参数:
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.
- 返回值:
true -- Operation success.
false -- Operation failure.
- 返回:
-
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); }
- 参数:
-
p_func -- [in] Callback when service attribute was read, write or CCCD update.
- 返回值:
0xFF -- Operation failure.
others -- Service ID assigned by Bluetooth Host.
- 返回:
-
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)