RDK Documentation (Open Sourced RDK Components)
MoCA HAL Generic APIs

Description

Functions

RMH_Handle RMH_Initialize (const RMH_EventCallback eventCB, void *userContext)
 Initialize the RMH library and return a handle to the instance. More...
 
RMH_Result RMH_Destroy (RMH_Handle handle)
 Destroy the instance of RMH library which was created by RMH_Initialize. More...
 
RMH_Result RMH_SetEventCallbacks (RMH_Handle handle, const uint32_t value)
 Set the list of callbacks you wish to receive. More...
 
RMH_Result RMH_GetEventCallbacks (RMH_Handle handle, uint32_t *response)
 Get the list of events for which the client has registered. More...
 
RMH_Result RMH_GetAllAPIs (const RMH_Handle handle, RMH_APIList **apiList)
 Return a list of all APIs which are part of RMH. More...
 
RMH_Result RMH_GetUnimplementedAPIs (const RMH_Handle handle, RMH_APIList **apiList)
 Return a list of all RMH APIs which are unimplemented by the SoC library. More...
 
RMH_Result RMH_GetAPITags (const RMH_Handle handle, RMH_APITagList **apiTags)
 Return the list of all RMH APIs grouped into lists by their tags. More...
 
const char *const RMH_ResultToString (const RMH_Result value)
 Convert RMH_Result to a string. More...
 
const char *const RMH_LinkStatusToString (const RMH_LinkStatus value)
 Convert RMH_LinkStatus to a string. More...
 
const char *const RMH_AdmissionStatusToString (const RMH_AdmissionStatus value)
 Convert RMH_AdmissionStatus to a string. More...
 
const char *const RMH_MoCAResetReasonToString (const RMH_MoCAResetReason value)
 Convert RMH_MoCAResetReason to a string. More...
 
const char *const RMH_SubcarrierProfileToString (const RMH_SubcarrierProfile value)
 Convert RMH_SubcarrierProfile to a string. More...
 
const char *const RMH_PERModeToString (const RMH_PERMode value)
 Convert RMH_PERMode to a string. More...
 
const char *const RMH_MoCAVersionToString (const RMH_MoCAVersion value)
 Convert RMH_MoCAVersion to a string. More...
 
const char *const RMH_PowerModeToString (const uint32_t value, char *responseBuf, const size_t responseBufSize)
 The input value should be a a bitmask of type RMH_PowerMode. More...
 
const char *const RMH_BandToString (const RMH_Band value)
 Convert value to a printable string. More...
 
const char *const RMH_LogLevelToString (const uint32_t value, char *responseBuf, const size_t responseBufSize)
 Return the bitmask value as a string. More...
 
const char *const RMH_EventToString (const uint32_t value, char *responseBuf, const size_t responseBufSize)
 Return the bitmask value as a string. More...
 
const char *const RMH_MacToString (const RMH_MacAddress_t value, char *responseBuf, const size_t responseBufSize)
 Returns the provided MAC address in value as a string. More...
 
const char *const RMH_ACATypeToString (const RMH_ACAType value)
 Convert value to a printable string. More...
 
const char *const RMH_ACAStatusToString (const RMH_ACAStatus value)
 Convert ACA status to a printable string. More...
 
RMH_Result RMH_Interface_GetEnabled (const RMH_Handle handle, bool *response)
 Check if the MoCA interface is enabled at the kernel level. More...
 
RMH_Result RMH_Interface_SetEnabled (const RMH_Handle handle, const bool value)
 Set MoCA interface enabled or disabled at the kernel level. More...
 
RMH_Result RMH_Self_SetEnabledRDK (const RMH_Handle handle)
 Enable MoCA using RDK specific configuration. More...
 
RMH_Result RMH_Self_GetLinkStatus (const RMH_Handle handle, RMH_LinkStatus *status)
 Current operational status of the MoCA interface [mocaIfStatus]. More...
 
