forked from gatsby/df_datalink
add beam steering
This commit is contained in:
@@ -595,6 +595,7 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
ASSERT(instPtr != NULL);
|
||||
L2_TOR_TYPE torState;
|
||||
int32_t Status;
|
||||
const NODE_ENTRY* commNode;
|
||||
DBG_INFO("-------- Scan Routine --------\n");
|
||||
|
||||
if (rtneEntry->slotSeq != 0)
|
||||
@@ -607,15 +608,24 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
if (rtneEntry->dst == L2_GetNodeId(instPtr) || rtneEntry->dst == L2_BROADCAST_ID)
|
||||
{
|
||||
torState = L2_TOR_RX;
|
||||
commNode = L2_GetNodeById(rtneEntry->dst);
|
||||
}
|
||||
else if (rtneEntry->src == L2_GetNodeId(instPtr) || rtneEntry->src == L2_BROADCAST_ID)
|
||||
{
|
||||
torState = L2_TOR_TX;
|
||||
commNode = L2_GetNodeById(rtneEntry->src);
|
||||
}
|
||||
else
|
||||
{
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
|
||||
Phy_SetBeamWidth(instPtr->config.phyInstPtr, PHY_ANT_BEAM_25);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_25;
|
||||
if (commNode != NULL)
|
||||
{
|
||||
Phy_SetBeamNo(commNode->nodeInfo.beamNo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -631,6 +641,8 @@ int32_t L2_Scan_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntry)
|
||||
{
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
Phy_SetBeamWidth(instPtr->config.phyInstPtr, PHY_ANT_BEAM_120);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_120;
|
||||
}
|
||||
|
||||
switch (rtneEntry->slotType)
|
||||
|
||||
@@ -369,19 +369,34 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
|
||||
|
||||
PHY_INST* phyRef = instPtr->config.phyInstPtr;
|
||||
L2_TOR_TYPE torState;
|
||||
const NODE_ENTRY* commNode;
|
||||
if (rtneEntry->src == L2_GetNodeId(instPtr))
|
||||
{
|
||||
torState = L2_TOR_TX;
|
||||
commNode = L2_GetNodeById(rtneEntry->src);
|
||||
}
|
||||
else if (rtneEntry->dst == L2_GetNodeId(instPtr))
|
||||
{
|
||||
torState = L2_TOR_RX;
|
||||
commNode = L2_GetNodeById(rtneEntry->src);
|
||||
}
|
||||
else
|
||||
{
|
||||
torState = L2_TOR_SUSPEND;
|
||||
}
|
||||
|
||||
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD && commNode != NULL)
|
||||
{
|
||||
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_25);
|
||||
Phy_SetBeamNo(phyRef, commNode->nodeInfo.beamNo);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
Phy_SetBeamWidth(phyRef, PHY_ANT_BEAM_120);
|
||||
instPtr->log.lastBeamWidth = PHY_ANT_BEAM_120;
|
||||
}
|
||||
|
||||
switch (rtneEntry->slotType)
|
||||
{
|
||||
case L2_SLOT_SERVICE:
|
||||
|
||||
Reference in New Issue
Block a user