42 #include "rdk_moca_hal.h"
46 MoCAInterfaceAssociatedDevice::MoCAInterfaceAssociatedDevice(
int _dev_id):
48 m_bPreferredNC(false),
51 m_ui32TxPowerControlReduction(0),
54 m_i32RxBcastPowerLevel(0),
57 m_ui32RxErroredAndMissedPackets(0),
58 m_bQAM256Capable(false),
59 m_ui32PacketAggregationCapability(0),
64 memset(m_i8MacAddress,0, MAC_ADDRESS_LENGTH);
65 memset(m_i8HighestVersion,0,VERSION_LENGTH);
77 MoCAInterfaceAssociatedDevice::~MoCAInterfaceAssociatedDevice()
98 const uint32_t associatedId = associatedDeviceNum;
101 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
104 RMH_MacAddress_t macAddr;
106 const size_t macAddrBuffSize = 20;
107 char macAddrBuff[macAddrBuffSize] = {
'\0'};
109 snprintf(stMsgData->
paramValue, macAddrBuffSize-1,
"%s", macAddrBuff);
120 stMsgData->
paramtype = hostIf_UnsignedIntType;
121 stMsgData->
paramLen =
sizeof(
unsigned int);
126 const uint32_t associatedId = associatedDeviceNum;
129 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
132 if(nodeID >= 0 && nodeID <=16) {
143 stMsgData->
paramtype = hostIf_BooleanType;
150 const uint32_t associatedId = associatedDeviceNum;
153 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
156 bool isPrefNC =
false;
168 stMsgData->
paramtype = hostIf_StringType;
173 const uint32_t associatedId = associatedDeviceNum;
176 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
179 RMH_MoCAVersion hVer;
181 snprintf(stMsgData->
paramValue, (TR69HOSTIFMGR_MAX_PARAM_LEN-1),
"%02X", hVer);
192 stMsgData->
paramtype = hostIf_UnsignedIntType;
196 const uint32_t associatedId = associatedDeviceNum;
199 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
208 stMsgData->
paramLen =
sizeof(
unsigned int);
215 stMsgData->
paramtype = hostIf_UnsignedIntType;
219 const uint32_t associatedId = associatedDeviceNum;
222 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
231 stMsgData->
paramLen =
sizeof(
unsigned int);
238 stMsgData->
paramtype = hostIf_UnsignedIntType;
239 stMsgData->
paramLen =
sizeof(
unsigned int);
244 const uint32_t associatedId = associatedDeviceNum;
247 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
262 stMsgData->
paramtype = hostIf_UnsignedIntType;
263 stMsgData->
paramLen =
sizeof(
unsigned int);
268 const uint32_t associatedId = associatedDeviceNum;
271 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
285 stMsgData->
paramtype = hostIf_UnsignedIntType;
286 stMsgData->
paramLen =
sizeof(
unsigned int);
291 const uint32_t associatedId = associatedDeviceNum;
294 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
308 stMsgData->
paramtype = hostIf_UnsignedIntType;
309 stMsgData->
paramLen =
sizeof(
unsigned int);
314 const uint32_t associatedId = associatedDeviceNum;
317 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
332 stMsgData->
paramtype = hostIf_UnsignedIntType;
333 stMsgData->
paramLen =
sizeof(
unsigned int);
338 const uint32_t associatedId = associatedDeviceNum;
341 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
356 stMsgData->
paramtype = hostIf_UnsignedIntType;
357 stMsgData->
paramLen =
sizeof(
unsigned int);
362 const uint32_t associatedId = associatedDeviceNum;
365 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
379 stMsgData->
paramtype = hostIf_UnsignedIntType;
380 stMsgData->
paramLen =
sizeof(
unsigned int);
385 const uint32_t associatedId = associatedDeviceNum;
388 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
403 stMsgData->
paramtype = hostIf_BooleanType;
409 const uint32_t associatedId = associatedDeviceNum;
412 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
427 stMsgData->
paramtype = hostIf_UnsignedIntType;
428 stMsgData->
paramLen =
sizeof(
unsigned int);
433 const uint32_t associatedId = associatedDeviceNum;
436 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
451 stMsgData->
paramtype = hostIf_UnsignedIntType;
452 stMsgData->
paramLen =
sizeof(
unsigned int);
457 const uint32_t associatedId = associatedDeviceNum;
460 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
476 stMsgData->
paramtype = hostIf_UnsignedIntType;
477 stMsgData->
paramLen =
sizeof(
unsigned int);
482 const uint32_t associatedId = associatedDeviceNum;
485 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Failed in RMH_RemoteNode_GetNodeIdFromAssociatedId for AssociatedId (%d) \n",__FUNCTION__,associatedDeviceNum);
491 if (ret != RMH_SUCCESS) {
492 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%u] RMH_Network_GetNodeIds failed with result %s.\n", __FUNCTION__, __LINE__,
RMH_ResultToString(ret));
496 for (
int nodeId = 0; nodeId < RMH_MAX_MOCA_NODES; nodeId++) {
497 if ((
true ==response.nodePresent[nodeId]) && (nodeId == nodeID)) {