RMH_Result RMH_Network_GetAssociatedIds (const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
 Return a list of the associated ID for every node on the network. More...
 
RMH_Result RMH_RemoteNode_GetNodeIdFromAssociatedId (const RMH_Handle handle, const uint32_t associatedId, uint32_t *response)
 Convert an associated Id into a Node Id. More...
 
RMH_Result RMH_RemoteNode_GetAssociatedIdFromNodeId (const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
 Convert a node Id into an associated Id. More...
 
RMH_Result RMH_PQoS_GetMaxEgressBandwidth (const RMH_Handle handle, uint32_t *response)
 Return the node Id with the maximum available bandwidth. More...
 
RMH_Result RMH_Log_CreateDriverFile (const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
 Create a new log file in standard RDK format. More...
 
RMH_Result RMH_Log_PrintStats (const RMH_Handle handle, const char *filename)
 Print a summary of of the Tx/Rx MoCA status. More...
 
RMH_Result RMH_Log_PrintFlows (const RMH_Handle handle, const char *filename)
 Print a generic status summary of the MoCA flows. More...
 
RMH_Result RMH_Log_PrintModulation (const RMH_Handle handle, const char *filename)
 Print a summary of the sub carrier modulation bitloading information. More...
 

Function Documentation

◆ RMH_Initialize()

RMH_Handle RMH_Initialize ( const RMH_EventCallback  eventCB,
void *  userContext 
)

Initialize the RMH library and return a handle to the instance.

This handle will be used in all future communication with the RMH library. This function will fail if the MoCA driver is not properly installed or is not able to operate. Multiple simultaneous instances of RMH_Initialize are supported in single and multiprocess environments.

Parameters
[in]eventCBA pointer to a function which will handle any callbacks from the RMH MoCA library A value of NULL is permitted if you do not wish to receive callbacks.
[in]userContextA pointer to some data that will be passed back with each callback. A value of NULL is permitted if the client requires no context during callbacks.

Definition at line 23 of file librmh_api_no_wrap.c.

◆ RMH_Destroy()

RMH_Result RMH_Destroy ( RMH_Handle  handle)

Destroy the instance of RMH library which was created by RMH_Initialize.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.

◆ RMH_SetEventCallbacks()

RMH_Result RMH_SetEventCallbacks ( RMH_Handle  handle,
const uint32_t  value 
)

Set the list of callbacks you wish to receive.

For each callback a call will be made to eventCB which is provided in the call to RMH_Initialize. By default all callbacks are disabled. Any subsequent calls to this API will overwrite previous calls. For example, if you originally set value to 'RMH_API_PRINT' and later set to LINK_STATUS_CHANGED | MOCA_VERSION_CHANGED' you will stop receiving callbacks for 'RMH_API_PRINT'.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[in]valueA bitmask list of RMH_Event indicating the callbacks to be received.

◆ RMH_GetEventCallbacks()

RMH_Result RMH_GetEventCallbacks ( RMH_Handle  handle,
uint32_t *  response 
)

Get the list of events for which the client has registered.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]responseA bitmask list of RMH_Event indicating the currently enabled callbacks.

◆ RMH_GetAllAPIs()

RMH_Result RMH_GetAllAPIs ( const RMH_Handle  handle,
RMH_APIList **  apiList 
)

Return a list of all APIs which are part of RMH.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[out]apiListOutput list of APIs.

◆ RMH_GetUnimplementedAPIs()

RMH_Result RMH_GetUnimplementedAPIs ( const RMH_Handle  handle,
RMH_APIList **  apiList 
)

Return a list of all RMH APIs which are unimplemented by the SoC library.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[out]apiListOutput list of APIs.

◆ RMH_GetAPITags()

RMH_Result RMH_GetAPITags ( const RMH_Handle  handle,
RMH_APITagList **  apiTags 
)

Return the list of all RMH APIs grouped into lists by their tags.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[out]apiTagsOutput list of Tags and APIs which belong to them.

◆ RMH_ResultToString()

const char* const RMH_ResultToString ( const RMH_Result  value)

Convert RMH_Result to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 84 of file librmh_api_no_wrap.c.

◆ RMH_LinkStatusToString()

const char* const RMH_LinkStatusToString ( const RMH_LinkStatus  value)

Convert RMH_LinkStatus to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 88 of file librmh_api_no_wrap.c.

◆ RMH_AdmissionStatusToString()

const char* const RMH_AdmissionStatusToString ( const RMH_AdmissionStatus  value)

Convert RMH_AdmissionStatus to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 92 of file librmh_api_no_wrap.c.

◆ RMH_MoCAResetReasonToString()

const char* const RMH_MoCAResetReasonToString ( const RMH_MoCAResetReason  value)

Convert RMH_MoCAResetReason to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 108 of file librmh_api_no_wrap.c.

◆ RMH_SubcarrierProfileToString()

const char* const RMH_SubcarrierProfileToString ( const RMH_SubcarrierProfile  value)

Convert RMH_SubcarrierProfile to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 112 of file librmh_api_no_wrap.c.

◆ RMH_PERModeToString()

const char* const RMH_PERModeToString ( const RMH_PERMode  value)

Convert RMH_PERMode to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 116 of file librmh_api_no_wrap.c.

◆ RMH_MoCAVersionToString()

const char* const RMH_MoCAVersionToString ( const RMH_MoCAVersion  value)

Convert RMH_MoCAVersion to a string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 122 of file librmh_api_no_wrap.c.

◆ RMH_PowerModeToString()

const char* const RMH_PowerModeToString ( const uint32_t  value,
char *  responseBuf,
const size_t  responseBufSize 
)

The input value should be a a bitmask of type RMH_PowerMode.

This will be converted to a printable string.

Parameters
[in]valueA bitmask of RMH_PowerMode to be printed as a string.
[out]responseBufA buffer where the log level string will be written.
[in]responseBufSizeThe size in bytes of the buffer <responseBuf>.

Definition at line 162 of file librmh_api_no_wrap.c.

◆ RMH_BandToString()

const char* const RMH_BandToString ( const RMH_Band  value)

Convert value to a printable string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 96 of file librmh_api_no_wrap.c.

◆ RMH_LogLevelToString()

const char* const RMH_LogLevelToString ( const uint32_t  value,
char *  responseBuf,
const size_t  responseBufSize 
)

Return the bitmask value as a string.

The bitmask is expected to contain one or more of RMH_LogLevel.

Parameters
[in]valueA bitmask of RMH_LogLevel to be printed as a string.
[out]responseBufA buffer where the log level string will be written.
[in]responseBufSizeThe size in bytes of the buffer responseBuf.

Definition at line 166 of file librmh_api_no_wrap.c.

◆ RMH_EventToString()

const char* const RMH_EventToString ( const uint32_t  value,
char *  responseBuf,
const size_t  responseBufSize 
)

Return the bitmask value as a string.

The bitmask is expected to contain one or more of RMH_Event.

Parameters
[in]valueA bitmask of RMH_LogLevel to be printed as a string.
[out]responseBufA buffer where the log level string will be written.
[in]responseBufSizeThe size in bytes of the buffer responseBuf.

Definition at line 170 of file librmh_api_no_wrap.c.

◆ RMH_MacToString()

const char* const RMH_MacToString ( const RMH_MacAddress_t  value,
char *  responseBuf,
const size_t  responseBufSize 
)

Returns the provided MAC address in value as a string.

Parameters
[in]valueA byte array MAC address.
[out]responseBufA buffer where the MAC string will be written.
[in]responseBufSizeThe size in bytes of the buffer responseBuf.

Definition at line 174 of file librmh_api_no_wrap.c.

◆ RMH_ACATypeToString()

const char* const RMH_ACATypeToString ( const RMH_ACAType  value)

Convert value to a printable string.

Parameters
[in]valueA byte array MAC address.
[out]responseBufA buffer where the MAC string will be written.
[in]responseBufSizeThe size in bytes of the buffer <responseBuf>.

Definition at line 100 of file librmh_api_no_wrap.c.

◆ RMH_ACAStatusToString()

const char* const RMH_ACAStatusToString ( const RMH_ACAStatus  value)

Convert ACA status to a printable string.

Parameters
[in]valueValue to be printed as a string.

Definition at line 104 of file librmh_api_no_wrap.c.

◆ RMH_Interface_GetEnabled()

RMH_Result RMH_Interface_GetEnabled ( const RMH_Handle  handle,
bool *  response 
)

Check if the MoCA interface is enabled at the kernel level.

Do not confuse with RMH_Self_GetEnabled which checks if the MoCA driver is active.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]responseSet to true if the MoCA interface is enabled at the kernel level. Otherwise set to false.

◆ RMH_Interface_SetEnabled()

RMH_Result RMH_Interface_SetEnabled ( const RMH_Handle  handle,
const bool  value 
)

Set MoCA interface enabled or disabled at the kernel level.

Do not confuse with RMH_Self_SetEnabled which checks if the MoCA driver is active.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]responseSet to true if the MoCA interface is enabled at the kernel level. Otherwise set to false.

