|
@@ -18,6 +18,7 @@ static void call_func_note_lineoff(unsigned char *data, int datalen);
|
|
static void call_func_cmds(unsigned char *data, int datalen);
|
|
static void call_func_cmds(unsigned char *data, int datalen);
|
|
//internal
|
|
//internal
|
|
static void call_func_login_req(unsigned char *data, int datalen);
|
|
static void call_func_login_req(unsigned char *data, int datalen);
|
|
|
|
+static void call_func_query_req(unsigned char *data, int datalen);
|
|
static void call_func_ping_req(unsigned char *data, int datalen);
|
|
static void call_func_ping_req(unsigned char *data, int datalen);
|
|
//extern
|
|
//extern
|
|
static void call_func_login_ack(unsigned char *data, int datalen);
|
|
static void call_func_login_ack(unsigned char *data, int datalen);
|
|
@@ -26,6 +27,7 @@ static const WPOC_EVENT_LIST wpoc_event_entries[]={
|
|
{WPOC_QUE_DATA_CMDS, call_func_cmds},
|
|
{WPOC_QUE_DATA_CMDS, call_func_cmds},
|
|
{WPOC_QUE_DATA_TX_LINEOFF, call_func_note_lineoff},
|
|
{WPOC_QUE_DATA_TX_LINEOFF, call_func_note_lineoff},
|
|
{WPOC_QUE_DATA_TX_LOGIN, call_func_login_req},
|
|
{WPOC_QUE_DATA_TX_LOGIN, call_func_login_req},
|
|
|
|
+ {WPOC_QUE_DATA_TX_QUERY_GROUP, call_func_query_req},
|
|
{WPOC_QUE_DATA_TX_PING, call_func_ping_req},
|
|
{WPOC_QUE_DATA_TX_PING, call_func_ping_req},
|
|
{WPOC_QUE_DATA_RX_LOGINACK, call_func_login_ack},
|
|
{WPOC_QUE_DATA_RX_LOGINACK, call_func_login_ack},
|
|
{WPOC_QUE_DATA_RX_PONG_TIMEACK, call_func_times}
|
|
{WPOC_QUE_DATA_RX_PONG_TIMEACK, call_func_times}
|
|
@@ -81,6 +83,10 @@ static void call_func_login_req(unsigned char *data, int datalen){
|
|
WPOC_DEF *info=(WPOC_DEF *)tdata->param1;
|
|
WPOC_DEF *info=(WPOC_DEF *)tdata->param1;
|
|
wpoc_login_req(sock, info->psn, info->pass,info->hardid,info->platform);
|
|
wpoc_login_req(sock, info->psn, info->pass,info->hardid,info->platform);
|
|
}
|
|
}
|
|
|
|
+static void call_func_query_req(unsigned char *data, int datalen){
|
|
|
|
+ OEM_sock *sock=wpoc_get_tcp_sock();
|
|
|
|
+ wpoc_query_group_req(sock);
|
|
|
|
+}
|
|
static void call_func_ping_req(unsigned char *data, int datalen){
|
|
static void call_func_ping_req(unsigned char *data, int datalen){
|
|
WPOC_CMD_DATA_DEF *tdata=(WPOC_CMD_DATA_DEF *)data;
|
|
WPOC_CMD_DATA_DEF *tdata=(WPOC_CMD_DATA_DEF *)data;
|
|
OEM_sock *sock=wpoc_get_tcp_sock();
|
|
OEM_sock *sock=wpoc_get_tcp_sock();
|
|
@@ -90,10 +96,18 @@ static void call_func_ping_req(unsigned char *data, int datalen){
|
|
static void call_func_login_ack(unsigned char *data, int datalen){
|
|
static void call_func_login_ack(unsigned char *data, int datalen){
|
|
WPOC_MSG_TR_AT_FUN at_fun=wpoc_app.usrMsgRx->wpoc_msg_rx_at_fun;
|
|
WPOC_MSG_TR_AT_FUN at_fun=wpoc_app.usrMsgRx->wpoc_msg_rx_at_fun;
|
|
WPOC_MSG_RX_EVENT_FUN cb_fun=wpoc_app.usrMsgRx->wpoc_msg_rx_event_fun;
|
|
WPOC_MSG_RX_EVENT_FUN cb_fun=wpoc_app.usrMsgRx->wpoc_msg_rx_event_fun;
|
|
|
|
+ WPOC_LOGINACK_DEF *uinfo=(WPOC_LOGINACK_DEF *)data;
|
|
if(at_fun!=NULL){
|
|
if(at_fun!=NULL){
|
|
|
|
+ char buf[64];
|
|
at_fun("+WPTT:LOGIN=1\r\n");
|
|
at_fun("+WPTT:LOGIN=1\r\n");
|
|
|
|
+ snprintf(buf, sizeof(buf), "+WPTT:ME=%08x,",uinfo->user_id);
|
|
|
|
+ strcat_hexstr_string(buf, uinfo->user_name,true);
|
|
|
|
+ at_fun(buf);
|
|
|
|
+ snprintf(buf, sizeof(buf), "+WPTT:BE=%08x,%04x,",uinfo->be_group_id,uinfo->user_num_in_group);
|
|
|
|
+ strcat_hexstr_string(buf, uinfo->be_group_name,true);
|
|
|
|
+ at_fun(buf);
|
|
}else if(cb_fun!=NULL){
|
|
}else if(cb_fun!=NULL){
|
|
- cb_fun(WPOC_RX_EVENT_LOGIN, NULL, 0);
|
|
|
|
|
|
+ cb_fun(WPOC_RX_EVENT_LOGIN, data, datalen);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
static void call_func_times(unsigned char *data, int datalen){
|
|
static void call_func_times(unsigned char *data, int datalen){
|
|
@@ -107,14 +121,7 @@ static void call_func_times(unsigned char *data, int datalen){
|
|
cb_fun(WPOC_RX_EVENT_TIMES, data, datalen);
|
|
cb_fun(WPOC_RX_EVENT_TIMES, data, datalen);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-char wpoc_msg_cmp(char *msg, char *target){
|
|
|
|
- char *p1=target, *p2=msg;
|
|
|
|
- while(*p1 != 0){
|
|
|
|
- if(*p1 != *p2) return 0;
|
|
|
|
- p1++;p2++;
|
|
|
|
- }
|
|
|
|
- return 1;
|
|
|
|
-}
|
|
|
|
|
|
+
|
|
//cmds
|
|
//cmds
|
|
static void call_func_cmds(unsigned char *data, int datalen){
|
|
static void call_func_cmds(unsigned char *data, int datalen){
|
|
const char *func_cmds_mark="AT+WPTT:";
|
|
const char *func_cmds_mark="AT+WPTT:";
|
|
@@ -163,7 +170,13 @@ int wpoc_msg_at_tx(char *msg){
|
|
int wpoc_msg_event_tx(WPOC_EVENT_TX event, unsigned char *data, int datalen){
|
|
int wpoc_msg_event_tx(WPOC_EVENT_TX event, unsigned char *data, int datalen){
|
|
if(wpoc_app.poc_tcp==0) return -1;
|
|
if(wpoc_app.poc_tcp==0) return -1;
|
|
if(wpoc_app.poc_login==0) return -2;
|
|
if(wpoc_app.poc_login==0) return -2;
|
|
|
|
+ WPOC_REQ_GROUP_DEF *groupQuery;
|
|
switch(event){
|
|
switch(event){
|
|
|
|
+ case WPOC_TX_EVENT_REQGOUPS:
|
|
|
|
+ groupQuery=(WPOC_REQ_GROUP_DEF *)data;
|
|
|
|
+ if(groupQuery==NULL) return -3;
|
|
|
|
+ w_poc_cmd_que_tx_ping(groupQuery->startIndex, groupQuery->totalNum);
|
|
|
|
+ break;
|
|
case WPOC_TX_EVENT_REQTIME:
|
|
case WPOC_TX_EVENT_REQTIME:
|
|
w_poc_cmd_que_tx_ping(true);
|
|
w_poc_cmd_que_tx_ping(true);
|
|
break;
|
|
break;
|