Exported Functions
- group Proxy_Client_Exported_Functions
Functions
-
T_CLIENT_ID proxy_client_add(P_FUN_GENERAL_APP_CB appCB)
Register the client.
Registers the proxy client with callback function for event handling.
- 参数:
appCB – [in] The callback function.
- 返回值:
client_id – The unique identifier for the proxy client instance.
- 返回:
The client id.
-
void proxy_client_deinit(void)
Deinitialize the client.
Cleans up resources associated with the proxy client.
-
bool proxy_client_handle_set(uint8_t conn_id, proxy_handle_type_t type, uint16_t value)
Set the handle of the client.
Associate a handle value with its type for a given connection ID.
- 参数:
conn_id – [in] The connection ID.
type – [in] The handle type.
value – [in] The handle value to set.
- 返回值:
true – if the handle was set successfully.
false – if the handle could not be set, due to invalid type or connection ID.
- 返回:
The operation result.
-
uint16_t proxy_client_handle_get(uint8_t conn_id, proxy_handle_type_t handle_type)
Get the handle value of the client.
Retrieve the value of a handle based on its type for a given connection ID.
- 参数:
conn_id – [in] The connection ID.
handle_type – [in] The handle type to retrieve.
- 返回值:
handle_value – The value of the handle if found.
- 返回:
The handle value.
-
bool proxy_client_start_discovery(uint8_t conn_id)
Start the service discovery.
Contains the service, characteristic, cccd declaration.
- 参数:
conn_id – [in] The connection ID.
- 返回值:
true – if discovery was initiated successfully.
false – if discovery could not be started, possibly due to connection issues.
- 返回:
The operation result.
-
bool proxy_client_read_by_handle(uint8_t conn_id, proxy_read_type_t readCharType)
Read the server by handle.
Sends a read request to obtain data based on a specified handle type.
- 参数:
conn_id – [in] The connection ID.
readCharType – [in] The type of data to read.
- 返回值:
true – if the read request was sent successfully.
false – if the read request could not be sent, possibly due to invalid handle type.
- 返回:
The operation result.
-
bool proxy_client_read_by_uuid(uint8_t conn_id, proxy_read_type_t readCharType)
Read the server by UUID.
Sends a read request to retrieve data based on a specific UUID.
- 参数:
conn_id – [in] The connection ID.
readCharType – [in] The type of read operation to perform, relating to the UUID.
- 返回值:
true – if the read request was sent successfully.
false – if the read request could not be sent, potentially due to issues with UUID presence.
- 返回:
The operation result.
-
bool proxy_client_data_out_cccd_set(uint8_t conn_id, bool command)
Write the CCCD of the characteristic.
Modifies the CCCD of a characteristic to control whether the client receives notifications.
- 参数:
conn_id – [in] The connection ID.
command – [in] The CCCD value indicating whether to Enable (true - notifications are enabled) or Disable (false - notifications are disabled).
- 返回值:
true – if the CCCD write was successful.
false – if the CCCD could not be written, possibly due to connection or characteristic issues.
- 返回:
The operation result.
-
bool proxy_client_data_in_write(uint8_t conn_id, uint8_t *pdata, uint16_t length)
Write to a characteristic’s data input.
Sends data to the server by writing to a specified characteristic.
- 参数:
conn_id – [in] The connection ID.
pdata – [in] Pointer to the data to write.
length – [in] The length of data being written.
- 返回值:
true – if the data was written successfully.
false – if the data could not be written, possibly due to data length or connection issues.
- 返回:
The operation result.
-
T_CLIENT_ID proxy_client_add(P_FUN_GENERAL_APP_CB appCB)