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.
- Parameters:
-
appCB – [in] The callback function.
- Return values:
-
client_id – The unique identifier for the proxy client instance.
- Returns:
-
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.
- Parameters:
conn_id – [in] The connection ID.
type – [in] The handle type.
value – [in] The handle value to set.
- Return values:
true – if the handle was set successfully.
false – if the handle could not be set, due to invalid type or connection ID.
- Returns:
-
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.
- Parameters:
conn_id – [in] The connection ID.
handle_type – [in] The handle type to retrieve.
- Return values:
-
handle_value – The value of the handle if found.
- Returns:
-
The handle value.
-
bool proxy_client_start_discovery(uint8_t conn_id)
-
Start the service discovery.
Contains the service, characteristic, cccd declaration.
- Parameters:
-
conn_id – [in] The connection ID.
- Return values:
true – if discovery was initiated successfully.
false – if discovery could not be started, possibly due to connection issues.
- Returns:
-
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.
- Parameters:
conn_id – [in] The connection ID.
readCharType – [in] The type of data to read.
- Return values:
true – if the read request was sent successfully.
false – if the read request could not be sent, possibly due to invalid handle type.
- Returns:
-
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.
- Parameters:
conn_id – [in] The connection ID.
readCharType – [in] The type of read operation to perform, relating to the UUID.
- Return values:
true – if the read request was sent successfully.
false – if the read request could not be sent, potentially due to issues with UUID presence.
- Returns:
-
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.
- Parameters:
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).
- Return values:
true – if the CCCD write was successful.
false – if the CCCD could not be written, possibly due to connection or characteristic issues.
- Returns:
-
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.
- Parameters:
conn_id – [in] The connection ID.
pdata – [in] Pointer to the data to write.
length – [in] The length of data being written.
- Return values:
true – if the data was written successfully.
false – if the data could not be written, possibly due to data length or connection issues.
- Returns:
-
The operation result.
-
T_CLIENT_ID proxy_client_add(P_FUN_GENERAL_APP_CB appCB)