◆ RMH_Self_SetEnabledRDK()

RMH_Result RMH_Self_SetEnabledRDK ( const RMH_Handle  handle)

Enable MoCA using RDK specific configuration.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.

◆ RMH_Self_GetLinkStatus()

RMH_Result RMH_Self_GetLinkStatus ( const RMH_Handle  handle,
RMH_LinkStatus *  status 
)

Current operational status of the MoCA interface [mocaIfStatus].

This API combines all known information about the MoCA device, including the driver, MoCA link, interface status, etc to determine if the link is functional. RMH_LINK_STATUS_UP indicates MoCA is ready for use.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]statusThe current link state of MoCA.

◆ RMH_Network_GetAssociatedIds()

RMH_Result RMH_Network_GetAssociatedIds ( const RMH_Handle  handle,
RMH_NodeList_Uint32_t response 
)

Return a list of the associated ID for every node on the network.

This is a one-based index of every remote node on the network. The self node is not included in this list.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]responseThe index is the node Id, if nodePresent is 'true', nodeValue is the associated Id for that node.

◆ RMH_RemoteNode_GetNodeIdFromAssociatedId()

RMH_Result RMH_RemoteNode_GetNodeIdFromAssociatedId ( const RMH_Handle  handle,
const uint32_t  associatedId,
uint32_t *  response 
)

