enhance coherence.
This commit is contained in:
@@ -170,7 +170,7 @@ uint8_t svcTemplate[INTRA_SVC_FRAME_LENGTH_MAX] __attribute__ ((aligned (8))) =
|
||||
|
||||
|
||||
L2_CONFIG l2Config = {
|
||||
.myType = HEAD_NODE,
|
||||
.myType = L2_NODE_HEAD,
|
||||
.isInterHead = false,
|
||||
.myId = 1,
|
||||
.clustId = 1,
|
||||
@@ -264,7 +264,7 @@ void forge_w2acq_frame(uint8_t* buff, L2_NODE_TYPE nodeType, uint16_t srcId, uin
|
||||
|
||||
uint64_t dataChunk;
|
||||
/* message type */
|
||||
dataChunk = (nodeType == HEAD_NODE) ? 0 : 1;
|
||||
dataChunk = (nodeType == L2_NODE_HEAD) ? 0 : 1;
|
||||
FrameInsertChunk(&bitarr, NS_MSG_INI_TYPE_OFFSET, NS_MSG_INI_TYPE_LEN, dataChunk);
|
||||
|
||||
/* source node id */
|
||||
@@ -276,13 +276,13 @@ void forge_w2acq_frame(uint8_t* buff, L2_NODE_TYPE nodeType, uint16_t srcId, uin
|
||||
FrameInsertChunk(&bitarr, NS_MSG_INI_LEN_OFFSET, NS_MSG_INI_LEN_LEN, dataChunk);
|
||||
/* current net stage */
|
||||
switch (state) {
|
||||
case INIT_STATE:
|
||||
case L2_INIT_STATE:
|
||||
dataChunk = NET_INI_STAGE;
|
||||
break;
|
||||
case SEEK_STATE:
|
||||
case L2_SEEK_STATE:
|
||||
dataChunk = NET_INTER_SEEK_STAGE;
|
||||
break;
|
||||
case NORMAL_STATE:
|
||||
case L2_NORMAL_STATE:
|
||||
dataChunk = NET_NORMAL_STAGE;
|
||||
break;
|
||||
default:
|
||||
@@ -310,19 +310,19 @@ void forge_mgmt_frame(uint8_t* buff, L2_NODE_STATE state) {
|
||||
|
||||
uint64_t dataChunk;
|
||||
switch (state) {
|
||||
case INIT_STATE:
|
||||
case L2_INIT_STATE:
|
||||
dataChunk = NET_INI_STAGE;
|
||||
break;
|
||||
case NORMAL_STATE:
|
||||
case L2_NORMAL_STATE:
|
||||
dataChunk = NET_NORMAL_STAGE;
|
||||
break;
|
||||
case INTRA_SEEK_STATE:
|
||||
case L2_INTRA_SEEK_STATE:
|
||||
dataChunk = NET_INTRA_SEEK_STAGE;
|
||||
break;
|
||||
case INTER_SEEK_STATE:
|
||||
case L2_INTER_SEEK_STATE:
|
||||
dataChunk = NET_INTER_SEEK_STAGE;
|
||||
break;
|
||||
case SEEK_STATE:
|
||||
case L2_SEEK_STATE:
|
||||
dataChunk = NET_SEEK_STAGE;
|
||||
break;
|
||||
default:
|
||||
@@ -353,21 +353,21 @@ TEST(linklayer_master_routine) {
|
||||
if (L2_GetLastTor(linkInstPtr) == L2_TOR_RX && rand() < (RAND_MAX*0.8))
|
||||
{
|
||||
if(L2_GetLastFrameType(linkInstPtr) == L2_INTRA_W2_ACQ_FRAME) {
|
||||
forge_w2acq_frame((uint8_t*)phyInstPtr->recvDataAddr, MEMBER_NODE, 2, 1, 1, -1, INIT_STATE);
|
||||
forge_w2acq_frame((uint8_t*)phyInstPtr->recvDataAddr, L2_NODE_MEMBER, 2, 1, 1, -1, L2_INIT_STATE);
|
||||
PhyWrite(phyInstPtr, TXRX_STATE, 0x01010101);
|
||||
PhyWrite(phyInstPtr, RECVDATA_STATE, INTRA_W2ACQ_FRAME_LENGTH_MAX);
|
||||
}
|
||||
|
||||
if (L2_GetLastFrameType(linkInstPtr) == L2_INTRA_MGMT_FRAME)
|
||||
{
|
||||
forge_mgmt_frame((uint8_t*)phyInstPtr->recvDataAddr, NORMAL_STATE);
|
||||
forge_mgmt_frame((uint8_t*)phyInstPtr->recvDataAddr, L2_NORMAL_STATE);
|
||||
PhyWrite(phyInstPtr, TXRX_STATE, 0x01010101);
|
||||
PhyWrite(phyInstPtr, RECVDATA_STATE, INTRA_MGMT_FRAME_LENGTH_MAX);
|
||||
}
|
||||
|
||||
if (L2_GetLastFrameType(linkInstPtr) == L2_INTRA_SVC_FRAME)
|
||||
{
|
||||
forge_mgmt_frame((uint8_t*)phyInstPtr->recvDataAddr, NORMAL_STATE);
|
||||
forge_mgmt_frame((uint8_t*)phyInstPtr->recvDataAddr, L2_NORMAL_STATE);
|
||||
PhyWrite(phyInstPtr, TXRX_STATE, 0x01010101);
|
||||
PhyWrite(phyInstPtr, RECVDATA_STATE, INTRA_MGMT_FRAME_LENGTH_MAX);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user