Statistics: Posted by ESP_Faye — Mon Apr 11, 2016 10:21 am
Code:
LOCAL void ICACHE_FLASH_ATTR
gw_connect_cb(void *arg)
{
struct espconn *pespconn = arg;
TcpPrint("gw_connect_cb\n");
os_timer_disarm(&check_timer);
espconn_regist_recvcb(pespconn, gw_recv_cb);
espconn_regist_sentcb(pespconn,gw_sent_cb);
espconn_set_opt(pespconn,0x04);
espconn_regist_write_finish(pespconn,gw_write_finish);
init_fddat(fd);
fd->PacketLen = T16(PACK_SIZE(32));
fd->CMDID = T16(CMD_TOKEN);
memcpy(fd->uCmdRsp.tokeninf.Token,Token,MAX_TOKEN);
set_timestamp(&fd->uCmdRsp.tokeninf.tm);
espconn_send(pespconn,(uint8*)fd,PACK_SIZE(32));
os_timer_setfn(&check_timer, (os_timer_func_t *)heart_beat_timer, &gw_conn);
os_timer_arm(&check_timer, 500, 0);
//send_data(PACK_SIZE(32),(char *)fd);
}
Statistics: Posted by ShaoPU — Wed Apr 06, 2016 2:52 pm
Statistics: Posted by ESP_Faye — Wed Apr 06, 2016 1:58 pm
Statistics: Posted by ShaoPU — Wed Apr 06, 2016 10:37 am