{
case GPRS_LOCAL_SET_AUTOWORK:/*1->设置为工作自适应*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_FLO);
break;
case GPRS_LOCAL_SET_FLO :/*2->关闭流控制*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CLOSE_ECHO);
break;
case GPRS_LOCAL_CLOSE_ECHO:/*3->关闭回显*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_OPEN_LED);
break;
case GPRS_LOCAL_OPEN_LED:/*4->打开LED*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SAVE_LED_STATE);
break;
case GPRS_LOCAL_SAVE_LED_STATE:/*5->保存LED灯状态*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_BAUD);
break;
case GPRS_LOCAL_SET_BAUD:/*6->设置波特率*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CHECK_SIM_CARD);
break;
case GPRS_LOCAL_CHECK_SIM_CARD:/*7->检查SIM卡是否存在*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CHECK_SIM_CARD_STATE);
break;
case GPRS_LOCAL_CHECK_SIM_CARD_STATE:/*8->SIM卡是否正常*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_QUREY_HARD_SN);
break;
case GPRS_LOCAL_QUREY_HARD_SN:/*9->查询硬件号*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_QUREY_SIM_CARD_ID);
break;
case GPRS_LOCAL_QUREY_SIM_CARD_ID:/*10->查询SIM 卡ID*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CHECK_NET_STATE);
break;
case GPRS_LOCAL_CHECK_NET_STATE:/*11->检查网络情况*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_QUREY_CSQ_VALUE);
break;
case GPRS_LOCAL_QUREY_CSQ_VALUE:/*12->查询信号强度值*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_QUREY_GSM_NET_REG_STATE);
break;
case GPRS_LOCAL_QUREY_GSM_NET_REG_STATE:/*13->检查GSM网络注册情况*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GSM_CSCS_IRA);
break;
case GPRS_LOCAL_SET_GSM_CSCS_IRA:/*14->设置短信字符集合*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GSM_TXT_TYPE);
break;
case GPRS_LOCAL_SET_GSM_TXT_TYPE:/*15->设置短信为文本模式*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GSM_CENTER_NUM);
break;
case GPRS_LOCAL_SET_GSM_CENTER_NUM:/*16->设置短信中心号码*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_MODEL_AUTO_SEND_GSM);
break;
case GPRS_LOCAL_SET_MODEL_AUTO_SEND_GSM:/*17->设置模块主动上报短信*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_MODEL_APN_CFG);
break;
case GPRS_LOCAL_SET_MODEL_APN_CFG:/*18->设置模块APN配置*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_MODEL_ADD_TO_NET);
break;
case GPRS_LOCAL_SET_MODEL_ADD_TO_NET:/*19->设置模块附着GPRS网络*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_GPRS_DISCONNECT_SOCKET);
break;
case GPRS_LOCAL_GPRS_DISCONNECT_SOCKET:/*20->断开套接口*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GPRS_NET_FREE);
break;
case GPRS_LOCAL_SET_GPRS_NET_FREE:/*21->断开GPRS网络*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GPRS_NET_REQUEST);
break;
case GPRS_LOCAL_SET_GPRS_NET_REQUEST:/*22->GPRS网络请求*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GPRS_NET_CHECK);
break;
case GPRS_LOCAL_SET_GPRS_NET_CHECK:/*23->GPRS网络检查*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_GPRS_NET_SOCKET);
break;
case GPRS_LOCAL_SET_GPRS_NET_SOCKET:/*24->对SOCKET进行设置*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CONNECT_TO_REMOTE);
break;
case GPRS_LOCAL_CONNECT_TO_REMOTE:/*25->连接远方终端*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_RUN_IN_RX_TX_STATE);
break;
case GPRS_LOCAL_RUN_IN_RX_TX_STATE:/*处于正常运行可以收发数据的情况下*/
break;
case GPRS_LOCAL_RECONNECT_TO_REMOTE:/*重新连接套接口*/
break;
case GPRS_LOCAL_SET_USER_NAME:/*设置用户名*/
break;
case GPRS_LOCAL_SET_USER_CODE:/*设置用户密码*/
break;
case GPRS_LOCAL_QUREY_MODEL_VERSION:/*查询模块版本号*/
break;
case GPRS_LOCAL_OPEN_ECHO:/*打开回显*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_OPEN_LED);
break;
case GPRS_LOCAL_TEMP_SHUTDOWN_SOCKET:/*临时挂起SOCKET*/
break;
case GPRS_LOCAL_GPRS_IN_SLEEP_MODE:/*GPRS处于休眠模式*/
break;
case GPRS_LOCAL_GET_GPRS_TIME:/*获取GPRS的对时时间*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_SET_OPEN_GPS_FUN);
break;
case GPRS_LOCAL_SET_OPEN_GPS_FUN:/*开启GPS功能*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_CONNECT_TO_REMOTE);
break;
case GPRS_LOCAL_SET_CLOSE_GPS_FUN:
break;
case GPRS_LOCAL_SET_TIME_TYPE:/*设置GPRS对时格式*/
MACRO_GPRS_SET_SEND_PACK_TYPE(GPRS_LOCAL_GET_GPRS_TIME);
break;
case GPRS_LOCAL_GET_GPRS_QTH:/*获取地理位置坐标*/
break;
}
对应的命令表
#define GPRS_CMD_ACK_OK "OK\r\n" /*接收正确*/
#define GPRS_CMD_AT "AT\r" /*AT自适应命令*/
#define GPRS_CMD_FLO "AT+FLO=0\r" /*关闭流*/
#define GPRS_CMD_OPEN_LED "AT#SLED=2\r" /*打开LED灯*/
#define GPRS_CMD_SAVE_LED_STATE "AT#SLEDSAV\r" /*保存LED状态*/
#define GPRS_CMD_SET_BAUD "AT+IPR=115200\r" /*设置通信波特率*/
#define GPRS_CMD_CMEE "AT+CMEE=2\r"/*检查SIM卡是否存在*/
#define GPRS_CMD_CPIN "AT+CPIN?\r" /*检查SIM卡当前状态*/
#define GPRS_CMD_CREG "AT+CREG?\r" /*当前网络注册情况*/
#define GPRS_CMD_CSQ "AT+CSQ\r" /*查询模块信号值*/
#define GPRS_CMD_CGREG "AT+CGREG?\r"/*检查GSM网络注册情况*/
#define GPRS_CMD_CMGF "AT+CMGF=1\r"/*设置短信格式为文本模式*/
#define GPRS_CMD_CSCA "AT+CSCA=+8613800791500\r"/*设置短信中心号码江西省*/
#define GPRS_CMD_CMGSACK ">" /*短信接收*/
#define GPRS_CMD_CNMI "AT+CNMI=2,2,0,1,0\r"/*设置模块主动上报短信*/
#define GPRS_CMD_CGATT "AT+CGATT=1\r"/*设置模块附着GPRS网络*/
#define GPRS_CMD_GPRS_FREE "AT#GPRS=0\r" /*GPRS网络失效*/
#define GPRS_CMD_GPRS_RQ "AT#GPRS=1\r" /*GPRS网络请求*/
#define GPRS_CMD_GPRS_CHECK "AT#GPRS?\r" /*GPRS网络检查*/
#define GPRS_CMD_SCFGEXT "At#SCFGEXT=1,2,1,240,0,1\r"/*配置AT模式下的SOCKET*/
#define GPRS_CMD_SD_AT "AT#SD=1,0, 7000,\"191.255.255.255\",0,0,1\r"/*AT模式下的连接配置*/
#define GPRS_CMD_SH "AT#SH=1\r"/*断开SOCKET*/
#define GPRS_CMD_ATSO "AT#SO=1\r"/*Socket 连接恢复指令,可以在断开GPRS连接后快速恢复连接*/
#define GPRS_CMD_USERID "AT#USERID=\" \"\r"/*设置用户名*/
#define GPRS_CMD_PASS "AT#PASSW=\" \"\r"/*设置密码*/
#define GPRS_CMD_GMR "AT+GMR\r"/*查询GPRS版本号*/
#define GPRS_CMD_ATE "ATE0\r" /*关闭回显*/
#define GPRS_CMD_ATE1 "ATE1\r"/*打开回显*/
#define GPRS_CMD_IMEI "AT+CGSN\r"/*查询硬件号*/
#define GPRS_CMD_CCID "AT#CCID\r"/*查询 SIM卡序列号*/
#define GPRS_CMD_HANGUP "+++"/*临时挂起SOCKET*/
#define GPRS_CMD_CFUN "AT+CFUN=5\r" /*处于休眠模式*/
#define GPRS_CMD_CFUN1 "AT+CFUN=1\r" /* 恢复默认 */
#define GPRS_CMD_CFUN4 "AT+CFUN=4\r" /* 关闭射频 */
#define GPRS_CMD_SRING "SRING: 1,"
#define GPRS_CMD_LEDSAVE "AT#SLEDSAV\r"
#define GPRS_CMD_SET_TIME_TYPE "AT+CCLK=" /* 02/09/07,22:30:00+00" */
#define GPRS_CMD_GET_GPRS_TIME "AT+CCLK" /* 读取时间 02/09/07,22:30:25”*/
#define GPRS_CMD_GET_GPRS_QTH "AT$GPSACP" /*获取GPS信息 <3.5.7.17.7节>*/
#define GPRS_CMD_OPEN_GPRS_FUN "AT$GPSP=1" /*关闭GPS功能 <3.5.7.17 节>*/
#define GPRS_CMD_CLOSE_GPRS_FUN "AT$GPSP=0" /*关闭GPS功能*/