/**************************************************************** FunctionName : GAgent_Lan_SendTcpData Description : send buf data to TCP client. return : void Add by Will.zhou --2015-03-17 ****************************************************************/ void GAgent_Lan_SendTcpData(pgcontext pgc,ppacket pTxBuf) { int32 fd; uint16 cmd; int32 sn; fd = pgc->rtinfo.stChannelAttrs.lanClient.fd; cmd = pgc->rtinfo.stChannelAttrs.lanClient.cmd; sn = pgc->rtinfo.stChannelAttrs.lanClient.sn; if((pTxBuf->pend - pTxBuf->ppayload) > 0) { /* with payload */ Lan_sendTcpData(pgc, fd, cmd, sn, pTxBuf); if(GAGENT_LAN_CMD_CTL_93 == cmd) { /* mcu report status to client */ /* transfer 0x93 to 0x91 to compiatable with old sdk */ Lan_sendTcpData(pgc, fd, GAGENT_LAN_CMD_TRANSMIT_91, sn, pTxBuf); } } else { /* no payload */ if(GAGENT_LAN_CMD_CTLACK_94 == cmd) { /* send ack to APP */ Lan_sendTcpData(pgc, fd, cmd, sn, pTxBuf); } } return ; }
/**************************************************************** FunctionName : GAgent_Lan_SendTcpData Description : send buf data to TCP client. return : void Add by Will.zhou --2015-03-17 ****************************************************************/ void GAgent_Lan_SendTcpData(pgcontext pgc,ppacket pTxBuf) { int32 fd; uint16 cmd; int32 sn; fd = pgc->rtinfo.stChannelAttrs.lanClient.fd; cmd = pgc->rtinfo.stChannelAttrs.lanClient.cmd; sn = pgc->rtinfo.stChannelAttrs.lanClient.sn; Lan_sendTcpData(pgc, fd, cmd, sn, pTxBuf); if(GAGENT_LAN_CMD_CTL_93 == cmd) { Lan_sendTcpData(pgc, fd, GAGENT_LAN_CMD_TRANSMIT_91, sn, pTxBuf); } return ; }