|
ESP8266_RTOS_SDK
v1.4.0
|
AirKiss APIs. More...
Enumerations | |
| enum | airkiss_lan_ret_t { AIRKISS_LAN_ERR_OVERFLOW = -5, AIRKISS_LAN_ERR_CMD = -4, AIRKISS_LAN_ERR_PAKE = -3, AIRKISS_LAN_ERR_PARA = -2, AIRKISS_LAN_ERR_PKG = -1, AIRKISS_LAN_CONTINUE = 0, AIRKISS_LAN_SSDP_REQ = 1, AIRKISS_LAN_PAKE_READY = 2 } |
| enum | airkiss_lan_cmdid_t { AIRKISS_LAN_SSDP_REQ_CMD = 0x1, AIRKISS_LAN_SSDP_RESP_CMD = 0x1001, AIRKISS_LAN_SSDP_NOTIFY_CMD = 0x1002 } |
Functions | |
| const char * | airkiss_version (void) |
| Get the version information of AirKiss lib. More... | |
| int | airkiss_lan_recv (const void *body, unsigned short length, const airkiss_config_t *config) |
| Parse the UDP packet sent by AirKiss. More... | |
| int | airkiss_lan_pack (airkiss_lan_cmdid_t ak_lan_cmdid, void *appid, void *deviceid, void *_datain, unsigned short inlength, void *_dataout, unsigned short *outlength, const airkiss_config_t *config) |
| Packaging the UDP packet. More... | |
AirKiss APIs.
API airkiss_lan_recv and airkiss_lan_pack are provided for the function that AirKiss can detect the ESP8266 devices in LAN, more details about AirKiss please refer to WeChat : http://iot.weixin.qq.com.
Workflow : Create a UDP transmission. When UDP data is received, call API airkiss_lan_recv and input the UDP data, if the airkiss_lan_recv returns AIRKISS_LAN_SSDP_REQ, airkiss_lan_pack can be called to make a response packet.
| enum airkiss_lan_ret_t |
| int airkiss_lan_pack | ( | airkiss_lan_cmdid_t | ak_lan_cmdid, |
| void * | appid, | ||
| void * | deviceid, | ||
| void * | _datain, | ||
| unsigned short | inlength, | ||
| void * | _dataout, | ||
| unsigned short * | outlength, | ||
| const airkiss_config_t * | config | ||
| ) |
Packaging the UDP packet.
| airkiss_lan_cmdid_t | ak_lan_cmdid : type of the packet. |
| void* | appid : Vendor's Wechat public number id, got from WeChat. |
| void* | deviceid : device model id, got from WeChat. |
| void* | _datain : user data waiting for packet assembly. |
| unsigned | short inlength : the lenth of user data. |
| void* | _dataout : data buffer addr, to store the packet got by _datain packet assembly. |
| unsigned | short* outlength : the size of data buffer. |
| const | airkiss_config_t* config : input struct airkiss_config_t |
| int airkiss_lan_recv | ( | const void * | body, |
| unsigned short | length, | ||
| const airkiss_config_t * | config | ||
| ) |
Parse the UDP packet sent by AirKiss.
| const | void* body : the start of the UDP message body data pointer. |
| unsigned | short length : the effective length of data. |
| const | airkiss_config_t* config : input struct airkiss_config_t |
| const char* airkiss_version | ( | void | ) |
Get the version information of AirKiss lib.
| null. |
1.8.10