Beispiel #1
0
/*************************************************
* Function: PCT_SendHeartMsg
* Description: 
* Author: cxy 
* Returns: 
* Parameter: 
* History:
*************************************************/
void PCT_SendHeartMsg()
{
    //ZC_MessageHead struHeart;
    ZC_SecHead struSecHead;
    u16 u16Len = 0;

    EVENT_BuildHeartMsg((u8*)&struSecHead, &u16Len);

    (void)PCT_SendMsgToCloud(&struSecHead, NULL);

    g_struProtocolController.pstruMoudleFun->pfunSetTimer(PCT_TIMER_SENDHEART, 
        PCT_TIMER_INTERVAL_HEART, &g_struProtocolController.u8HeartTimer);

    g_struProtocolController.pstruMoudleFun->pfunSetTimer(PCT_TIMER_CHECK_CLOUD_ACK, 
        PCT_TIMER_INTERVAL_CLOUD_ACK, &g_struProtocolController.u8CloudAckTimer);
    
}
/*************************************************
* Function: PCT_SendHeartMsg
* Description: 
* Author: cxy 
* Returns: 
* Parameter: 
* History:
*************************************************/
void PCT_SendHeartMsg()
{
    ZC_MessageHead struHeart;
    ZC_SecHead struSecHead;
    u16 u16Len = 0;
    
    EVENT_BuildHeartMsg((u8*)&struHeart, &u16Len);

    /*build sec head*/
    struSecHead.u8SecType = ZC_SEC_ALG_AES;
    struSecHead.u16TotalMsg = ZC_HTONS(u16Len);

    (void)PCT_SendMsgToCloud(&struSecHead, (u8*)&struHeart);

    g_struProtocolController.pstruMoudleFun->pfunSetTimer(PCT_TIMER_SENDHEART, 
        PCT_TIMER_INTERVAL_HEART, &g_struProtocolController.u8HeartTimer);
    
}