#ifndef _BC26_H_ #define _BC26_H_ #define BC26_RST_PIN GPIO_Pin_7 #define BC26_RST_GPIO_PORT GPIOA #define BC26_RST_HIGH() GPIO_WriteBit(BC26_RST_GPIO_PORT, BC26_RST_PIN, Bit_SET) #define BC26_RST_LOW() GPIO_WriteBit(BC26_RST_GPIO_PORT, BC26_RST_PIN, Bit_RESET) #define BC26_WAKE_PIN GPIO_Pin_4 #define BC26_WAKE_GPIO_PORT GPIOC #define BC26_WAKE_HIGH() GPIO_WriteBit(BC26_WAKE_GPIO_PORT, BC26_WAKE_PIN, Bit_SET) #define BC26_WAKE_LOW() GPIO_WriteBit(BC26_WAKE_GPIO_PORT, BC26_WAKE_PIN, Bit_RESET) #define AT "AT\r\n" #define ATRST "AT+QRST=1\r\n" #define ATQSCLK "AT+QSCLK=0\r\n" //Í˳öÐÝÃßģʽ #define LIGHTSLEEP "AT+QSCLK=2\r\n" //¿É½øÈëdz˯Ãß #define DEEPSLEEP "AT+QSCLK=1\r\n" //¿É½øÈëÉî˯Ãß #define ATE1 "ATE1\r\n" //»ØÏÔÃüÁî #define ATE0 "ATE0\r\n" //²»»ØÏÔÃüÁî #define CIMI "AT+CIMI\r\n" //²éѯ¿¨ºÅ #define CGATT "AT+CGATT=1\r\n" //½« MT ¸½×ÅÓÚ PS Óò #define SCGATT "AT+CGATT?\r\n" #define SQBAND "AT+QBAND?\r\n" #define CSQ "AT+CSQ\r\n" #define SCOPS "AT+COPS?\r\n" #define SCEREG "AT+CEREG?\r\n" #define QICFG "AT+QICFG=\"dataformat\",1,0\r\n" #define QIOPEN "AT+QIOPEN=0,0,\"TCP\",\"%s\",%s,0,1\r\n" #define QIOPENOPT "AT+QIOPEN=0,%d,\"%s\",\"%s\",%s,0,1\r\n" #define QIOPENUDP "AT+QIOPEN=0,0,\"UDP\",\"%s\",%s,0,1\r\n" //#define QIOPEN "AT+QIOPEN=0,0,\"TCP\",\"a17IWSEFgWP.iot-as-mqtt.cn-shanghai.aliyuncs.com\",1883,0,1\r\n" #define QICLOSE "AT+QICLOSE=0\r\n" #define QICLOSECH "AT+QICLOSE=%d\r\n" #define QISTATE "AT+QISTATE=1,0\r\n" //²éѯtcpÁ¬½Ó×´Ì #define QISTATECH "AT+QISTATE=1,%d\r\n" //²éѯͨµÀÁ¬½Ó״̬ #define CFUN0 "AT+CFUN=0\r\n" //UE¹¦ÄÜ×îС»¯ int bc26_sal_init(void); void bc26_sal_register(void); //static int bc26_init(void); //static void bc26_tcp_connect(const char *ip, const char *port); //static void bc26_tcp_reconnect(const char *ip, const char *port); //static int bc26_tcp_state(void); //static int bc26_tcp_close(void); //static int bc26_tcp_state(void); //static int bc26_send_cmd(char *cmd, char *res); //static void bc26_send_cmd_back(char *cmd, char data[], int size); //static int bc26_send_data(const void *data, int len); //static int bc26_get_data(void *data,int len,int timeOut); #endif