WHC CUST_PATH
WHC CUST_PATH Introduction
Core Capabilities
Provides a custom data transmission channel between Host and Device, supporting bidirectional arbitrary data transfer
Typical Use Cases
Function Extension: Enables development of private protocols beyond standard Wi-Fi/BT/Socket
Slim Host Mode Adaptation: Replaces standard Wi-Fi APIs in resource-constrained environments for lightweight control.
Technical Advantages
Flexibility:Protocol-agnostic, allowing custom data structures and interaction logic
Low Coupling: Isolated from standard interfaces (e.g., Wi-Fi/BT) to prevent functional conflicts
WHC CUST_PATH API
WHC Wi-Fi Header Files
whc_host_linux/common/whc_host_cmd_path_api.h
whc_host_linux/app/whc_host_app_api.h
component/wifi/whc/whc_host_rtos/whc_host_app.h
component/wifi/whc/whc_dev/whc_dev_api.h
WHC CUST_PATH API Reference
int whc_host_buf_rx_to_user(u8 *buf, u16 size);
Item |
Description |
---|---|
Function Function |
Processes device-to-host packet transmission, default forwards to user space |
Parameters |
buf: Packet buffer pointer, size: Valid packet length (bytes) |
Return |
0 indicates success, non-zero for error codes |
Note
This is a weak symbol interface in RTK SDK, recommended to override per use case.
void whc_host_send_data_to_dev(u8 *pbuf, u32 len, u32 with_txdesc);
Item |
Description |
---|---|
Function |
Kernel-space to device packet transmission interface |
Parameters |
pbuf: Tx buffer, len: Valid data length with_txdesc: 1 indicates buffer contains TX descriptor header |
Return |
void |
int whc_host_api_send_nl_data(uint8_t *buf, uint32_t buf_len);
Item |
Description |
---|---|
Function |
User-space to device Netlink data transmission interface |
Parameters |
buf: Structured data buffer, buf_len: Data length |
Return |
0 indicates success, non-zero for error codes |
void whc_host_pkt_rx_to_user(u8 *payload, u32 len);
Item |
Description |
---|---|
Function |
Device-to-host application packet distribution interface |
Parameters |
payload: Data payload pointer, len: Data length |
Return |
void |
Note
This is a weak symbol interface in RTK SDK, recommended to override per use case.
void whc_host_send_to_dev(u8 *buf, u32 len);
Item |
Description |
---|---|
Function |
Application-layer to device data transmission interface |
Parameters |
buf: Transmission buffer, len: Data length |
Return |
void |
void whc_dev_api_send_to_host(u8 *buf, u32 len);
Item |
Description |
---|---|
Function |
Device-to-host packet transmission interface |
Parameters |
buf: Data buffer pointer, len: Valid data length |
Return |
void |
void whc_dev_pkt_rx_to_user(u8 *rxbuf, u8 *real_buf, u16 size);
Item |
Description |
---|---|
Function |
Processes received user packets from device and delivers to device-side application |
Parameters |
rxbuf: Pointer to received data payload real_buf: Memory address for final packet deallocation size: Packet length (in bytes) |
Return |
void |
Note
This is a weak symbol interface in RTK SDK, recommended to override per use case.
Note
Fat Host: Standard APIs are used for Wi-Fi/BT/Socket communication, while CUST_PATH APIs handle custom Host-Device data transfer.
Slim Host: Standard APIs for BT/Socket, but Wi-Fi control and custom data must use CUST_PATH APIs (standard Wi-Fi APIs unavailable).