Convert an associated Id into a Node Id.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[in]associatedIdThe associated Id of the node.
[out]responseThe node Id.

◆ RMH_RemoteNode_GetAssociatedIdFromNodeId()

RMH_Result RMH_RemoteNode_GetAssociatedIdFromNodeId ( const RMH_Handle  handle,
const uint32_t  nodeId,
uint32_t *  response 
)

Convert a node Id into an associated Id.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[in]nodeIdThe node Id of the remote node to inspect.
[out]responseThe associated Id of the node.

◆ RMH_PQoS_GetMaxEgressBandwidth()

RMH_Result RMH_PQoS_GetMaxEgressBandwidth ( const RMH_Handle  handle,
uint32_t *  response 
)

Return the node Id with the maximum available bandwidth.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize.
[out]responseThe node Id with the maximum egress bandwidth.

◆ RMH_Log_CreateDriverFile()

RMH_Result RMH_Log_CreateDriverFile ( const RMH_Handle  handle,
char *  responseBuf,
const size_t  responseBufSize 
)

Create a new log file in standard RDK format.

This will:

  1. Locate the file at a writable location in the rootfs.
  2. Name the file using a RDK standard naming convention.
  3. Put any necessary static information at the beginning of the file.
  4. This includes build details and other useful information.
Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[in]responseBufThe file name.
[in]responseBufSizeThe size in bytes of the buffer responseBuf.
Note
This API is for log messages from SoC MoCA driver only. The log level of the RMH libraries should be set with RMH_Log_SetAPILevel.

◆ RMH_Log_PrintStats()

RMH_Result RMH_Log_PrintStats ( const RMH_Handle  handle,
const char *  filename 
)

Print a summary of of the Tx/Rx MoCA status.

If filename is NULL all log messages are printed with RMH_LOG_MESSAGE. If it is not NULL the status will be appended to that file.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[in]filenameThe file name where to write the status. If this is NULL the status will be written to RMH_LOG_MESSAGE.

◆ RMH_Log_PrintFlows()

RMH_Result RMH_Log_PrintFlows ( const RMH_Handle  handle,
const char *  filename 
)

Print a generic status summary of the MoCA flows.

If filename is NULL all log messages are printed with RMH_LOG_MESSAGE with RMH_LOG_MESSAGE. If it is not NULL the status will be appended to that file.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[in]filenameThe file name where to write the status. If this is NULL the status will be written to RMH_LOG_MESSAGE.

◆ RMH_Log_PrintModulation()

RMH_Result RMH_Log_PrintModulation ( const RMH_Handle  handle,
const char *  filename 
)

Print a summary of the sub carrier modulation bitloading information.

Parameters
[in]handleThe RMH handle as returned by RMH_Initialize. NULL is valid for this API.
[in]filenameThe file name where to write the status. If this is NULL the status will be written to RMH_LOG_MESSAGE.