#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"  //可进入浅睡眠
#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 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 QISTATE    "AT+QISTATE=1,0\r\n"   //查询tcp连接状态
#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

