add emulation option.

This commit is contained in:
Gatsby Van
2024-01-24 11:19:48 +08:00
parent 2302fbf6de
commit 1b8ea4c38d
2 changed files with 8 additions and 4 deletions
@@ -26,7 +26,9 @@
#include "util.h"
#include "circ_queue.h"
#include "../time_ctrl/time_ctrl.h"
#ifndef EMULATION
#include "../config/app_config.h"
#endif
/************************** Constant Definitions *****************************/
#define NET_START_TIME_INFTY UINT32_MAX
#define LINK_BROCK_THRESHOLD (3 * 200) // 3 secods
@@ -1091,10 +1093,11 @@ static int32_t IntcNodeTTL(NODE_ENTRY *node, const void *param)
/**
* @brief Utility function to check connection to node is still valid.
*/
#ifdef DATALINK_ENABLE_AUTORECONNECT
static bool IsNodeConnected(NODE_ENTRY *node)
{
ASSERT(node != NULL);
DBG_INFO("Node: %u, TTL: %lu.\n", node->nodeInfo.nodeId, node->ttlCnt);
DBG_INFO("Node: %u, TTL: %u.\n", node->nodeInfo.nodeId, node->ttlCnt);
if (node->ttlCnt < LINK_BROCK_THRESHOLD)
{
return true;
@@ -1105,6 +1108,7 @@ static bool IsNodeConnected(NODE_ENTRY *node)
return false;
}
}
#endif
/*****************************************************************************/
/**
@@ -210,7 +210,7 @@ static int32_t Scan_CfmHandler(L2_INST *instPtr)
* @brief Packing Scan message to a bit array.
*
* @param bitarr pointer to bit array buffer.
* msgType message type.
* @param msgType message type.
*
* @return EPARAM
* SUCCESS
@@ -279,7 +279,7 @@ static int32_t ScanMsg_Packing(L2_INST *instPtr, L2_FRAME_TYPE type, uint8_t dst
Status = L2_CrcAppend(buff, L2_CMF_PACK_LEN - L2_MSG_CFM_CRC_LEN, L2_MSG_CFM_CRC, L2_CRC16_1021);
if (Status != SUCCESS)
{
DBG_ERROR("Fail to append CRC, error code: %ld.\n", Status);
DBG_ERROR("Fail to append CRC, error code: %d.\n", Status);
return Status;
}
break;