Example #1
0
void setChannelAttrs(pgcontext pgc, stCloudAttrs_t *cloudClient, stLanAttrs_t *lanClient, uint8 isBroadCast)
{
    if(isBroadCast)
    {
        pgc->rtinfo.stChannelAttrs.lanClient.fd = -1;
        pgc->rtinfo.stChannelAttrs.lanClient.cmd = GAGENT_LAN_CMD_CTL_93;
        pgc->rtinfo.stChannelAttrs.lanClient.sn = 0;

        pgc->rtinfo.stChannelAttrs.cloudClient.phoneClientId[0] = '\0';
        pgc->rtinfo.stChannelAttrs.cloudClient.cmd = GAGENT_LAN_CMD_CTL_93;
        pgc->rtinfo.stChannelAttrs.cloudClient.sn = 0;

    }
    else
    {
        if(NULL != lanClient)
        {
            pgc->rtinfo.stChannelAttrs.lanClient = *lanClient;
            pgc->rtinfo.stChannelAttrs.lanClient.cmd += 1;
            Lan_ClearClientAttrs(pgc, &pgc->ls.srcAttrs);
        }
        if(NULL != cloudClient)
        {
            pgc->rtinfo.stChannelAttrs.cloudClient = *cloudClient;
            pgc->rtinfo.stChannelAttrs.cloudClient.cmd += 1;
            Cloud_ClearClientAttrs(pgc, &pgc->rtinfo.waninfo.srcAttrs);
        }
    }
    
}
void setChannelAttrs(pgcontext pgc, stCloudAttrs_t *cloudClient, stLanAttrs_t *lanClient, uint8 isBroadCast)
{
    if(isBroadCast)
    {
        pgc->rtinfo.stChannelAttrs.lanClient.fd = -1;
        /* use 0x0091, Cloud and APP will support cmd 0x0091 */
        pgc->rtinfo.stChannelAttrs.lanClient.cmd = GAGENT_LAN_CMD_TRANSMIT_91;
        pgc->rtinfo.stChannelAttrs.lanClient.sn = 0;

        pgc->rtinfo.stChannelAttrs.cloudClient.phoneClientId[0] = '\0';
        /* use 0x0091, Cloud and APP will support cmd 0x0091 */
        pgc->rtinfo.stChannelAttrs.cloudClient.cmd = GAGENT_LAN_CMD_TRANSMIT_91;
        pgc->rtinfo.stChannelAttrs.cloudClient.sn = 0;

    }
    else
    {
        if(NULL != lanClient)
        {
            pgc->rtinfo.stChannelAttrs.lanClient = *lanClient;
            pgc->rtinfo.stChannelAttrs.lanClient.cmd += 1;
            Lan_ClearClientAttrs(pgc, &pgc->ls.srcAttrs);
        }
        if(NULL != cloudClient)
        {
            pgc->rtinfo.stChannelAttrs.cloudClient = *cloudClient;
            pgc->rtinfo.stChannelAttrs.cloudClient.cmd += 1;
            Cloud_ClearClientAttrs(pgc, &pgc->rtinfo.waninfo.srcAttrs);
        }
    }
    
}
Example #3
0
void clearChannelAttrs(pgcontext pgc)
{
    Lan_ClearClientAttrs( pgc, &pgc->rtinfo.stChannelAttrs.lanClient );
    Cloud_ClearClientAttrs( pgc, &pgc->rtinfo.stChannelAttrs.cloudClient );
}