|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
结构体 | |
| struct | ext_wifi_any_peer_info |
| struct | ext_wifi_any_device |
| struct | ext_wifi_any_callback |
宏定义 | |
| #define | WIFI_ANY_MAX_USER_DATA 250 |
| #define | WIFI_ANY_KEY_LEN 16 |
| #define | WIFI_ANY_MAC_LEN 6 |
| #define | WIFI_ANY_MAX_SSID_LEN (32 + 1) |
类型定义 | |
| typedef void(* | hi_wifi_any_scan_result_cb) (ext_wifi_any_device *devices[], unsigned char num) |
| Callback function invoked when ANY scan is finished.CNcomment:ANY扫描完成回调函数CNend | |
| typedef void(* | uapi_wifi_any_recv_cb) (unsigned char *mac, unsigned char *data, unsigned short len, unsigned char seqnum) |
| Callback function for ANY RX.CNcomment:ANY驱动接收回调函数CNend | |
| typedef void(* | uapi_wifi_any_send_complete_cb) (unsigned char *mac, unsigned char status, unsigned char seqnum) |
| Callback function for ANY TX.CNcomment:ANY驱动发送回调函数CNend | |
函数 | |
| int | uapi_wifi_any_init (const char *ifname) |
| Use this funtion to initialize ANY feature.CNcomment:ANY功能初始化函数CNend | |
| int | uapi_wifi_any_deinit (void) |
| Use this funtion to de-initialize ANY feature.CNcomment:ANY功能去初始化函数CNend | |
| void | uapi_wifi_any_set_callback (uapi_wifi_any_send_complete_cb send_cb, uapi_wifi_any_recv_cb recv_cb) |
| Register callback functions for ANY TX and RX.CNcomment:注册ANY驱动发送回调函数和接收回调函数CNend | |
| int | uapi_wifi_any_send (const unsigned char *mac, unsigned char mac_len, unsigned char *data, unsigned short data_len, unsigned char seq) |
| Send ANY frame to specific mac address.CNcomment:向指定MAC地址的设备发送ANY数据。CNend | |
| int | uapi_wifi_any_add_peer (const ext_wifi_any_peer_info *peer_info) |
| Add information of ANY peer device.CNcomment:添加ANY对端设备信息。CNend | |
| int | uapi_wifi_any_del_peer (const unsigned char *mac, unsigned char len) |
| Delete specific peer device.CNcomment:删除指定MAC地址的对端设备信息。CNend | |
| int | uapi_wifi_any_fetch_peer (unsigned char index, ext_wifi_any_peer_info *peer) |
| Get ANY peer device's information by index.CNcomment:获取指定索引的对端设备信息。CNend | |
| int | uapi_wifi_any_discover_peer (hi_wifi_any_scan_result_cb p_fn_cb) |
| Start ANY scan and register callback to handle scan results. CNcomment:发起ANY扫描并注册回调函数处理扫描完成之后的结果。CNend | |
| #define WIFI_ANY_KEY_LEN 16 |
Length of key in octets used in ANY communication.CNcomment:ANY加密通信的密钥长度,固定为16字节。CNend
| #define WIFI_ANY_MAC_LEN 6 |
Length of MAC address.CNcomment:MAC地址长度定义CNend
| #define WIFI_ANY_MAX_SSID_LEN (32 + 1) |
Max length of wlan ssid(for driver).CNcomment:wifi驱动SSID最大长度,+1为\0预留空间CNend
| #define WIFI_ANY_MAX_USER_DATA 250 |
Max length of data for a single ANY transmit.CNcomment:单次ANY发送允许的最大数据长度。CNend
| typedef void(* hi_wifi_any_scan_result_cb) (ext_wifi_any_device *devices[], unsigned char num) |
Callback function invoked when ANY scan is finished.CNcomment:ANY扫描完成回调函数CNend
| devices | [IN] Type ext_wifi_any_device *, array of poniter of ANY devices found.CNcomment:发现的ANY设备信息, 该参数为指针类型的数组。CNend |
| num | [IN] Type #unsigned char, the number of ANY devices found, maximum is 32.CNcomment:发现的设备数量, 最大不超过32.CNend |
| #void | no return value.CNcomment:无返回值.CNend |
| typedef void(* uapi_wifi_any_recv_cb) (unsigned char *mac, unsigned char *data, unsigned short len, unsigned char seqnum) |
Callback function for ANY RX.CNcomment:ANY驱动接收回调函数CNend
| mac | [IN] Type #unsigned char *, MAC address with 6 octets length.CNcomment:6字节长度MAC地址.CNend |
| data | [IN] Type #unsigned char *, the address of data received.CNcomment:接收到数据的缓存地址.CNend |
| len | [IN] Type #unsigned short, the length in octet of data received.CNcomment:接收的数据长度, 最大为250字节.CNend |
| seqnum | [IN] Type #unsigned char, the sequence number of the ANY frame, range [0-255]. CNcomment:接收到的ANY帧的序列号,范围0-255.CNend |
| #void | no return value.CNcomment:无返回值.CNend |
| typedef void(* uapi_wifi_any_send_complete_cb) (unsigned char *mac, unsigned char status, unsigned char seqnum) |
Callback function for ANY TX.CNcomment:ANY驱动发送回调函数CNend
| mac | [IN] Type #unsigned char *, MAC address with 6 octets length.CNcomment:6字节长度MAC地址.CNend |
| status | [IN] Type #unsigned char, the result of a single transmit,return 1 if transmitted successfully. CNcomment:单次发送的结果, 值为1代表发送成功,其他值代表发送失败.CNend |
| seqnum | [IN] Type #unsigned char, the sequence number of the ANY frame, range [0-255]. CNcomment:接收到的ANY帧的序列号,范围0-255.CNend |
| #void | no return value.CNcomment:无返回值.CNend |
| int uapi_wifi_any_add_peer | ( | const ext_wifi_any_peer_info * | peer_info | ) |
Add information of ANY peer device.CNcomment:添加ANY对端设备信息。CNend
| peer_info | [IN] Type ext_wifi_any_peer_info *, information of peer device. CNcomment:对端设备的信息.CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_deinit | ( | void | ) |
Use this funtion to de-initialize ANY feature.CNcomment:ANY功能去初始化函数CNend
| NULL |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_del_peer | ( | const unsigned char * | mac, |
| unsigned char | len | ||
| ) |
Delete specific peer device.CNcomment:删除指定MAC地址的对端设备信息。CNend
| mac | [IN] Type #const unsigned char *, peer device's MAC address. CNcomment:待删除的对端设备的MAC地址.CNend |
| len | [IN] Type #unsigned char, length of MAC address which shall be constant 6. CNcomment:对端设备的MAC地址长度,固定填6字节.CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_discover_peer | ( | hi_wifi_any_scan_result_cb | p_fn_cb | ) |
Start ANY scan and register callback to handle scan results.
CNcomment:发起ANY扫描并注册回调函数处理扫描完成之后的结果。CNend
| p_fn_cb | [IN] Type hi_wifi_any_scan_result_cb, callback function to handle scan results. CNcomment:由用户实现的回调函数, 扫描完成之后驱动调用该回调处理扫描结果.CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_fetch_peer | ( | unsigned char | index, |
| ext_wifi_any_peer_info * | peer | ||
| ) |
Get ANY peer device's information by index.CNcomment:获取指定索引的对端设备信息。CNend
| index | [IN] Type #unsigned char, peer device's index, start from 0. CNcomment:待查询的对端设备的索引,从0开始.CNend |
| peer | [OUT] Type ext_wifi_any_peer_info *, peer device's information. CNcomment:查询到的对端设备的信息.CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_init | ( | const char * | ifname | ) |
Use this funtion to initialize ANY feature.CNcomment:ANY功能初始化函数CNend
| seqnum | [IN] Type #const char *, the interface name used to TX/RX ANY frames, eg.wlan0/ap0/mesh0. CNcomment:用于收发ANY报文的接口名称,常用值为"wlan0","ap0"或"mesh0".CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| int uapi_wifi_any_send | ( | const unsigned char * | mac, |
| unsigned char | mac_len, | ||
| unsigned char * | data, | ||
| unsigned short | data_len, | ||
| unsigned char | seq | ||
| ) |
Send ANY frame to specific mac address.CNcomment:向指定MAC地址的设备发送ANY数据。CNend
| mac | [IN] Type #const unsigned char *, destination MAC address, it may be unicast or broadcast. CNcomment:6字节长度目的MAC地址, 可为单播或者广播地址, 不支持组播地址.CNend |
| mac_len | [IN] Type #unsigned char, length of MAC address which shall be 6 in octet. CNcomment:MAC地址长度, 需为6字节.CNend |
| data | [IN] Type #unsigned char *, the address of data.CNcomment:待发送数据的缓存地址.CNend |
| len | [IN] Type #unsigned short, the length in octet of data, maximum is 250. CNcomment:待发送的数据长度, 最大为250字节.CNend |
| seqnum | [IN] Type #unsigned char, the sequence number of the ANY frame, range [0-255]. CNcomment:待发送的ANY帧的序列号,范围0-255.CNend |
| #EXT_OK | Excute successfully |
| #Other | Error code |
| void uapi_wifi_any_set_callback | ( | uapi_wifi_any_send_complete_cb | send_cb, |
| uapi_wifi_any_recv_cb | recv_cb | ||
| ) |
Register callback functions for ANY TX and RX.CNcomment:注册ANY驱动发送回调函数和接收回调函数CNend
| send_cb | [IN] Type uapi_wifi_any_send_complete_cb, callback function for ANY TX. CNcomment:ANY驱动发送回调函数.CNend |
| recv_cb | [IN] Type uapi_wifi_any_recv_cb, callback function for ANY RX. CNcomment:ANY驱动接收回调函数.CNend |
| #void | no return value.CNcomment:无返回值.CNend |