#ifndef _EC800M_H #define _EC800M_H #include "gd32f10x.h" #define AT(cmd) "AT+"##cmd #define RSP_READY "RDY" #define RSP_OK "OK" #define RSP_CONNECT "CONNECT" #define CLIENTID "device_test" #define CMD_SET_PDP "AT+QICSGP=1,1,\"CTNET\",\"\",\"\",1\r\n" // UNINET?? CMNET?? CTNET?? #define CMD_SET_ACTIVE "AT+QIACT=1\r\n" #define CMD_SET_URL "AT+QHTTPURL=%d\r\n" #define CMD_GET "AT+QHTTPGET=100\r\n" #define CMD_GET_TO_FILE "AT+QHTTPREADFILE=\"UFS:http.txt\",80\r\n" #define CMD_HTTP_GET "QHTTPGET:" #define CMD_READ_FILE "AT+QFDWL=http.txt\r\n" #define CMD_READ_OTA_MSG_FILE "AT+QFDWL=otaMSG.txt\r\n" #define CMD_READ_OTA_DATA_FILE "AT+QFDWL=otaDATA.txt\r\n" #define CMD_DEL_OTA_MSG_FILE "AT+QFDEL=otaMSG.txt\r\n" #define CMD_DEL_OTA_DATA_FILE "AT+QFDEL=otaDATA.txt\r\n" #define ATI "ATI" #define CMD_MQTT_DISCONNECT "AT+QMTDISC=0\r\n" // ??MQTT??3.1.1 ??????--4(mqtt 3.1.1 )3(mqtt 3.1) #define CMD_MQTT_VERSION "AT+QMTCFG=\"version\",0,4\r\n" #define CMD_MQTT_KEEPALIVE "AT+QMTCFG=\"qmtping\",0,30\r\n" // 30???? #define CMD_MQTT_OPENET "AT+QMTOPEN=0,\"36.134.23.11\",1883\r\n" // #define CMD_MQTT_CONNECT "AT+QMTCONN=0,\"%s\",\"%s\",\"%s\"\r\n"// ?????clientid,username,password #define CMD_MQTT_CONNECT "AT+QMTCONN=0,\"device_test\",\"\",\"\"\r\n" #define CMD_MQTT_RECEIVE "AT+QMTCFG=\"recv/mode\",0,0,1\r\n" #define CMD_MQTT_SEND "AT+QMTCFG=\"send/mode\",0,0,1\r\n" // ???? ???????--??????-- #define CMD_MQTT_SUBSCRIBE "AT+QMTSUB=0,1,\"%s\",0\r\n" // ???????? #define CMD_SERVICE_Operatortyp "AT+COPS?\r\n" #define CMD_SERVICE_Networktyp "AT+CREG?\r\n"//7 #define CMD_SERVICE_Networkstatu "AT+COPS?\r\n" #define CMD_SERVICE_SIMcardstatus "AT+CLCK=\"SC\",2\r\n" #define CMD_SERVICE_SIMcardICCID "AT+QCCID\r\n" #define CMD_SERVICE_IMEInumber "AT+GSN\r\n" #define CMD_SERVICE_Signalstrength "AT+CSQ\r\n" #define AT_CMD_HEAD "AT" #define AT_CMD_CFG "+QMTCFG=" #define AT_CMD_TEST "?" #define AT_CMD_VER "version" //#define AT_CMD_T "AT+QMTCFG=?\r\n" #define AT_CMD_T "ATI\r\n" #define true 1 #define false 0 void EC800MPwoerOn(void); void EC800MSendCmd(char *buf, uint16_t len); void EC800MWaitReady(void); bool WaitResponse(char * expectStr, int timeout); #endif