forked from gatsby/df_datalink
complete linklayer logging
This commit is contained in:
@@ -662,6 +662,8 @@ int32_t Linklayer_Init(L2_INST **instPtr, const L2_CONFIG *config)
|
||||
}
|
||||
memset(*instPtr, 0x00, sizeof(L2_INST));
|
||||
memcpy(&((*instPtr)->config), config, sizeof(L2_CONFIG));
|
||||
// Clear log
|
||||
memset(&((*instPtr)->log), 0x00, sizeof((*instPtr)->log));
|
||||
|
||||
// Packet buffer
|
||||
(*instPtr)->sendPktData = calloc(L2_PACK_LEN_MAX / sizeof(uint64_t), sizeof(uint64_t));
|
||||
@@ -954,6 +956,7 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
L2_Service_Reset(instPtr->serviceFSM);
|
||||
instPtr->cxn2Net = false;
|
||||
UpdateMainSate(instPtr, L2_INIT_STATE);
|
||||
instPtr->log.reconnectCnt++;
|
||||
break;
|
||||
}
|
||||
case L2_EV_LOST_NODE:
|
||||
@@ -962,6 +965,8 @@ int32_t Linklayer_EventHandler(L2_INST *instPtr, const L2_EVENT *l2Event)
|
||||
L2_Scan_Reset(instPtr->scanFSM);
|
||||
L2_Service_Reset(instPtr->serviceFSM);
|
||||
UpdateMainSate(instPtr, L2_INIT_STATE);
|
||||
// Log reconnect
|
||||
instPtr->log.reconnectCnt++;
|
||||
break;
|
||||
}
|
||||
case L2_ROUTINE_FINISH:
|
||||
@@ -1234,12 +1239,11 @@ int32_t Linklayer_Proc(L2_INST *instPtr)
|
||||
instPtr->linkLog.nodeType = (instPtr->config.myType == L2_NODE_HEAD) ? 0xAA : 0xCC;
|
||||
instPtr->linkLog.cxnStatus = (instPtr->cxn2Net) ? 0x11 : 0x00;
|
||||
instPtr->linkLog.linkStage = (instPtr->mainState == L2_INIT_STATE) ? 0x11 : 0x22;
|
||||
// TODO:
|
||||
// instPtr->linkLog.recxnCnt =
|
||||
// instPtr->linkLog.beamNo =
|
||||
// instPtr->linkLog.beamWidth =
|
||||
// instPtr->linkLog.beamAz =
|
||||
// instPtr->linkLog.beamEl =
|
||||
instPtr->linkLog.recxnCnt = instPtr->log.reconnectCnt;
|
||||
instPtr->linkLog.beamNo = instPtr->log.scanBeamNo;
|
||||
instPtr->linkLog.beamWidth = instPtr->log.lastBeamWidth;
|
||||
instPtr->linkLog.beamAz = antSubnrrwPattern[instPtr->log.scanBeamNo].oaxis;
|
||||
instPtr->linkLog.beamEl = antSubnrrwPattern[instPtr->log.scanBeamNo].raxis;
|
||||
instPtr->linkLog.advTxCnt = (uint16_t)instPtr->log.advTxCnt;
|
||||
instPtr->linkLog.advRecvCnt = (uint16_t)instPtr->log.advRecvCnt;
|
||||
instPtr->linkLog.advCorrectCnt = (uint16_t)instPtr->log.advCorrectCnt;
|
||||
|
||||
@@ -66,6 +66,9 @@ typedef struct
|
||||
uint32_t svcCorrectCnt;
|
||||
|
||||
int64_t timeDev;
|
||||
uint8_t scanBeamNo;
|
||||
uint8_t lastBeamWidth;
|
||||
uint32_t reconnectCnt;
|
||||
} L2_LOG;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -405,6 +405,10 @@ int32_t L2_Scan_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
||||
node->nodeInfo.pos.y = (double) nodePos;
|
||||
L2_FrameGetChunk(msg, L2_MSG_ADV_SRC_POSZ, L2_MSG_ADV_SRC_POSZ_LEN, &nodePos);
|
||||
node->nodeInfo.pos.z = (double) nodePos;
|
||||
node->nodeInfo.beamNo = Phy_LastScanBeamNo(instPtr->config.phyInstPtr);
|
||||
|
||||
// log last scan beam number
|
||||
instPtr->log.scanBeamNo = node->nodeInfo.beamNo;
|
||||
|
||||
// Reset node ttl
|
||||
node->ttlCnt = 0;
|
||||
|
||||
Reference in New Issue
Block a user