/*************************************************
* Function: PCT_HandleMoudleMsg
* Description: 
* Author: cxy 
* Returns: 
* Parameter: 
* History:
*************************************************/
void PCT_SetTokenKey(PTC_ProtocolCon *pstruContoller, MSG_Buffer *pstruBuffer)
{
    ZC_MessageHead *pstruMsg;
    ZC_TokenSetReq *pstruSetKey;

    pstruMsg = (ZC_MessageHead*)pstruBuffer->u8MsgBuffer;
    pstruSetKey = (ZC_TokenSetReq *)(pstruMsg + 1);

    ZC_StoreTokenKey(pstruSetKey->TokenKey);

    PCT_SendEmptyMsg(pstruMsg->MsgId, ZC_SEC_ALG_AES);
    PCT_SendAckToCloud(pstruMsg->MsgId);
    
    return;
}
Example #2
0
/*************************************************
* Function: PCT_HandleMoudleMsg
* Description: 
* Author: cxy 
* Returns: 
* Parameter: 
* History:
*************************************************/
void PCT_SetTokenKey(PTC_ProtocolCon *pstruContoller, MSG_Buffer *pstruBuffer)
{
    ZC_MessageHead *pstruMsg;
    ZC_TokenSetReq *pstruSetKey;

    pstruMsg = (ZC_MessageHead*)pstruBuffer->u8MsgBuffer;
    pstruSetKey = (ZC_TokenSetReq *)(pstruMsg + 1);

    if (PCT_LOCAL_DYNAMIC_TOKEN == g_struProtocolController.u32LocalTokenFlag)
    {
        ZC_StoreTokenKey(pstruSetKey->TokenKey);
    }

    PCT_SendAckToCloud(pstruMsg->MsgId);
    
    return;
}