RDK Documentation (Open Sourced RDK Components)
rmh_app_api_handlers.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 #include <errno.h>
20 #include <unistd.h>
21 #include <fcntl.h>
22 #include "rmh_app.h"
23 
24 #define RDK_FILE_PATH_PREVENT_MOCA_START "/opt/sysproperties/mocakillswitchenable"
25 #define RDK_FILE_PATH_PREVENT_MOCA_START2 "/opt/mocakillswitchenable"
26 
27 #undef AS
28 #define AS(x,y) #x,
29 const char * const RMH_LogLevelStr[] = { ENUM_RMH_LogLevel };
30 
31 
32 /***********************************************************
33  * Local API Functions
34  ***********************************************************/
35 RMH_Result RMHApp_DisableDriverDebugLogging(const RMHApp *app) {
36  char fileName[128];
37  RMH_LogLevel logLevel;
38 
39  if (RMH_Log_GetDriverFilename(app->rmh, fileName, sizeof(fileName)) == RMH_SUCCESS) {
40  RMH_PrintMsg("MoCA stopping logging to %s\n", fileName);
41 
42  if (RMH_Log_SetDriverFilename(app->rmh, NULL) != RMH_SUCCESS) {
43  RMH_PrintErr("Failed to stop logging!\n");
44  return RMH_FAILURE;
45  }
46  }
47 
48  if (RMH_Log_GetDriverLevel(app->rmh, &logLevel) != RMH_SUCCESS) {
49  RMH_PrintErr("Failed to get driver log level!\n");
50  return RMH_FAILURE;
51  }
52 
53  if ((~logLevel & RMH_LOG_DEBUG) == RMH_LOG_DEBUG) {
54  RMH_PrintMsg("MoCA driver debug logging already disabled\n");
55  return RMH_SUCCESS;
56  }
57 
58  if (RMH_Log_SetDriverLevel(app->rmh, (logLevel & ~RMH_LOG_DEBUG)) != RMH_SUCCESS) {
59  RMH_PrintErr("Failed to set log level to exclude RMH_LOG_DEFAULT!\n");
60  return RMH_FAILURE;
61  }
62  RMH_PrintMsg("MoCA driver debug logging disabled\n");
63 
64  return RMH_SUCCESS;
65 }
66 
67 RMH_Result RMHApp_EnableDriverDebugLogging(const RMHApp *app) {
68  char logFileName[1024];
69  RMH_LogLevel logLevel;
70 
71  if (RMH_Log_GetDriverFilename(app->rmh, logFileName, sizeof(logFileName)) == RMH_SUCCESS) {
72  RMH_PrintMsg("Logging to '%s'\n", logFileName);
73  }
74 
75  if (RMH_Log_GetDriverLevel(app->rmh, &logLevel) != RMH_SUCCESS) {
76  RMH_PrintErr("Failed to get driver log level!\n");
77  return RMH_FAILURE;
78  }
79 
80  if ((logLevel & RMH_LOG_DEBUG) == RMH_LOG_DEBUG) {
81  RMH_PrintMsg("MoCA driver debug logging already enabled\n");
82  return RMH_SUCCESS;
83  }
84 
85  if (RMH_Log_SetDriverLevel(app->rmh, (logLevel | RMH_LOG_DEBUG)) != RMH_SUCCESS) {
86  RMH_PrintErr("Failed to set driver log level to include RMH_LOG_DEBUG!\n");
87  return RMH_FAILURE;
88  }
89  RMH_PrintMsg("MoCA driver debug logging enabled\n");
90  return RMH_SUCCESS;
91 }
92 
93 RMH_Result RMHApp_DriverLogForever(const RMHApp *app) {
94  char logFileName[1024];
95  RMH_LogLevel logLevel;
96 
97  if (RMH_Log_GetDriverFilename(app->rmh, logFileName, sizeof(logFileName)) == RMH_SUCCESS) {
98  RMH_PrintMsg("Stop logging to '%s'.\n", logFileName);
99  }
100 
101  if (RMH_Log_CreateDriverFile(app->rmh, logFileName, sizeof(logFileName)) != RMH_SUCCESS) {
102  RMH_PrintErr("Unable to create dedicated log file!\n");
103  return RMH_FAILURE;
104  }
105 
106  if (RMH_Log_SetDriverFilename(app->rmh, logFileName) != RMH_SUCCESS) {
107  RMH_PrintErr("Unable to start logging in %s!\n", logFileName);
108  return RMH_FAILURE;
109  }
110 
111  if (RMH_Log_GetDriverLevel(app->rmh, &logLevel) != RMH_SUCCESS) {
112  RMH_PrintErr("Failed to get driver log level!\n");
113  return RMH_FAILURE;
114  }
115 
116  if ((logLevel & RMH_LOG_DEBUG) != RMH_LOG_DEBUG) {
117  if (RMH_Log_SetDriverLevel(app->rmh, (logLevel | RMH_LOG_DEBUG)) != RMH_SUCCESS) {
118  RMH_PrintErr("Failed to set log level to RMH_LOG_DEBUG!\n");
119  return RMH_FAILURE;
120  }
121  }
122  RMH_PrintMsg("Started logging enabled to '%s'.\n", logFileName);
123  return RMH_SUCCESS;
124 }
125 
126 RMH_Result RMHApp_Stop(const RMHApp *app) {
127  bool started;
128 
129  RMH_Result ret=RMH_Self_GetEnabled(app->rmh, &started);
130  if (!started) {
131  RMH_PrintErr("MoCA is already stopped\n");
132  return RMH_INVALID_INTERNAL_STATE;
133  }
134 
135  ret=RMH_Self_SetEnabled(app->rmh, false);
136  if (ret == RMH_SUCCESS) {
137  RMH_PrintMsg("MoCA successfully stopped\n");
138  }
139  return ret;
140 }
141 
142 RMH_Result RMHApp_Start(const RMHApp *app) {
143  bool started = false;
144 
145  RMH_Result ret=RMH_Self_GetEnabled(app->rmh, &started);
146  if (started) {
147  RMH_PrintErr("MoCA is already started\n");
148  return RMH_INVALID_INTERNAL_STATE;
149  }
150 
151  if (access(RDK_FILE_PATH_PREVENT_MOCA_START, F_OK ) != -1) {
152  RMH_PrintWrn("Refusing to start MoCA because the file %s exists!\n", RDK_FILE_PATH_PREVENT_MOCA_START);
153  }
154  else if (access(RDK_FILE_PATH_PREVENT_MOCA_START2, F_OK ) != -1) {
155  RMH_PrintWrn("Refusing to start MoCA because the file %s exists!\n", RDK_FILE_PATH_PREVENT_MOCA_START2);
156  }
157  else {
158  ret=RMH_Self_SetEnabled(app->rmh, true);
159  if (ret == RMH_SUCCESS) {
160  RMH_PrintMsg("MoCA successfully started\n");
161  }
162  }
163 
164  return ret;
165 }
166 
167 /***********************************************************
168  * Input Fuctions
169  ***********************************************************/
170 const char * RMHApp_ReadNextArg(RMHApp *app) {
171  const char *str=NULL;
172  if (app->argc >= 1) {
173  str=app->argv[0];
174  app->argv=&app->argv[1];
175  app->argc--;
176  }
177  return str;
178 }
179 
180 static
181 uint32_t ReadLine(const char *prompt, RMHApp *app, char *buf, const uint32_t bufSize) {
182  const char *input=NULL;
183  if (app->argRunCommand == NULL) {
184  if (prompt)
185  RMH_PrintMsg("%s", prompt);
186  input=fgets(buf, bufSize, stdin);
187  if (input) {
188  buf[strcspn(buf, "\n")] = '\0';
189  }
190  }
191  else {
192  input=RMHApp_ReadNextArg(app);
193  if (input) {
194  strncpy(buf, input, bufSize);
195  buf[bufSize-1]='\0';
196  }
197  }
198 
199  return (input && strlen(input)) ? strlen(input) : 0;
200 }
201 
202 RMH_Result RMHApp_ReadMenuOption(RMHApp *app, uint32_t *value, bool helpSupported, bool *helpRequested) {
203  char input[32];
204  if (ReadLine("Enter your choice (number): ", app, input, sizeof(input))) {
205  char *end;
206  *value=(uint32_t)strtol(input, &end, 10);
207  if (end != input && errno != ERANGE) {
208  if (*end == '\0') {
209  if (helpRequested != NULL) *helpRequested=false;
210  return RMH_SUCCESS;
211  }
212  else if (helpSupported && end[0] == '?' && end[1] == '\0') {
213  if (helpRequested != NULL) *helpRequested=true;
214  return RMH_SUCCESS;
215  }
216  }
217  }
218  RMH_PrintErr("Bad input. Please enter a valid unsigned number\n");
219  return RMH_FAILURE;
220 }
221 
222 static
223 RMH_Result RMHApp_ReadUint32(RMHApp *app, uint32_t *value) {
224  char input[32];
225  if (ReadLine("Enter your choice (number): ", app, input, sizeof(input))) {
226  char *end;
227  *value=(uint32_t)strtol(input, &end, 10);
228  if (end != input && *end == '\0' && errno != ERANGE) {
229  return RMH_SUCCESS;
230  }
231  }
232  RMH_PrintErr("Bad input. Please enter a valid unsigned number\n");
233  return RMH_FAILURE;
234 }
235 
236 static
237 RMH_Result RMHApp_ReadMAC(RMHApp *app, RMH_MacAddress_t* response) {
238  char input[32];
239  char val[6];
240  char dummy;
241  int i;
242  if (ReadLine("Enter MAC address (XX:XX:XX:XX:XX:XX): ", app, input, sizeof(input)) == 17) {
243  if(sscanf( input, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx%c", &val[0], &val[1], &val[2], &val[3], &val[4], &val[5], &dummy) == 6) {
244  for( i = 0; i < 6; i++ ) (*response)[i] = (uint8_t)val[i];
245  return RMH_SUCCESS;
246  }
247  }
248  RMH_PrintErr("Bad input. Please enter a valid MAC address in the for 'XX:XX:XX:XX:XX:XX':\n");
249  return RMH_FAILURE;
250 }
251 
252 static
253 RMH_Result RMHApp_ReadLogLevel(RMHApp *app, uint32_t *value) {
254  char input[32];
255  int i;
256 
257  if (ReadLine("Enter your choice (number or string): ", app, input, sizeof(input))) {
258  char *end;
259  *value=(uint32_t)strtol(input, &end, 10);
260  if (end != input && *end == '\0' && errno != ERANGE &&
261  *value>=0 && *value<sizeof(RMH_LogLevelStr)/sizeof(RMH_LogLevelStr[0])) {
262  return RMH_SUCCESS;
263  }
264  for(i=0; i!=sizeof(RMH_LogLevelStr)/sizeof(RMH_LogLevelStr[0]); i++) {
265  if (strcasecmp(input, RMH_LogLevelStr[i]) == 0) {
266  *value=i;
267  return RMH_SUCCESS;
268  }
269  }
270  }
271  RMH_PrintErr("Bad input. Please enter a valid number or log level\n");
272  return RMH_FAILURE;
273 }
274 
275 static
276 RMH_Result RMHApp_ReadInt32(RMHApp *app, int32_t *value) {
277  char input[32];
278  if (ReadLine("Enter your choice (number): ", app, input, sizeof(input))) {
279  char *end;
280  *value=(uint32_t)strtol(input, &end, 10);
281  if (end != input && *end == '\0' && errno != ERANGE) {
282  return RMH_SUCCESS;
283  }
284  }
285  RMH_PrintErr("Bad input. Please enter a valid signed number\n");
286  return RMH_FAILURE;
287 }
288 
289 static
290 RMH_Result RMHApp_ReadUint32Hex(RMHApp *app, uint32_t *value) {
291  char input[32];
292  if (ReadLine("Enter your choice (Hex): ", app, input, sizeof(input))) {
293  char *end;
294  *value=(uint32_t)strtol(input, &end, 0);
295  if (end != input && *end == '\0' && errno != ERANGE) {
296  return RMH_SUCCESS;
297  }
298  }
299  RMH_PrintErr("Bad input. Please enter a valid unsigned number\n");
300  return RMH_FAILURE;
301 }
302 
303 static
304 RMH_Result RMHApp_ReadBool(RMHApp *app, bool *value) {
305  char input[32];
306  if (ReadLine("Enter your choice (TRUE,FALSE or 1,0): ", app, input, sizeof(input))) {
307  if ((strcmp(input, "1") == 0) || (strcasecmp(input, "TRUE") == 0)) {
308  *value=1;
309  return RMH_SUCCESS;
310  }
311  else if ((strcmp(input, "0") == 0) || (strcasecmp(input, "FALSE") == 0)) {
312  *value=0;
313  return RMH_SUCCESS;
314  }
315  }
316  RMH_PrintErr("Bad input. Please use only TRUE,FALSE or 1,0\n");
317  return RMH_FAILURE;
318 }
319 
320 static
321 RMH_Result RMHApp_ReadString(RMHApp *app, char *buf, const uint32_t bufSize) {
322  if (ReadLine("Enter your choice: ", app, buf, bufSize)) {
323  return RMH_SUCCESS;
324  }
325  RMH_PrintErr("Bad input. Please provide a valid string.\n");
326  return RMH_FAILURE;
327 }
328 
329 static
330 RMH_Result RMHApp_ReadACAType(RMHApp *app, RMH_ACAType *value) {
331  char input[32];
332  char choices[128];
333  snprintf(choices, sizeof(choices)/sizeof(choices[0]), "Enter your choice [EVM(%u),QUIET(%u)]: ", RMH_ACA_TYPE_EVM, RMH_ACA_TYPE_QUIET);
334 
335  if (ReadLine(choices, app, input, sizeof(input))) {
336  int inputAsInt=(int)(input[0] - '0');
337  if ((inputAsInt == RMH_ACA_TYPE_EVM) || (strcasecmp(input, "RMH_ACA_TYPE_EVM") == 0) || (strcasecmp(input, "EVM") == 0)) {
338  *value=RMH_ACA_TYPE_EVM;
339  return RMH_SUCCESS;
340  }
341  else if ((inputAsInt == RMH_ACA_TYPE_QUIET) || (strcasecmp(input, "RMH_ACA_TYPE_QUIET") == 0) || (strcasecmp(input, "QUIET") == 0)) {
342  *value=RMH_ACA_TYPE_QUIET;
343  return RMH_SUCCESS;
344  }
345  }
346  RMH_PrintErr("Bad input\n");
347  return RMH_FAILURE;
348 }
349 
350 static
351 RMH_Result RMHApp_ReadPowerMode(RMHApp *app, RMH_PowerMode *value) {
352  char input[32];
353  char choices[128];
354  snprintf(choices, sizeof(choices)/sizeof(choices[0]), "Enter your choice [ACTIVE(%u),IDLE(%u),STANDBY(%u),SLEEP(%u)]: ", RMH_POWER_MODE_M0_ACTIVE, RMH_POWER_MODE_M1_IDLE, RMH_POWER_MODE_M2_STANDBY, RMH_POWER_MODE_M3_SLEEP);
355  if (ReadLine(choices, app, input, sizeof(input))) {
356  int inputAsInt=(int)(input[0] - '0');
357  if ((inputAsInt == RMH_POWER_MODE_M0_ACTIVE) || (strcasecmp(input, "RMH_POWER_MODE_M0_ACTIVE") == 0) || (strcasecmp(input, "ACTIVE") == 0)) {
358  *value=RMH_POWER_MODE_M0_ACTIVE;
359  return RMH_SUCCESS;
360  }
361  else if ((inputAsInt == RMH_POWER_MODE_M1_IDLE) || (strcasecmp(input, "RMH_POWER_MODE_M1_IDLE") == 0) || (strcasecmp(input, "IDLE") == 0)) {
362  *value=RMH_POWER_MODE_M1_IDLE;
363  return RMH_SUCCESS;
364  }
365  else if ((inputAsInt == RMH_POWER_MODE_M2_STANDBY) || (strcasecmp(input, "RMH_POWER_MODE_M2_STANDBY") == 0) || (strcasecmp(input, "STANDBY") == 0)) {
366  *value=RMH_POWER_MODE_M2_STANDBY;
367  return RMH_SUCCESS;
368  }
369  else if ((inputAsInt == RMH_POWER_MODE_M3_SLEEP) || (strcasecmp(input, "RMH_POWER_MODE_M3_SLEEP") == 0) || (strcasecmp(input, "SLEEP") == 0)) {
370  *value=RMH_POWER_MODE_M3_SLEEP;
371  return RMH_SUCCESS;
372  }
373  }
374  RMH_PrintErr("Bad input\n");
375  return RMH_FAILURE;
376 }
377 
378 static
379 RMH_Result RMHApp_ReadPERMode(RMHApp *app, RMH_PERMode *value) {
380  char input[32];
381  if (ReadLine("Enter your choice (LEGACY,NPER,VLPER or 0,1,2): ", app, input, sizeof(input))) {
382  if ((strcmp(input, "0") == 0) || (strcasecmp(input, "RMH_PER_MODE_LEGACY") == 0) || (strcasecmp(input, "LEGACY") == 0)) {
383  *value=RMH_PER_MODE_LEGACY;
384  return RMH_SUCCESS;
385  }
386  else if ((strcmp(input, "1") == 0) || (strcasecmp(input, "RMH_PER_MODE_NOMINAL") == 0) || (strcasecmp(input, "NPER") == 0)) {
387  *value=RMH_PER_MODE_NOMINAL;
388  return RMH_SUCCESS;
389  }
390  else if ((strcmp(input, "2") == 0) || (strcasecmp(input, "RMH_PER_MODE_VERY_LOW") == 0) || (strcasecmp(input, "VLPER") == 0)) {
391  *value=RMH_PER_MODE_VERY_LOW;
392  return RMH_SUCCESS;
393  }
394  }
395  RMH_PrintErr("Bad input. Please use only LEGACY,NPER,VLPER or 0,1,2\n");
396  return RMH_FAILURE;
397 }
398 
399 
400 /***********************************************************
401  * API Handler Functions (Output Functions)
402  ***********************************************************/
403 static
404 RMH_Result RMHApp__OUT_UINT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, uint32_t* response)) {
405  uint32_t response=0;
406  RMH_Result ret = api(app->rmh, &response);
407  if (ret == RMH_SUCCESS) {
408  RMH_PrintMsg("%u\n", response);
409  }
410  return ret;
411 }
412 
413 static
414 RMH_Result RMHApp__OUT_UINT32_HEX(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, uint32_t* response)) {
415  uint32_t response=0;
416  RMH_Result ret = api(app->rmh, &response);
417  if (ret == RMH_SUCCESS) {
418  RMH_PrintMsg("0x%08x\n", response);
419  }
420  return ret;
421 }
422 
423 static
424 RMH_Result RMHApp__OUT_INT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, int32_t* response)) {
425  int32_t response=0;
426  RMH_Result ret = api(app->rmh, &response);
427  if (ret == RMH_SUCCESS) {
428  RMH_PrintMsg("%d\n", response);
429  }
430  return ret;
431 }
432 
433 static
434 RMH_Result RMHApp__OUT_UINT32_ARRAY(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, uint32_t* responseBuf, const size_t responseBufSize, size_t* responseBufUsed)) {
435  uint32_t responseBuf[256];
436  size_t responseBufUsed;
437  int i;
438 
439  RMH_Result ret = api(app->rmh, responseBuf, sizeof(responseBuf)/sizeof(responseBuf[0]), &responseBufUsed);
440  if (ret == RMH_SUCCESS) {
441  for (i=0; i < responseBufUsed; i++) {
442  RMH_PrintMsg("[%02u] %u\n", i, responseBuf[i]);
443  }
444  }
445  return ret;
446 }
447 
448 static
449 RMH_Result RMHApp__OUT_MAC_ARRAY(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_MacAddress_t* responseBuf, const size_t responseBufSize, size_t* responseBufUsed)) {
450  RMH_MacAddress_t responseBuf[32];
451  size_t responseBufUsed;
452  char macStr[24];
453  int i;
454 
455  RMH_Result ret = api(app->rmh, responseBuf, sizeof(responseBuf)/sizeof(responseBuf[0]), &responseBufUsed);
456  if (ret == RMH_SUCCESS) {
457  for (i=0; i < responseBufUsed; i++) {
458  RMH_PrintMsg("[%02u] %s\n", i, RMH_MacToString(responseBuf[i], macStr, sizeof(macStr)/sizeof(macStr[0])));
459  }
460  }
461  return ret;
462 }
463 
464 static
465 RMH_Result RMHApp__IN_UINT32_OUT_UINT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, uint32_t* response)) {
466  uint32_t response=0;
467  uint32_t nodeId;
468  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
469  if (ret == RMH_SUCCESS) {
470  ret = api(app->rmh, nodeId, &response);
471  if (ret == RMH_SUCCESS) {
472  RMH_PrintMsg("%u\n", response);
473  }
474  }
475  return ret;
476 }
477 
478 static
479 RMH_Result RMHApp__IN_UINT32_IN_UINT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, const uint32_t value)) {
480  uint32_t nodeId, value;
481  RMH_PrintMsg("Enter a node ID first, then the desired value\n", value, nodeId);
482  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
483  if (ret == RMH_SUCCESS) {
484  RMH_Result ret=RMHApp_ReadUint32(app, &value);
485  if (ret == RMH_SUCCESS) {
486  ret = api(app->rmh, nodeId, value);
487  if (ret == RMH_SUCCESS) {
488  RMH_PrintMsg("Success passing %u for node id %u\n", value, nodeId);
489  }
490  }
491  }
492  return ret;
493 }
494 
495 static
496 RMH_Result RMHApp__IN_UINT32_OUT_INT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, int32_t* response)) {
497  int32_t response=0;
498  uint32_t nodeId;
499  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
500  if (ret == RMH_SUCCESS) {
501  ret = api(app->rmh, nodeId, &response);
502  if (ret == RMH_SUCCESS) {
503  RMH_PrintMsg("%d\n", response);
504  }
505  }
506  return ret;
507 }
508 
509 static
510 RMH_Result RMHApp__IN_UINT32_OUT_FLOAT(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, float* response)) {
511  float response=0;
512  uint32_t nodeId;
513  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
514  if (ret == RMH_SUCCESS) {
515  ret = api(app->rmh, nodeId, &response);
516  if (ret == RMH_SUCCESS) {
517  RMH_PrintMsg("%.03f\n", response);
518  }
519  }
520  return ret;
521 }
522 
523 static
524 RMH_Result RMHApp__OUT_BOOL(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, bool* response)) {
525  bool response=0;
526  RMH_Result ret = api(app->rmh, &response);
527  if (ret == RMH_SUCCESS) {
528  RMH_PrintMsg("%s\n", response ? "TRUE" : "FALSE");
529  }
530  return ret;
531 }
532 
533 static
534 RMH_Result RMHApp__IN_UINT32_OUT_BOOL(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, bool* response)) {
535  bool response=0;
536  uint32_t nodeId;
537  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
538  if (ret == RMH_SUCCESS) {
539  ret = api(app->rmh, nodeId, &response);
540  if (ret == RMH_SUCCESS) {
541  RMH_PrintMsg("%s\n", response ? "TRUE" : "FALSE");
542  }
543  }
544  return ret;
545 }
546 
547 static
548 RMH_Result RMHApp__OUT_STRING(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, char* responseBuf, const size_t responseBufSize)) {
549  char response[256];
550  RMH_Result ret = api(app->rmh, response, sizeof(response));
551  if (ret == RMH_SUCCESS) {
552  RMH_PrintMsg("%s\n", response);
553  }
554  return ret;
555 }
556 
557 static
558 RMH_Result RMHApp__OUT_UINT8_ARRAY(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, uint8_t* responseArray, const size_t responseArraySize, size_t* responseArrayUsed)) {
559  uint8_t responseBuf[1024];
560  size_t responseBufUsed;
561  int i,j;
562 
563  RMH_Result ret = api(app->rmh, responseBuf, sizeof(responseBuf)/sizeof(responseBuf[0]), &responseBufUsed);
564  if (ret == RMH_SUCCESS) {
565  for (i=0; i < responseBufUsed;) {
566  RMH_PrintMsg("[%04u] ", i);
567  for (j=0; j < 16 && i < responseBufUsed; j++,i++) {
568  if (j == 7) {
569  RMH_PrintMsg("%02u ", responseBuf[i]);
570  }
571  else {
572  RMH_PrintMsg("%02u ", responseBuf[i]);
573  }
574  }
575  RMH_PrintMsg("\n");
576  }
577  }
578  return ret;
579 }
580 
581 static
582 RMH_Result RMHApp__IN_UINT32_OUT_STRING(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, char* responseBuf, const size_t responseBufSize)) {
583  char response[256];
584  uint32_t nodeId;
585  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
586  if (ret == RMH_SUCCESS) {
587  ret = api(app->rmh, nodeId, response, sizeof(response));
588  if (ret == RMH_SUCCESS) {
589  RMH_PrintMsg("%s\n", response);
590  }
591  }
592  return ret;
593 }
594 
595 static
596 RMH_Result RMHApp__IN_RMH_ENUM(RMHApp *app, const char* const (*api)(const RMH_Result)) {
597  RMH_Result enumIndex;
598  RMH_Result ret=RMHApp_ReadUint32(app, (uint32_t*)&enumIndex);
599  if (ret == RMH_SUCCESS) {
600  const char * str = api(enumIndex);
601  if (str) {
602  RMH_PrintMsg("%s\n", str);
603  }
604  }
605  return ret;
606 }
607 
608 static
609 RMH_Result RMHApp__OUT_MAC(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_MacAddress_t* response)) {
610  RMH_MacAddress_t response;
611  RMH_Result ret = api(app->rmh, &response);
612  if (ret == RMH_SUCCESS) {
613  char mac[24];
614  RMH_PrintMsg("%s\n", RMH_MacToString(response, mac, sizeof(mac)/sizeof(mac[0])));
615  }
616  return ret;
617 }
618 
619 static
620 RMH_Result RMHApp__IN_MAC(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const RMH_MacAddress_t value)) {
621  RMH_MacAddress_t mac;
622  RMH_Result ret=RMHApp_ReadMAC(app, &mac);
623  if (ret == RMH_SUCCESS) {
624  ret = api(app->rmh, mac);
625  if (ret == RMH_SUCCESS) {
626  char macStr[24];
627  RMH_PrintMsg("Success passing to %s\n", RMH_MacToString(mac, macStr, sizeof(macStr)/sizeof(macStr[0])));
628  }
629  }
630  return ret;
631 }
632 
633 static
634 RMH_Result RMHApp__IN_MAC_OUT_UINT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t* response)) {
635  RMH_MacAddress_t mac;
636  uint32_t response;
637 
638  RMH_Result ret=RMHApp_ReadMAC(app, &mac);
639  if (ret == RMH_SUCCESS) {
640  ret = api(app->rmh, mac, &response);
641  if (ret == RMH_SUCCESS) {
642  RMH_PrintMsg("%u\n", response);
643  }
644  }
645  return ret;
646 }
647 
648 static
649 RMH_Result RMHApp__IN_MAC_OUT_MAC(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t* response)) {
650  RMH_MacAddress_t mac;
651  RMH_MacAddress_t response;
652 
653  RMH_Result ret=RMHApp_ReadMAC(app, &mac);
654  if (ret == RMH_SUCCESS) {
655  ret = api(app->rmh, mac, &response);
656  if (ret == RMH_SUCCESS) {
657  char mac[24];
658  RMH_PrintMsg("%s\n", RMH_MacToString(response, mac, sizeof(mac)/sizeof(mac[0])));
659  }
660  }
661  return ret;
662 }
663 
664 static
665 RMH_Result RMHApp__IN_UINT32_OUT_MAC(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, RMH_MacAddress_t* response)) {
666  RMH_MacAddress_t response;
667  uint32_t nodeId;
668  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
669  if (ret == RMH_SUCCESS) {
670  ret = api(app->rmh, nodeId, &response);
671  if (ret == RMH_SUCCESS) {
672  char macStr[24];
673  RMH_PrintMsg("%s\n", RMH_MacToString(response, macStr, sizeof(macStr)/sizeof(macStr[0])));
674  }
675  }
676  return ret;
677 }
678 
679 static
680 RMH_Result RMHApp__OUT_POWER_MODE(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_PowerMode* response)) {
681  RMH_PowerMode response=0;
682  RMH_Result ret = api(app->rmh, &response);
683  if (ret == RMH_SUCCESS) {
684  char outStr[128];
685  RMH_PrintMsg("%s\n", RMH_PowerModeToString(response, outStr, sizeof(outStr)));
686  }
687  return ret;
688 }
689 
690 static
691 RMH_Result RMHApp__IN_POWER_MODE(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const RMH_PowerMode response)) {
692  RMH_PowerMode mode;
693  RMH_Result ret=RMHApp_ReadPowerMode(app, &mode);
694  if (ret == RMH_SUCCESS) {
695  RMH_Result ret = api(app->rmh, mode);
696  if (ret == RMH_SUCCESS) {
697  char outStr[128];
698  RMH_PrintMsg("Success setting power mode to %s\n", RMH_PowerModeToString(mode, outStr, sizeof(outStr)));
699  }
700  else {
701  RMH_PrintMsg("Failed with error %s\n", RMH_ResultToString(ret));
702  }
703  }
704  return ret;
705 }
706 
707 static
708 RMH_Result RMHApp__OUT_BAND(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_Band* response)) {
709  RMH_Band response=0;
710  RMH_Result ret = api(app->rmh, &response);
711  if (ret == RMH_SUCCESS) {
712  RMH_PrintMsg("%s\n", RMH_BandToString(response));
713  }
714  return ret;
715 }
716 
717 static
718 RMH_Result RMHApp__OUT_LINK_STATUS(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_LinkStatus* response)) {
719  RMH_LinkStatus response=0;
720  RMH_Result ret = api(app->rmh, &response);
721  if (ret == RMH_SUCCESS) {
722  RMH_PrintMsg("%s\n", RMH_LinkStatusToString(response));
723  }
724  return ret;
725 }
726 
727 static
728 RMH_Result RMHApp__OUT_MOCA_VERSION(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_MoCAVersion* response)) {
729  RMH_MoCAVersion response=0;
730  RMH_Result ret = api(app->rmh, &response);
731  if (ret == RMH_SUCCESS) {
732  RMH_PrintMsg("%s\n", RMH_MoCAVersionToString(response));
733  }
734  return ret;
735 }
736 
737 static
738 RMH_Result RMHApp__IN_UINT32_OUT_MOCA_VERSION(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, RMH_MoCAVersion* response)) {
739  RMH_MoCAVersion response=0;
740  uint32_t nodeId;
741  RMH_Result ret=RMHApp_ReadUint32(app, &nodeId);
742  if (ret == RMH_SUCCESS) {
743  ret = api(app->rmh, nodeId, &response);
744  if (ret == RMH_SUCCESS) {
745  RMH_PrintMsg("%s\n", RMH_MoCAVersionToString(response));
746  }
747  }
748  return ret;
749 }
750 
751 static
752 RMH_Result RMHApp__OUT_LOGLEVEL(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_LogLevel* response)) {
753  RMH_LogLevel response=0;
754  RMH_Result ret = api(app->rmh, &response);
755  if (ret == RMH_SUCCESS) {
756  char outStr[128];
757  RMH_PrintMsg("%s\n", RMH_LogLevelToString(response, outStr, sizeof(outStr)));
758  }
759  return ret;
760 }
761 
762 static
763 RMH_Result RMHApp__OUT_UINT32_NODELIST(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_NodeList_Uint32_t* response)) {
764  RMH_NodeList_Uint32_t response;
765 
766  RMH_Result ret = api(app->rmh, &response);
767  if (ret == RMH_SUCCESS) {
768  int i;
769  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
770  if (response.nodePresent[i]) {
771  RMH_PrintMsg("NodeId:%u -- %u\n", i, response.nodeValue[i]);
772  }
773  }
774  }
775  return ret;
776 }
777 
778 static
779 RMH_Result RMHApp__OUT_UINT32_NODEMESH(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_NodeMesh_Uint32_t* response)) {
780  RMH_NodeMesh_Uint32_t response;
781  int i,j;
782 
783  RMH_Result ret = api(app->rmh, &response);
784  if (ret == RMH_SUCCESS) {
785  char phyStrBegin[256];
786  char *phyStrEnd=phyStrBegin+sizeof(phyStrBegin);
787  char *phyStr=phyStrBegin;
788 
789  phyStr+=snprintf(phyStr, phyStrEnd-phyStr, " ");
790  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
791  if (response.nodePresent[i]) {
792  phyStr+=snprintf(phyStr, phyStrEnd-phyStr, " %02u ", i);
793  }
794  }
795  RMH_PrintMsg("%s\n", phyStrBegin);
796 
797  for (i = 0; i < RMH_MAX_MOCA_NODES; i++) {
798  if (response.nodePresent[i]) {
799  char *phyStr=phyStrBegin;
800  RMH_NodeList_Uint32_t *nl = &response.nodeValue[i];
801  phyStr+=snprintf(phyStr, phyStrEnd-phyStr, "%02u: ", i);
802  for (j = 0; j < RMH_MAX_MOCA_NODES; j++) {
803  if (i == j) {
804  phyStr+=snprintf(phyStr, phyStrEnd-phyStr, " -- ");
805  } else if (response.nodePresent[j]) {
806  phyStr+=snprintf(phyStr, phyStrEnd-phyStr, "%04u ", nl->nodeValue[j]);
807  }
808  }
809  RMH_PrintMsg("%s\n", phyStrBegin);
810  }
811  }
812  }
813  else {
814  RMH_PrintMsg("%s\n", RMH_ResultToString(ret));
815  }
816 
817  return ret;
818 }
819 
820 static
821 RMH_Result RMHApp__IN_BOOL (RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const bool value)) {
822  bool value;
823  RMH_Result ret=RMHApp_ReadBool(app, &value);
824  if (ret == RMH_SUCCESS) {
825  ret = api(app->rmh, value);
826  if (ret == RMH_SUCCESS) {
827  RMH_PrintMsg("Success passing %s\n", value ? "TRUE" : "FALSE");
828  }
829  }
830  return ret;
831 }
832 
833 static
834 RMH_Result RMHApp__IN_UINT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t value)) {
835  uint32_t value;
836  RMH_Result ret=RMHApp_ReadUint32(app, &value);
837  if (ret == RMH_SUCCESS) {
838  ret = api(app->rmh, value);
839  if (ret == RMH_SUCCESS) {
840  RMH_PrintMsg("Success passing %u\n", value);
841  }
842  }
843  return ret;
844 }
845 
846 static
847 RMH_Result RMHApp__IN_INT32(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const int32_t value)) {
848  int32_t value;
849  RMH_Result ret=RMHApp_ReadInt32(app, &value);
850  if (ret == RMH_SUCCESS) {
851  ret = api(app->rmh, value);
852  if (ret == RMH_SUCCESS) {
853  RMH_PrintMsg("Success passing %d\n", value);
854  }
855  }
856  return ret;
857 }
858 
859 static
860 RMH_Result RMHApp__IN_UINT32_HEX(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t value)) {
861  uint32_t value;
862  RMH_Result ret=RMHApp_ReadUint32Hex(app, &value);
863  if (ret == RMH_SUCCESS) {
864  ret = api(app->rmh, value);
865  if (ret == RMH_SUCCESS) {
866  RMH_PrintMsg("Success passing 0x%08x\n", value);
867  }
868  }
869  return ret;
870 }
871 
872 static
873 RMH_Result RMHApp__IN_STRING(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const char* value)) {
874  char input[256];
875  RMH_Result ret=RMHApp_ReadString(app, input, sizeof(input));
876  if (ret == RMH_SUCCESS) {
877  ret = api(app->rmh, input);
878  if (ret == RMH_SUCCESS) {
879  RMH_PrintMsg("Success passing %s\n", input);
880  }
881  }
882  return ret;
883 }
884 
885 static
886 RMH_Result RMHApp__IN_LOGLEVEL(RMHApp *app, RMH_Result (*api)(RMH_Handle rmh, const RMH_LogLevel response)) {
887  RMH_LogLevel value;
888  int i;
889 
890  for (i=0; (app->argRunCommand==NULL) && i != sizeof(RMH_LogLevelStr)/sizeof(RMH_LogLevelStr[0]); i++ ) {
891  RMH_PrintMsg("%d. %s\n", i, RMH_LogLevelStr[i]);
892  }
893  RMH_Result ret=RMHApp_ReadLogLevel(app, &value);
894  if (ret == RMH_SUCCESS) {
895  ret = api(app->rmh, value);
896  if (ret == RMH_SUCCESS) {
897  RMH_PrintMsg("Success passing %u\n", value);
898  }
899  }
900  return ret;
901 }
902 
903 static
904 RMH_Result RMHApp__PRINT_STATUS(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const char*filename)) {
905  RMH_Result ret = api(app->rmh, NULL);
906  if (ret == RMH_SUCCESS) {
907  RMH_PrintMsg("Success\n");
908  }
909  return ret;
910 }
911 
912 static
913 RMH_Result RMHApp__HANDLE_ONLY(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle)) {
914  RMH_Result ret = api(app->rmh);
915  if (ret == RMH_SUCCESS) {
916  RMH_PrintMsg("Success\n");
917  }
918  return ret;
919 }
920 
921 static
922 RMH_Result RMHApp__LOCAL_HANDLE_ONLY(const RMHApp *app, RMH_Result (*api)(const RMHApp* app)) {
923  return api(app);
924 }
925 
926 static
927 RMH_Result RMHApp__GET_TABOO(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, uint32_t* start, uint32_t* mask)) {
928  uint32_t start=0;
929  uint32_t mask=0;
930  RMH_Result ret = api(app->rmh, &start, &mask);
931  if (ret == RMH_SUCCESS) {
932  RMH_PrintMsg("Start channel: %u\n", start);
933  RMH_PrintMsg("Channel Mask: 0x%08x\n", mask);
934  }
935  return ret;
936 }
937 
938 static
939 RMH_Result RMHApp__SET_TABOO(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t start, const uint32_t mask)) {
940  uint32_t start=0;
941  uint32_t mask=0;
942 
943  RMH_Result ret=RMHApp_ReadUint32(app, &start);
944  if (ret == RMH_SUCCESS) {
945  RMH_Result ret=RMHApp_ReadUint32Hex(app, &mask);
946  if (ret == RMH_SUCCESS) {
947  ret = api(app->rmh, start, mask);
948  if (ret == RMH_SUCCESS) {
949  RMH_PrintMsg("Success setting Start:%u Channel Mask:0x%08x\n", start, mask);
950  }
951  }
952  }
953 
954  return ret;
955 }
956 
957 static
958 RMH_Result RMHApp__OUT_ACA_TYPE(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_ACAType* response)) {
959  RMH_ACAType response=0;
960  RMH_Result ret = api(app->rmh, &response);
961  if (ret == RMH_SUCCESS) {
962  RMH_PrintMsg("%s\n", RMH_ACATypeToString(response));
963  }
964  return ret;
965 }
966 
967 static
968 RMH_Result RMHApp__OUT_ACA_STATUS(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_ACAStatus* response)) {
969  RMH_ACAStatus response;
970  RMH_Result ret = api(app->rmh, &response);
971  if (ret == RMH_SUCCESS) {
972  RMH_PrintMsg("%s\n", RMH_ACAStatusToString(response));
973  }
974  return ret;
975 }
976 
977 static
978 RMH_Result RMHApp__REQUEST_ACA(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t channelNum, const uint32_t sourceNodeId, const uint32_t destinationNodeMask, const RMH_ACAType type)) {
979  uint32_t channelNum;
980  uint32_t sourceNodeId;
981  uint32_t destinationNodeMask;
982  RMH_ACAType type;
983  RMH_Result ret;
984 
985  ret=RMHApp_ReadUint32(app, &channelNum);
986  if (ret != RMH_SUCCESS) {
987  RMH_PrintErr("Failed reading channel number\n");
988  return ret;
989  }
990 
991  ret=RMHApp_ReadUint32(app, &sourceNodeId);
992  if (ret != RMH_SUCCESS) {
993  RMH_PrintErr("Failed reading source node id\n");
994  return ret;
995  }
996 
997  ret=RMHApp_ReadUint32Hex(app, &destinationNodeMask);
998  if (ret != RMH_SUCCESS) {
999  RMH_PrintErr("Failed reading destination node mask\n");
1000  return ret;
1001  }
1002 
1003  ret=RMHApp_ReadACAType(app, &type);
1004  if (ret != RMH_SUCCESS) {
1005  RMH_PrintErr("Failed reading ACA type\n");
1006  return ret;
1007  }
1008 
1009  ret = api(app->rmh, channelNum, sourceNodeId, destinationNodeMask, type);
1010  if (ret != RMH_SUCCESS) {
1011  RMH_PrintErr("Failed in ACA request\n");
1012  return ret;
1013  }
1014 
1015  RMH_ACAStatus status;
1016  ret = RMH_ACA_GetStatus(app->rmh, &status);
1017  if (ret == RMH_SUCCESS) {
1018  RMH_PrintMsg("RMH_ACA_GetStatus: %s\n", RMH_ACAStatusToString(status));
1019  }
1020 
1021  int32_t txPower;
1022  ret = RMH_ACA_GetTotalRxPower(app->rmh, &txPower);
1023  if (ret == RMH_SUCCESS) {
1024  RMH_PrintMsg("RMH_ACA_GetTotalRxPower: %d\n", txPower);
1025  }
1026 
1027  RMH_PrintMsg("RMH_ACA_GetPowerProfile:\n");
1028  RMHApp__OUT_UINT8_ARRAY(app, RMH_ACA_GetPowerProfile);
1029  return RMH_SUCCESS;
1030  }
1031 
1032 static
1033 RMH_Result RMHApp__MoCA_RESET(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeMask, const uint32_t sleepTime)) {
1034  uint32_t nodeMask;
1035  uint32_t sleepTime;
1036  RMH_Result ret;
1037 
1038  ret=RMHApp_ReadUint32Hex(app, &nodeMask);
1039  if (ret != RMH_SUCCESS) {
1040  RMH_PrintErr("Failed reading node mask\n");
1041  return ret;
1042  }
1043 
1044  ret=RMHApp_ReadUint32(app, &sleepTime);
1045  if (ret != RMH_SUCCESS) {
1046  RMH_PrintErr("Failed reading sleep time\n");
1047  return ret;
1048  }
1049 
1050  ret = api(app->rmh, nodeMask, sleepTime);
1051  if (ret != RMH_SUCCESS) {
1052  RMH_PrintErr("Failed in reset request\n");
1053  return ret;
1054  }
1055 
1056  return ret;
1057 }
1058 
1059 static
1060 RMH_Result RMHApp__OUT_RESET_REASON(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, RMH_MoCAResetReason* response)) {
1061  RMH_MoCAResetReason response;
1062  RMH_Result ret = api(app->rmh, &response);
1063  if (ret == RMH_SUCCESS) {
1064  RMH_PrintMsg("%s\n", RMH_MoCAResetReasonToString(response));
1065  }
1066  return ret;
1067 }
1068 
1069 static
1070 void PrintModulation(RMHApp *app, uint32_t start, uint32_t end, RMH_SubcarrierProfile* array, size_t arraySize) {
1071  int i,j;
1072  int offset = start < end ? 1 : -1;
1073  for (i=start; i < arraySize;) {
1074  RMH_PrintMsg("[%3u-%3u] ", i, i+(31*offset));
1075  for (j=0; j<32 && i < arraySize; j++,i+=offset) {
1076  RMH_PrintMsg("%X", array[i]);
1077  if (i == end) {
1078  RMH_PrintMsg("\n");
1079  return;
1080  }
1081  }
1082  RMH_PrintMsg("\n");
1083  }
1084 }
1085 
1086 static
1087 RMH_Result RMHApp__OUT_MODULATION(RMHApp *app, RMH_Result (*api)(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile* responseArray, const size_t responseArraySize, size_t* responseArrayUsed)) {
1088  uint32_t nodeId;
1089  RMH_SubcarrierProfile responseBuf[512];
1090  size_t responseBufUsed;
1091  RMH_Result ret;
1092  RMH_MoCAVersion response;
1093  RMH_PERMode perMode;
1094 
1095  ret=RMHApp_ReadUint32(app, &nodeId);
1096  if (ret != RMH_SUCCESS) {
1097  RMH_PrintErr("Failed reading node Id\n");
1098  return ret;
1099  }
1100 
1101  ret=RMHApp_ReadPERMode(app, &perMode);
1102  if (ret != RMH_SUCCESS) {
1103  RMH_PrintErr("Failed reading channel type\n");
1104  return ret;
1105  }
1106 
1107  ret = api(app->rmh, nodeId, perMode, responseBuf, sizeof(responseBuf)/sizeof(responseBuf[0]), &responseBufUsed);
1108  if (ret != RMH_SUCCESS) {
1109  return ret;
1110  }
1111 
1112  ret = RMH_RemoteNode_GetActiveMoCAVersion(app->rmh, nodeId, &response);
1113  if (ret != RMH_SUCCESS) {
1114  return ret;
1115  }
1116  switch (response) {
1117  case RMH_MOCA_VERSION_10:
1118  case RMH_MOCA_VERSION_11:
1119  PrintModulation(app, 127, 0, responseBuf, responseBufUsed);
1120  PrintModulation(app, 255, 128, responseBuf, responseBufUsed);
1121  break;
1122  case RMH_MOCA_VERSION_20:
1123  PrintModulation(app, 256, 511, responseBuf, responseBufUsed);
1124  PrintModulation(app, 0, 255, responseBuf, responseBufUsed);
1125  break;
1126  default:
1127  RMH_PrintErr("Unknown MoCA version.\n");
1128  break;
1129  }
1130 
1131  return ret;
1132 }
1133 
1134 
1135 
1136 /***********************************************************
1137  * Registration Functions
1138  ***********************************************************/
1139 #define SET_LOCAL_API_HANDLER(HANDLER_FUNCTION, API_FUNCTION, ALIAS_STRING, DESCRIPTION_STR) \
1140  static RMH_API pRMH_API_##API_FUNCTION = { #API_FUNCTION, false, false, NULL, NULL, DESCRIPTION_STR, NULL, 0, NULL }; \
1141  if (app->local.apiListSize < RMH_MAX_NUM_APIS) app->local.apiList[app->local.apiListSize++]=&pRMH_API_##API_FUNCTION; \
1142  SET_API_HANDLER(HANDLER_FUNCTION, API_FUNCTION, ALIAS_STRING);
1143 
1144 #define SET_API_HANDLER(HANDLER_FUNCTION, API_FUNCTION, ALIAS_STRING) { \
1145  while(0) HANDLER_FUNCTION(NULL, API_FUNCTION); \
1146  RMHApp_AddAPI(app, #API_FUNCTION, API_FUNCTION, HANDLER_FUNCTION, ALIAS_STRING); \
1147 }
1148 
1149 static
1150 void RMHApp_AddAPI(RMHApp* app, const char* apiName, const void *apiFunc, const void *apiHandlerFunc, const char* apiAlias) {
1151  memset(&app->handledAPIs.apiList[app->handledAPIs.apiListSize], 0, sizeof(app->handledAPIs.apiList[app->handledAPIs.apiListSize]));
1152  app->handledAPIs.apiList[app->handledAPIs.apiListSize].apiName = apiName;
1153  app->handledAPIs.apiList[app->handledAPIs.apiListSize].apiAlias = (apiAlias && apiAlias[0] != '\0' ) ? apiAlias : NULL;
1154  app->handledAPIs.apiList[app->handledAPIs.apiListSize].apiFunc = apiFunc;
1155  app->handledAPIs.apiList[app->handledAPIs.apiListSize].apiHandlerFunc = apiHandlerFunc;
1156  app->handledAPIs.apiListSize++;
1157 }
1158 
1159 void RMHApp_RegisterAPIHandlers(RMHApp *app) {
1160  /* RMH APIs */
1161  /**************************************************************************************************************************************
1162  * Handler Function | API Name | Alias (comma seperated) *
1163  **************************************************************************************************************************************/
1164  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetEnabled, "");
1165  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetEnabled, "");
1166  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetMoCALinkUp, "");
1167  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetLOF, "");
1168  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetLOF, "");
1169  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetScanLOFOnly, "");
1170  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetScanLOFOnly, "");
1171  SET_API_HANDLER(RMHApp__OUT_MOCA_VERSION, RMH_Self_GetHighestSupportedMoCAVersion, "");
1172  SET_API_HANDLER(RMHApp__OUT_STRING, RMH_Self_GetSoftwareVersion, "");
1173  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetPreferredNCEnabled, "");
1174  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetPreferredNCEnabled, "");
1175  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetMaxPacketAggregation, "");
1176  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetMaxPacketAggregation, "");
1177  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetMaxFrameSize, "");
1178  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetMaxFrameSize, "");
1179  SET_API_HANDLER(RMHApp__OUT_UINT32_HEX, RMH_Self_GetFrequencyMask, "");
1180  SET_API_HANDLER(RMHApp__IN_UINT32_HEX, RMH_Self_SetFrequencyMask, "");
1181  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetLowBandwidthLimit, "");
1182  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetLowBandwidthLimit, "");
1183  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetMaxBitrate, "");
1184  SET_API_HANDLER(RMHApp__IN_INT32, RMH_Self_SetTxPowerLimit, "");
1185  SET_API_HANDLER(RMHApp__OUT_INT32, RMH_Self_GetTxPowerLimit, "");
1186  SET_API_HANDLER(RMHApp__OUT_UINT32_ARRAY, RMH_Self_GetSupportedFrequencies, "");
1187  SET_API_HANDLER(RMHApp__HANDLE_ONLY, RMH_Self_RestoreDefaultSettings, "");
1188  SET_API_HANDLER(RMHApp__HANDLE_ONLY, RMH_Self_RestoreRDKDefaultSettings, "");
1189  SET_API_HANDLER(RMHApp__OUT_LINK_STATUS, RMH_Self_GetLinkStatus, "");
1190  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetQAM256Enabled, "");
1191  SET_API_HANDLER(RMHApp__OUT_BAND, RMH_Self_GetSupportedBand, "");
1192  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetQAM256Enabled, "");
1193  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetQAM256TargetPhyRate, "");
1194  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetQAM256TargetPhyRate, "");
1195  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetPrimaryChannelTargetPhyRate, "");
1196  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetPrimaryChannelTargetPhyRate, "");
1197  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetSecondaryChannelTargetPhyRate, "");
1198  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Self_SetSecondaryChannelTargetPhyRate, "");
1199  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetTurboEnabled, "");
1200  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetTurboEnabled, "");
1201  SET_API_HANDLER(RMHApp__GET_TABOO, RMH_Self_GetTabooChannels, "");
1202  SET_API_HANDLER(RMHApp__SET_TABOO, RMH_Self_SetTabooChannels, "");
1203  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetBondingEnabled, "");
1204  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetBondingEnabled, "");
1205  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Self_GetPrivacyEnabled, "");
1206  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Self_SetPrivacyEnabled, "");
1207  SET_API_HANDLER(RMHApp__OUT_STRING, RMH_Self_GetPrivacyPassword, "");
1208  SET_API_HANDLER(RMHApp__IN_STRING, RMH_Self_SetPrivacyPassword, "");
1209  SET_API_HANDLER(RMHApp__OUT_STRING, RMH_Self_GetPrivacyMACManagementKey, "");
1210  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Self_GetMaxAllocationElements, "");
1211  SET_API_HANDLER(RMHApp__IN_INT32, RMH_Self_SetPrimaryChannelOffset, "");
1212  SET_API_HANDLER(RMHApp__OUT_INT32, RMH_Self_GetPrimaryChannelOffset, "");
1213  SET_API_HANDLER(RMHApp__IN_INT32, RMH_Self_SetSecondaryChannelOffset, "");
1214  SET_API_HANDLER(RMHApp__OUT_INT32, RMH_Self_GetSecondaryChannelOffset, "");
1215  SET_API_HANDLER(RMHApp__OUT_RESET_REASON, RMH_Self_GetLastResetReason, "");
1216 
1217  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Interface_GetEnabled, "");
1218  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Interface_SetEnabled, "");
1219  SET_API_HANDLER(RMHApp__OUT_STRING, RMH_Interface_GetName, "");
1220  SET_API_HANDLER(RMHApp__OUT_MAC, RMH_Interface_GetMac, "");
1221  SET_API_HANDLER(RMHApp__IN_MAC, RMH_Interface_SetMac, "");
1222 
1223  SET_API_HANDLER(RMHApp__OUT_POWER_MODE, RMH_Power_GetMode, "");
1224  SET_API_HANDLER(RMHApp__OUT_POWER_MODE, RMH_Power_GetStandbyMode, "");
1225  SET_API_HANDLER(RMHApp__IN_POWER_MODE, RMH_Power_SetStandbyMode, "");
1226  SET_API_HANDLER(RMHApp__OUT_POWER_MODE, RMH_Power_GetSupportedModes, "");
1227  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Power_GetTxPowerControlEnabled, "");
1228  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Power_SetTxPowerControlEnabled, "");
1229  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Power_GetTxBeaconPowerReductionEnabled, "");
1230  SET_API_HANDLER(RMHApp__IN_BOOL, RMH_Power_SetTxBeaconPowerReductionEnabled, "");
1231  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Power_GetTxBeaconPowerReduction, "");
1232  SET_API_HANDLER(RMHApp__IN_UINT32, RMH_Power_SetTxBeaconPowerReduction, "");
1233 
1234  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxTotalBytes, "");
1235  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxTotalBytes, "");
1236  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxTotalPackets, "");
1237  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxTotalPackets, "");
1238  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxUnicastPackets, "");
1239  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxUnicastPackets, "");
1240  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxBroadcastPackets, "");
1241  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxBroadcastPackets, "");
1242  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxMulticastPackets, "");
1243  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxMulticastPackets, "");
1244  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxReservationRequestPackets, "");
1245  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxReservationRequestPackets, "");
1246  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxMapPackets, "");
1247  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxMapPackets, "");
1248  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxLinkControlPackets, "");
1249  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxLinkControlPackets, "");
1250  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxUnknownProtocolPackets, "");
1251  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxDroppedPackets, "");
1252  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxDroppedPackets, "");
1253  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxTotalErrors, "");
1254  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxTotalErrors, "");
1255  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxCRCErrors, "");
1256  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxTimeoutErrors, "");
1257  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetAdmissionAttempts, "");
1258  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetAdmissionSucceeded, "");
1259  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetAdmissionFailures, "");
1260  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetAdmissionsDeniedAsNC, "");
1261  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxBeacons, "");
1262  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxBeacons, "");
1263  SET_API_HANDLER(RMHApp__OUT_UINT32_NODELIST, RMH_Stats_GetRxCorrectedErrors, "");
1264  SET_API_HANDLER(RMHApp__OUT_UINT32_NODELIST, RMH_Stats_GetRxUncorrectedErrors, "");
1265  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetRxTotalAggregatedPackets, "");
1266  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Stats_GetTxTotalAggregatedPackets, "");
1267  SET_API_HANDLER(RMHApp__OUT_UINT32_ARRAY, RMH_Stats_GetRxPacketAggregation, "");
1268  SET_API_HANDLER(RMHApp__OUT_UINT32_ARRAY, RMH_Stats_GetTxPacketAggregation, "");
1269  SET_API_HANDLER(RMHApp__HANDLE_ONLY, RMH_Stats_Reset, "");
1270 
1271  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQOS_GetMaxIngressFlows, "");
1272  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQOS_GetMaxEgressFlows, "");
1273  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQoS_GetNumIngressFlows, "");
1274  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQoS_GetNumEgressFlows, "");
1275  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_PQoS_GetEgressBandwidth, "");
1276  SET_API_HANDLER(RMHApp__OUT_MAC_ARRAY, RMH_PQoS_GetIngressFlowIds, "");
1277  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQoS_GetMaxEgressBandwidth, "");
1278  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_PQoS_GetMinEgressBandwidth, "");
1279  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetPeakDataRate, "");
1280  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetBurstSize, "");
1281  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetLeaseTime, "");
1282  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetLeaseTimeRemaining, "");
1283  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetFlowTag, "");
1284  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetMaxLatency, "");
1285  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetShortTermAvgRatio, "");
1286  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetMaxRetry, "");
1287  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetVLANTag, "");
1288  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetFlowPer, "");
1289  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetIngressClassificationRule, "");
1290  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetPacketSize, "");
1291  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetTotalTxPackets, "");
1292  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetDSCPMoCA, "");
1293  SET_API_HANDLER(RMHApp__IN_MAC_OUT_UINT32, RMH_PQoSFlow_GetDFID, "");
1294  SET_API_HANDLER(RMHApp__IN_MAC_OUT_MAC, RMH_PQoSFlow_GetDestination, "");
1295  SET_API_HANDLER(RMHApp__IN_MAC_OUT_MAC, RMH_PQoSFlow_GetIngressMac, "");
1296  SET_API_HANDLER(RMHApp__IN_MAC_OUT_MAC, RMH_PQoSFlow_GetEgressMac, "");
1297 
1298  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetNumNodes, "");
1299  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetNodeId, "");
1300  SET_API_HANDLER(RMHApp__OUT_UINT32_NODELIST, RMH_Network_GetNodeIds, "");
1301  SET_API_HANDLER(RMHApp__OUT_UINT32_NODELIST, RMH_Network_GetRemoteNodeIds, "");
1302  SET_API_HANDLER(RMHApp__OUT_UINT32_NODELIST, RMH_Network_GetAssociatedIds, "");
1303  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetNCNodeId, "");
1304  SET_API_HANDLER(RMHApp__OUT_MAC, RMH_Network_GetNCMac, "");
1305  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetBackupNCNodeId, "");
1306  SET_API_HANDLER(RMHApp__OUT_MOCA_VERSION, RMH_Network_GetMoCAVersion, "");
1307  SET_API_HANDLER(RMHApp__OUT_BOOL, RMH_Network_GetMixedMode, "");
1308  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetLinkUptime, "");
1309  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetResetCount, "");
1310  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetLinkDownCount, "");
1311  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetRFChannelFreq, "");
1312  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetPrimaryChannelFreq, "");
1313  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetSecondaryChannelFreq, "");
1314  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetTxMapPhyRate, "");
1315  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetTxBroadcastPhyRate, "");
1316  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetTxGCDPhyRate, "");
1317  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_Network_GetTxGcdPowerReduction, "");
1318  SET_API_HANDLER(RMHApp__OUT_UINT32_NODEMESH, RMH_Network_GetTxUnicastPhyRate, "");
1319  SET_API_HANDLER(RMHApp__OUT_UINT32_NODEMESH, RMH_Network_GetTxVLPER, "");
1320  SET_API_HANDLER(RMHApp__OUT_UINT32_NODEMESH, RMH_Network_GetTxNPER, "");
1321  SET_API_HANDLER(RMHApp__OUT_UINT32_NODEMESH, RMH_Network_GetBitLoadingInfo, "");
1322  SET_API_HANDLER(RMHApp__OUT_UINT32_NODEMESH, RMH_Network_GetBondedConnections, "");
1323  SET_API_HANDLER(RMHApp__GET_TABOO, RMH_Network_GetTabooChannels, "");
1324 
1325  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetNodeIdFromAssociatedId, "");
1326  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetAssociatedIdFromNodeId, "");
1327  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_MAC, RMH_RemoteNode_GetMac, "");
1328  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_BOOL, RMH_RemoteNode_GetPreferredNC, "");
1329  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_MOCA_VERSION, RMH_RemoteNode_GetHighestSupportedMoCAVersion, "");
1330  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_MOCA_VERSION, RMH_RemoteNode_GetActiveMoCAVersion, "");
1331  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_BOOL, RMH_RemoteNode_GetQAM256Capable, "");
1332  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_BOOL, RMH_RemoteNode_GetBondingCapable, "");
1333  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxPacketAggregation, "");
1334  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxFrameSize, "");
1335  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxPackets, "");
1336  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxUnicastPhyRate, "");
1337  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxBroadcastPhyRate, "");
1338  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_FLOAT, RMH_RemoteNode_GetRxUnicastPower, "");
1339  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_FLOAT, RMH_RemoteNode_GetRxBroadcastPower, "");
1340  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_FLOAT, RMH_RemoteNode_GetRxMapPower, "");
1341  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_FLOAT, RMH_RemoteNode_GetRxSNR, "");
1342  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxTotalErrors, "");
1343  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxCorrectedErrors, "");
1344  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetRxUnCorrectedErrors, "");
1345  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_FLOAT, RMH_RemoteNode_GetTxUnicastPower, "");
1346  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetTxPowerReduction, "");
1347  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetTxUnicastPhyRate, "");
1348  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetTxPackets, "");
1349  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetRxUnicastSubcarrierModulation, "");
1350  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetTxUnicastSubcarrierModulation, "");
1351  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation, "");
1352  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation, "");
1353  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetRxBroadcastSubcarrierModulation, "");
1354  SET_API_HANDLER(RMHApp__OUT_MODULATION, RMH_RemoteNode_GetTxBroadcastSubcarrierModulation, "");
1355  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxConstellation_GCD100, "");
1356  SET_API_HANDLER(RMHApp__IN_UINT32_IN_UINT32, RMH_RemoteNode_SetMaxConstellation_GCD100, "");
1357  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxConstellation_GCD50, "");
1358  SET_API_HANDLER(RMHApp__IN_UINT32_IN_UINT32, RMH_RemoteNode_SetMaxConstellation_GCD50, "");
1359  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxConstellation_P2P100, "");
1360  SET_API_HANDLER(RMHApp__IN_UINT32_IN_UINT32, RMH_RemoteNode_SetMaxConstellation_P2P100, "");
1361  SET_API_HANDLER(RMHApp__IN_UINT32_OUT_UINT32, RMH_RemoteNode_GetMaxConstellation_P2P50, "");
1362  SET_API_HANDLER(RMHApp__IN_UINT32_IN_UINT32, RMH_RemoteNode_SetMaxConstellation_P2P50, "");
1363  SET_API_HANDLER(RMHApp__MoCA_RESET, RMH_RemoteNode_Reset, "");
1364 
1365  SET_API_HANDLER(RMHApp__OUT_LOGLEVEL, RMH_Log_GetAPILevel, "");
1366  SET_API_HANDLER(RMHApp__IN_LOGLEVEL, RMH_Log_SetAPILevel, "");
1367  SET_API_HANDLER(RMHApp__OUT_LOGLEVEL, RMH_Log_GetDriverLevel, "");
1368  SET_API_HANDLER(RMHApp__IN_LOGLEVEL, RMH_Log_SetDriverLevel, "");
1369  SET_API_HANDLER(RMHApp__OUT_STRING, RMH_Log_GetDriverFilename, "");
1370  SET_API_HANDLER(RMHApp__IN_STRING, RMH_Log_SetDriverFilename, "");
1371  SET_API_HANDLER(RMHApp__PRINT_STATUS, RMH_Log_PrintStatus, "status");
1372  SET_API_HANDLER(RMHApp__PRINT_STATUS, RMH_Log_PrintStats, "stats");
1373  SET_API_HANDLER(RMHApp__PRINT_STATUS, RMH_Log_PrintFlows, "flows");
1374  SET_API_HANDLER(RMHApp__PRINT_STATUS, RMH_Log_PrintModulation, "modulation");
1375 
1376  SET_API_HANDLER(RMHApp__REQUEST_ACA, RMH_ACA_Request, "");
1377  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_ACA_GetChannel, "");
1378  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_ACA_GetSourceNodeId, "");
1379  SET_API_HANDLER(RMHApp__OUT_UINT32, RMH_ACA_GetDestinationNodeMask, "");
1380  SET_API_HANDLER(RMHApp__OUT_ACA_TYPE, RMH_ACA_GetType, "");
1381  SET_API_HANDLER(RMHApp__OUT_ACA_STATUS, RMH_ACA_GetStatus, "");
1382  SET_API_HANDLER(RMHApp__OUT_INT32, RMH_ACA_GetTotalRxPower, "");
1383  SET_API_HANDLER(RMHApp__OUT_UINT8_ARRAY, RMH_ACA_GetPowerProfile, "");
1384 
1385 
1386  SET_API_HANDLER(RMHApp__IN_RMH_ENUM, RMH_ResultToString, "");
1387  /* Local APIs */
1388  /*****************************************************************************************************************************************************************************************
1389  * Handler Function | API Name | Alias (comma seperated) | Description *
1390  *****************************************************************************************************************************************************************************************/
1391  SET_LOCAL_API_HANDLER(RMHApp__LOCAL_HANDLE_ONLY, RMHApp_DriverLogForever, "log_forever,logforever", "Enabled debug logging to a dedicated file that does not rotate. This will collect the best logs however if left enabled for long periods of time you can run out of space.");
1392  SET_LOCAL_API_HANDLER(RMHApp__LOCAL_HANDLE_ONLY, RMHApp_EnableDriverDebugLogging, "log", "Enable debug logging to the default MoCA log location. This is safe to leave enabled for long periods of time as this default log should be rotated");
1393  SET_LOCAL_API_HANDLER(RMHApp__LOCAL_HANDLE_ONLY, RMHApp_DisableDriverDebugLogging, "log_stop,logstop", "Disable MoCA debug logging");
1394  SET_LOCAL_API_HANDLER(RMHApp__LOCAL_HANDLE_ONLY, RMHApp_Start, "start", "Shortcut to Enable MoCA");
1395  SET_LOCAL_API_HANDLER(RMHApp__LOCAL_HANDLE_ONLY, RMHApp_Stop, "stop", "Shortcut to disable MoCA");
1396 }
RMH_PQoS_GetMinEgressBandwidth
RMH_Result RMH_PQoS_GetMinEgressBandwidth(const RMH_Handle handle, uint32_t *response)
Return the node Id with the minimum available bandwidth.
RMH_Network_GetNCMac
RMH_Result RMH_Network_GetNCMac(const RMH_Handle handle, RMH_MacAddress_t *response)
Return the MAC address of the network coordinator.
RMH_Stats_GetAdmissionFailures
RMH_Result RMH_Stats_GetAdmissionFailures(const RMH_Handle handle, uint32_t *response)
Return the number of admission failures for this node.
RMH_Log_GetDriverLevel
RMH_Result RMH_Log_GetDriverLevel(const RMH_Handle handle, RMH_LogLevel *response)
Return a bitmask of RMH_LogLevel which indicates the currently enabled RMH log types in the MoCA driv...
RMH_Power_GetMode
RMH_Result RMH_Power_GetMode(const RMH_Handle handle, RMH_PowerMode *response)
Return the current MoCA power state of this device.
RMH_Stats_GetRxMulticastPackets
RMH_Result RMH_Stats_GetRxMulticastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of multicast packets received by this node.
RMH_Self_GetPreferredNCEnabled
RMH_Result RMH_Self_GetPreferredNCEnabled(const RMH_Handle handle, bool *response)
Return if this device is a preferred NC.
RMH_Stats_Reset
RMH_Result RMH_Stats_Reset(const RMH_Handle handle)
Reset MoCA statistics counters back to zero.
RMH_Stats_GetRxTotalAggregatedPackets
RMH_Result RMH_Stats_GetRxTotalAggregatedPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of received aggregated packets.
RMH_RemoteNode_GetRxBroadcastPhyRate
RMH_Result RMH_RemoteNode_GetRxBroadcastPhyRate(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the PHY rate at which broadcast packets are received from nodeId.
RMH_Self_GetMaxBitrate
RMH_Result RMH_Self_GetMaxBitrate(const RMH_Handle handle, uint32_t *response)
The maximum PHY rate supported in non-turbo mode.
RMH_Stats_GetTxBroadcastPackets
RMH_Result RMH_Stats_GetTxBroadcastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of broadcast packets transmitted by this node.
RMH_Log_GetDriverFilename
RMH_Result RMH_Log_GetDriverFilename(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Get the file name where MoCA driver logs are currently being captured.
RMH_Stats_GetTxPacketAggregation
RMH_Result RMH_Stats_GetTxPacketAggregation(const RMH_Handle handle, uint32_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return an array indicating the number of packets transmitted per aggregation number.
RMH_Stats_GetRxCRCErrors
RMH_Result RMH_Stats_GetRxCRCErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of packets this node has received with CRC errors.
RMH_Stats_GetTxTotalErrors
RMH_Result RMH_Stats_GetTxTotalErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of transmit errors by this node.
RMH_Stats_GetTxMulticastPackets
RMH_Result RMH_Stats_GetTxMulticastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of multicast packets transmitted by this node.
RMH_Self_GetLinkStatus
RMH_Result RMH_Self_GetLinkStatus(const RMH_Handle handle, RMH_LinkStatus *status)
Current operational status of the MoCA interface [mocaIfStatus].
RMH_Self_SetQAM256TargetPhyRate
RMH_Result RMH_Self_SetQAM256TargetPhyRate(const RMH_Handle handle, const uint32_t value)
Set the target PHY rate in Mbps.
RMH_RemoteNode_Reset
RMH_Result RMH_RemoteNode_Reset(const RMH_Handle handle, const uint32_t nodeListMask, const uint32_t startTime)
Instruct one or more nodes to initiate a MoCA Reset command.
RMH_ACA_GetTotalRxPower
RMH_Result RMH_ACA_GetTotalRxPower(const RMH_Handle handle, int32_t *response)
Return the total power from the last completed ACA operation.
RMH_RemoteNode_GetMac
RMH_Result RMH_RemoteNode_GetMac(const RMH_Handle handle, const uint32_t nodeId, RMH_MacAddress_t *response)
Return the MAC address of the remote node specified by nodeId.
RMH_Network_GetLinkUptime
RMH_Result RMH_Network_GetLinkUptime(const RMH_Handle handle, uint32_t *response)
Returns the amount of time this node has been part of the MoCA network [mocaIfLinkUpTime].
RMH_Log_SetDriverLevel
RMH_Result RMH_Log_SetDriverLevel(const RMH_Handle handle, const RMH_LogLevel value)
Set the log level of the MoCA driver.
RMH_ACA_GetPowerProfile
RMH_Result RMH_ACA_GetPowerProfile(const RMH_Handle handle, uint8_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Returns the ACA power profile.
RMH_Stats_GetAdmissionAttempts
RMH_Result RMH_Stats_GetAdmissionAttempts(const RMH_Handle handle, uint32_t *response)
Return the number of admission attempts this node has made.
RMH_Network_GetSecondaryChannelFreq
RMH_Result RMH_Network_GetSecondaryChannelFreq(const RMH_Handle handle, uint32_t *response)
Return the secondary MoCA 2.0 channel.
RMH_Stats_GetAdmissionSucceeded
RMH_Result RMH_Stats_GetAdmissionSucceeded(const RMH_Handle handle, uint32_t *response)
Return the number of successful admissions for this node.
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.
RMH_Network_GetBackupNCNodeId
RMH_Result RMH_Network_GetBackupNCNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of the backup network coordinator [mocaIfBackupNC].
RMH_PQoS_GetNumIngressFlows
RMH_Result RMH_PQoS_GetNumIngressFlows(const RMH_Handle handle, uint32_t *response)
Return the number of ingress flows.
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.
RMH_Network_GetNodeIds
RMH_Result RMH_Network_GetNodeIds(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return a list of every node ID on the network.
RMH_RemoteNode_GetPreferredNC
RMH_Result RMH_RemoteNode_GetPreferredNC(const RMH_Handle handle, const uint32_t nodeId, bool *response)
Return if the node indicated by nodeId is a preferred NC or not.
RMH_PQOS_GetMaxEgressFlows
RMH_Result RMH_PQOS_GetMaxEgressFlows(const RMH_Handle handle, uint32_t *response)
Return the maximum number of supported Egress PQoS Flows by the Node [mocaIfSupportedEgressPqosFlows]...
RMH_Stats_GetAdmissionsDeniedAsNC
RMH_Result RMH_Stats_GetAdmissionsDeniedAsNC(const RMH_Handle handle, uint32_t *response)
Return the number of admissions this node has denied when it was the NC.
RMH_Power_SetTxBeaconPowerReductionEnabled
RMH_Result RMH_Power_SetTxBeaconPowerReductionEnabled(const RMH_Handle handle, const bool value)
Enable or disable if beacon power reduction on this device.
RMH_PQOS_GetMaxIngressFlows
RMH_Result RMH_PQOS_GetMaxIngressFlows(const RMH_Handle handle, uint32_t *response)
Return the maximum number of supported Ingress PQoS Flows by the Node [mocaIfSupportedIngressPqosFlow...
RMH_RemoteNode_GetRxBroadcastPower
RMH_Result RMH_RemoteNode_GetRxBroadcastPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level at which broadcast packets are received from nodeId.
RMH_PQoSFlow_GetVLANTag
RMH_Result RMH_PQoSFlow_GetVLANTag(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the VLAN priority for the flow specified by flowId.
RMH_Self_SetMaxFrameSize
RMH_Result RMH_Self_SetMaxFrameSize(const RMH_Handle handle, const uint32_t value)
Set the maximum number of bytes this node can receive in one frame (aggregated transmission).
RMH_LogLevelToString
const char *const RMH_LogLevelToString(const uint32_t value, char *responseBuf, const size_t responseBufSize)
Return the bitmask value as a string.
Definition: librmh_api_no_wrap.c:166
RMH_Power_GetTxBeaconPowerReductionEnabled
RMH_Result RMH_Power_GetTxBeaconPowerReductionEnabled(const RMH_Handle handle, bool *response)
Return if beacon power reduction is enabled on this device.
RMH_PQoSFlow_GetDestination
RMH_Result RMH_PQoSFlow_GetDestination(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the destination flow ID of the flow specified by flowId.
RMH_Stats_GetTxMapPackets
RMH_Result RMH_Stats_GetTxMapPackets(const RMH_Handle handle, uint32_t *response)
Return the number of MAP transmitted by this node.
RMH_PQoSFlow_GetFlowPer
RMH_Result RMH_PQoSFlow_GetFlowPer(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the flow packet error ratio profile for the flow specified by flowId.
RMH_Stats_GetTxTotalAggregatedPackets
RMH_Result RMH_Stats_GetTxTotalAggregatedPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of transmitted aggregated packets.
RMH_RemoteNode_GetTxUnicastPower
RMH_Result RMH_RemoteNode_GetTxUnicastPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level rate at which unicast packets are transmitted from nodeId to the self node.
RMH_NodeList_Uint32_t
Definition: rmh_type.h:195
RMH_PQoSFlow_GetBurstSize
RMH_Result RMH_PQoSFlow_GetBurstSize(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the number of packets per burst for the flow specified by flowId.
RMH_MoCAVersionToString
const char *const RMH_MoCAVersionToString(const RMH_MoCAVersion value)
Convert RMH_MoCAVersion to a string.
Definition: librmh_api_no_wrap.c:122
RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetSecondaryRxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast recieve subcarrier modulation profiles for the secondary MoCA channel.
RMH_Power_GetTxPowerControlEnabled
RMH_Result RMH_Power_GetTxPowerControlEnabled(const RMH_Handle handle, bool *response)
Return if transmit power control is enabled or disabled for this device.
RMH_Network_GetNodeId
RMH_Result RMH_Network_GetNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of this device.
RMH_Stats_GetTxReservationRequestPackets
RMH_Result RMH_Stats_GetTxReservationRequestPackets(const RMH_Handle handle, uint32_t *response)
Return the number of reservation request packets transmitted by this node.
RMH_ACA_GetType
RMH_Result RMH_ACA_GetType(const RMH_Handle handle, RMH_ACAType *response)
Return the type of the last requested ACA operation.
RMH_Log_SetDriverFilename
RMH_Result RMH_Log_SetDriverFilename(const RMH_Handle handle, const char *value)
Set the file name where MoCA driver logs should be captured to.
RMH_BandToString
const char *const RMH_BandToString(const RMH_Band value)
Convert value to a printable string.
Definition: librmh_api_no_wrap.c:96
RMH_Self_SetMaxPacketAggregation
RMH_Result RMH_Self_SetMaxPacketAggregation(const RMH_Handle handle, const uint32_t value)
Set the maximum allowed packets for aggregated transmissions.
RMH_RemoteNode_GetHighestSupportedMoCAVersion
RMH_Result RMH_RemoteNode_GetHighestSupportedMoCAVersion(const RMH_Handle handle, const uint32_t nodeId, RMH_MoCAVersion *response)
Return the highest supported version of MoCA by the remote node specified by nodeId.
RMH_RemoteNode_GetRxCorrectedErrors
RMH_Result RMH_RemoteNode_GetRxCorrectedErrors(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the number of packets with corrected errors nodeId has received.
RMH_Self_SetFrequencyMask
RMH_Result RMH_Self_SetFrequencyMask(const RMH_Handle handle, const uint32_t value)
Set the bit mask for specifying which frequencies should be scanned during the listening phase of net...
RMH_PQoSFlow_GetMaxRetry
RMH_Result RMH_PQoSFlow_GetMaxRetry(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the maximum number of retransmission attempts for each MSDU of the flow specified by flowId.
RMH_Self_GetHighestSupportedMoCAVersion
RMH_Result RMH_Self_GetHighestSupportedMoCAVersion(const RMH_Handle handle, RMH_MoCAVersion *response)
Return the highest version of MoCA supported by the MoCA driver on this device. [mocaIfMocaVersion].
RMH_Network_GetNumNodes
RMH_Result RMH_Network_GetNumNodes(const RMH_Handle handle, uint32_t *response)
Return the number of MoCA nodes in the network. [mocaIfNumNodes].
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.
RMH_RemoteNode_GetRxMapPower
RMH_Result RMH_RemoteNode_GetRxMapPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level at which MAP packets are received by nodeId.
RMH_PQoSFlow_GetIngressClassificationRule
RMH_Result RMH_PQoSFlow_GetIngressClassificationRule(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the ingress classification rule for assigning MSDUs to the flow specified by flowId.
RMH_RemoteNode_GetRxBroadcastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetRxBroadcastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the receive broadcast subcarrier modulation profiles for the channel.
RMH_Self_GetSecondaryChannelOffset
RMH_Result RMH_Self_GetSecondaryChannelOffset(const RMH_Handle handle, int32_t *response)
TBD [mocaIfSecondaryChannelOffset].
RMH_PQoS_GetNumEgressFlows
RMH_Result RMH_PQoS_GetNumEgressFlows(const RMH_Handle handle, uint32_t *response)
Return the number of egress flows.
RMH_Self_SetPreferredNCEnabled
RMH_Result RMH_Self_SetPreferredNCEnabled(const RMH_Handle handle, const bool value)
Enable or disable preferred NC on this device.
RMH_Self_GetTurboEnabled
RMH_Result RMH_Self_GetTurboEnabled(const RMH_Handle handle, bool *response)
Return if turbo mode is enabled on this device.
RMH_Self_GetLowBandwidthLimit
RMH_Result RMH_Self_GetLowBandwidthLimit(const RMH_Handle handle, uint32_t *response)
Get the current lower limit for PHY rate between two nodes.
RMH_Network_GetRFChannelFreq
RMH_Result RMH_Network_GetRFChannelFreq(const RMH_Handle handle, uint32_t *response)
Return the frequency which the MoCA network is operating on. [mocaIfRFChannel].
RMH_RemoteNode_GetRxUnCorrectedErrors
RMH_Result RMH_RemoteNode_GetRxUnCorrectedErrors(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the number of packets with uncorrected errors <nodeId> has received.
RMH_LinkStatusToString
const char *const RMH_LinkStatusToString(const RMH_LinkStatus value)
Convert RMH_LinkStatus to a string.
Definition: librmh_api_no_wrap.c:88
RMH_Self_SetBondingEnabled
RMH_Result RMH_Self_SetBondingEnabled(const RMH_Handle handle, const bool value)
Enable or disable bonding mode on this device.
RMH_Self_GetSupportedFrequencies
RMH_Result RMH_Self_GetSupportedFrequencies(const RMH_Handle handle, uint32_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return a list of frequencies in the band used by this node.
RMH_RemoteNode_GetTxBroadcastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetTxBroadcastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the transmission broadcast subcarrier modulation profiles for the channel.
RMH_Network_GetMixedMode
RMH_Result RMH_Network_GetMixedMode(const RMH_Handle handle, bool *response)
Check if the MoCA network contains both 1.1 and 2.0 nodes.
RMH_Power_GetTxBeaconPowerReduction
RMH_Result RMH_Power_GetTxBeaconPowerReduction(const RMH_Handle handle, uint32_t *response)
Return the power control back-off used by this node for transmitting beacons.
RMH_Stats_GetRxTotalErrors
RMH_Result RMH_Stats_GetRxTotalErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of received errors by this node.
RMH_RemoteNode_GetRxPackets
RMH_Result RMH_RemoteNode_GetRxPackets(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the number of packets nodeId has received.
RMH_Network_GetTxGcdPowerReduction
RMH_Result RMH_Network_GetTxGcdPowerReduction(const RMH_Handle handle, uint32_t *response)
The transmit power control back-off used for broadcast transmissions from this node....
RMH_Self_GetBondingEnabled
RMH_Result RMH_Self_GetBondingEnabled(const RMH_Handle handle, bool *response)
Return if bonding mode is enabled on this device.
RMH_PQoSFlow_GetMaxLatency
RMH_Result RMH_PQoSFlow_GetMaxLatency(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the maximum latency of the flow specified by flowId.
RMH_Network_GetTxGCDPhyRate
RMH_Result RMH_Network_GetTxGCDPhyRate(const RMH_Handle handle, uint32_t *response)
Return the GCD PHY rate which packets are transmitted from this node.
RMH
Definition: librmh.h:57
RMH_PQoSFlow_GetShortTermAvgRatio
RMH_Result RMH_PQoSFlow_GetShortTermAvgRatio(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the short term average ratio for the flow specified by flowId.
RMH_Self_GetPrivacyPassword
RMH_Result RMH_Self_GetPrivacyPassword(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Get the current MoCA privacy password.
RMH_Power_SetTxBeaconPowerReduction
RMH_Result RMH_Power_SetTxBeaconPowerReduction(const RMH_Handle handle, const uint32_t value)
Set the power control back-off used by this node for transmitting beacons.
RMH_Stats_GetTxDroppedPackets
RMH_Result RMH_Stats_GetTxDroppedPackets(const RMH_Handle handle, uint32_t *response)
Return the number of packets this node has dropped before transmitting.
RMH_PQoS_GetIngressFlowIds
RMH_Result RMH_PQoS_GetIngressFlowIds(const RMH_Handle handle, RMH_MacAddress_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return a list of the unique Id for each existing ingress flows.
RMH_RemoteNode_GetRxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetRxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast recieve subcarrier modulation profiles for the primary MoCA channel.
RMH_RemoteNode_GetRxTotalErrors
RMH_Result RMH_RemoteNode_GetRxTotalErrors(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the total number of packets with errors nodeId has received.
RMH_ACA_GetStatus
RMH_Result RMH_ACA_GetStatus(const RMH_Handle handle, RMH_ACAStatus *response)
Return the current status of the last requested ACA operation.
RMH_Stats_GetRxBeacons
RMH_Result RMH_Stats_GetRxBeacons(const RMH_Handle handle, uint32_t *response)
Return the number of beacons received by this node.
RMH_ACA_GetChannel
RMH_Result RMH_ACA_GetChannel(const RMH_Handle handle, uint32_t *response)
Return the channel number of the last requested ACA. [mocaIfAcaNodeID].
RMH_RemoteNode_GetRxUnicastPhyRate
RMH_Result RMH_RemoteNode_GetRxUnicastPhyRate(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the PHY rate at which unicast packets are received from nodeId of the self node.
RMH_Stats_GetTxUnicastPackets
RMH_Result RMH_Stats_GetTxUnicastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unicast packets transmitted by this node.
RMH_Network_GetTxNPER
RMH_Result RMH_Network_GetTxNPER(const RMH_Handle handle, RMH_NodeMesh_Uint32_t *response)
Return the transmit NPER (Nominal Packet Error Rate) PHY rates from all MoCA 2.0 nodes on the network...
RMH_Stats_GetRxUncorrectedErrors
RMH_Result RMH_Stats_GetRxUncorrectedErrors(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return the number of received packets from every node with errors which were not corrected.
RMH_Stats_GetTxTotalBytes
RMH_Result RMH_Stats_GetTxTotalBytes(const RMH_Handle handle, uint32_t *response)
Return the total number of bytes transmitted by this node.
RMHApp
Definition: rmh_app.h:50
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.
RMH_Self_SetScanLOFOnly
RMH_Result RMH_Self_SetScanLOFOnly(const RMH_Handle handle, const bool value)
Indicate if the device should join networks only on the last operating frequency.
RMH_Network_GetTabooChannels
RMH_Result RMH_Network_GetTabooChannels(const RMH_Handle handle, uint32_t *channelMaskStart, uint32_t *channelMask)
Return which beacon channels will be taboo on this device.
RMH_Self_SetLOF
RMH_Result RMH_Self_SetLOF(const RMH_Handle handle, const uint32_t value)
Manually set the last operating frequency of the device.
RMH_Network_GetTxVLPER
RMH_Result RMH_Network_GetTxVLPER(const RMH_Handle handle, RMH_NodeMesh_Uint32_t *response)
Return the transmit VLPER (Very Low Packet Error Rate) PHY rates between all MoCA 2....
RMH_PQoSFlow_GetTotalTxPackets
RMH_Result RMH_PQoSFlow_GetTotalTxPackets(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the total number of packets transmitted on the flow specified by flowId.
RMH_RemoteNode_GetQAM256Capable
RMH_Result RMH_RemoteNode_GetQAM256Capable(const RMH_Handle handle, const uint32_t nodeId, bool *response)
Return if the node indicated by nodeId has QAM256 enabled or not.
RMH_Self_GetSoftwareVersion
RMH_Result RMH_Self_GetSoftwareVersion(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Return the version of software being used by the MoCA driver on this device. [mocaIfSoftwareVersion].
RMH_Network_GetTxUnicastPhyRate
RMH_Result RMH_Network_GetTxUnicastPhyRate(const RMH_Handle handle, RMH_NodeMesh_Uint32_t *response)
Return the unicast transmit PHY rates between all nodes on the network.
RMH_MoCAResetReasonToString
const char *const RMH_MoCAResetReasonToString(const RMH_MoCAResetReason value)
Convert RMH_MoCAResetReason to a string.
Definition: librmh_api_no_wrap.c:108
RMH_Self_SetPrivacyPassword
RMH_Result RMH_Self_SetPrivacyPassword(const RMH_Handle handle, const char *value)
Set the network password used to generate privacy keys.
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.
RMH_Stats_GetRxTotalBytes
RMH_Result RMH_Stats_GetRxTotalBytes(const RMH_Handle handle, uint32_t *response)
Return the total number of bytes received by this node.
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.
Definition: librmh_api_no_wrap.c:174
RMH_Self_SetTabooChannels
RMH_Result RMH_Self_SetTabooChannels(const RMH_Handle handle, const uint32_t channelMaskStart, const uint32_t channelMask)
Set which channels will be taboo on this device.
RMH_Stats_GetRxDroppedPackets
RMH_Result RMH_Stats_GetRxDroppedPackets(const RMH_Handle handle, uint32_t *response)
Return the number of packets this node has dropped after receiving.
RMH_Self_GetScanLOFOnly
RMH_Result RMH_Self_GetScanLOFOnly(const RMH_Handle handle, bool *response)
Return if the device is scanning only the last operating frequency when attempting to establish a con...
RMH_Power_SetTxPowerControlEnabled
RMH_Result RMH_Power_SetTxPowerControlEnabled(const RMH_Handle handle, const bool value)
Enable or disable if transmit power control is enabled for this device.
RMH_NodeMesh_Uint32_t
Definition: rmh_type.h:205
RMH_Stats_GetTxBeacons
RMH_Result RMH_Stats_GetTxBeacons(const RMH_Handle handle, uint32_t *response)
Return the number of link control received by this node.
RMH_Self_SetEnabled
RMH_Result RMH_Self_SetEnabled(const RMH_Handle handle, const bool value)
Enable or disable the MoCA driver to connect to a MoCA network. Once enabled the driver will use what...
RMH_Stats_GetTxTotalPackets
RMH_Result RMH_Stats_GetTxTotalPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of packets transmitted by this node.
RMH_Interface_GetMac
RMH_Result RMH_Interface_GetMac(const RMH_Handle handle, RMH_MacAddress_t *response)
Return the MAC address associated with this MoCA device. [mocaIfMacAddress].
RMH_Stats_GetRxMapPackets
RMH_Result RMH_Stats_GetRxMapPackets(const RMH_Handle handle, uint32_t *response)
Return the number of MAP received by this node.
RMH_Network_GetLinkDownCount
RMH_Result RMH_Network_GetLinkDownCount(const RMH_Handle handle, uint32_t *response)
Returns the number of times the MoCA link has gone down since the last boot [mocaIfLinkDownCount].
RMH_Power_GetSupportedModes
RMH_Result RMH_Power_GetSupportedModes(const RMH_Handle handle, uint32_t *response)
Return a bitmask of RMH_PowerMode indicating all MoCA power modes supported by this device mocaIfPowe...
RMH_Network_GetNCNodeId
RMH_Result RMH_Network_GetNCNodeId(const RMH_Handle handle, uint32_t *response)
Return the node ID of the network coordinator. [mocaIfNC].
RMH_Interface_SetMac
RMH_Result RMH_Interface_SetMac(const RMH_Handle handle, const RMH_MacAddress_t value)
Set the MAC address associated with this MoCA device.
RMH_RemoteNode_GetTxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetTxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast transmit subcarrier modulation profiles for the primary MoCA channel.
RMH_Self_GetSupportedBand
RMH_Result RMH_Self_GetSupportedBand(const RMH_Handle handle, RMH_Band *response)
Return the band supported by the MoCA device. [mocaIfSupportedBands].
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.
Definition: librmh_api_no_wrap.c:162
RMH_Stats_GetRxBroadcastPackets
RMH_Result RMH_Stats_GetRxBroadcastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of broadcast packets received by this node.
RMH_ResultToString
const char *const RMH_ResultToString(const RMH_Result value)
Convert RMH_Result to a string.
Definition: librmh_api_no_wrap.c:84
RMH_Self_SetTxPowerLimit
RMH_Result RMH_Self_SetTxPowerLimit(const RMH_Handle handle, const int32_t value)
Set the maximum transmitter power level for this device.
RMH_Stats_GetRxTotalPackets
RMH_Result RMH_Stats_GetRxTotalPackets(const RMH_Handle handle, uint32_t *response)
Return the total number of packets received by this node.
RMH_Self_GetPrivacyEnabled
RMH_Result RMH_Self_GetPrivacyEnabled(const RMH_Handle handle, bool *response)
Return if MoCA privacy is enabled on this device.
RMH_Self_GetMaxPacketAggregation
RMH_Result RMH_Self_GetMaxPacketAggregation(const RMH_Handle handle, uint32_t *response)
Get the maximum number of packets this device will aggregate.
RMH_ACA_GetSourceNodeId
RMH_Result RMH_ACA_GetSourceNodeId(const RMH_Handle handle, uint32_t *response)
Return the Node ID of the source node for the last requested ACA. [mocaIfAcaNodeID].
RMH_Self_GetPrimaryChannelOffset
RMH_Result RMH_Self_GetPrimaryChannelOffset(const RMH_Handle handle, int32_t *response)
TBD [mocaIfPrimaryChannelOffset].
RMH_ACA_Request
RMH_Result RMH_ACA_Request(const RMH_Handle handle, const uint32_t channelNum, const uint32_t sourceNodeId, const uint32_t destinationNodeMask, const RMH_ACAType type)
Print a summary of the sub carrier modulation bitloading information.
RMH_Log_SetAPILevel
RMH_Result RMH_Log_SetAPILevel(const RMH_Handle handle, const uint32_t value)
Set the log level of the RMH library.
RMH_Self_GetMoCALinkUp
RMH_Result RMH_Self_GetMoCALinkUp(const RMH_Handle handle, bool *response)
Check if this device is actively connected to a MoCA network. If so, RMH_Network and RMH_Remote APIs ...
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.
RMH_RemoteNode_GetTxPowerReduction
RMH_Result RMH_RemoteNode_GetTxPowerReduction(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
The transmit power control back-off used for transmissions from the specified nodeId.
RMH_Self_GetTabooChannels
RMH_Result RMH_Self_GetTabooChannels(const RMH_Handle handle, uint32_t *channelMaskStart, uint32_t *channelMask)
Return which channels will be taboo on this device.
RMH_Network_GetBitLoadingInfo
RMH_Result RMH_Network_GetBitLoadingInfo(const RMH_Handle handle, RMH_NodeMesh_Uint32_t *response)
Returns the bit loading information.
RMH_Self_SetPrivacyEnabled
RMH_Result RMH_Self_SetPrivacyEnabled(const RMH_Handle handle, const bool value)
Enable or disable MoCA privacy on this device.
RMH_RemoteNode_GetTxUnicastPhyRate
RMH_Result RMH_RemoteNode_GetTxUnicastPhyRate(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the PHY rate at which unicast packets are transmitted from nodeId to the self node.
RMH_Self_RestoreDefaultSettings
RMH_Result RMH_Self_RestoreDefaultSettings(const RMH_Handle handle)
Return this device to its default configuration.
RMH_Self_SetQAM256Enabled
RMH_Result RMH_Self_SetQAM256Enabled(const RMH_Handle handle, const bool value)
Enable or disable the QAM256 ability in admission negotiations.
RMH_RemoteNode_GetTxPackets
RMH_Result RMH_RemoteNode_GetTxPackets(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the total number of packets nodeId has transmitted.
RMH_Stats_GetRxLinkControlPackets
RMH_Result RMH_Stats_GetRxLinkControlPackets(const RMH_Handle handle, uint32_t *response)
Return the number of link control received by this node.
RMH_RemoteNode_GetMaxFrameSize
RMH_Result RMH_RemoteNode_GetMaxFrameSize(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
The maximum number of bytes this node can receive in one frame (aggregated transmission).
RMH_PQoS_GetMaxEgressBandwidth
RMH_Result RMH_PQoS_GetMaxEgressBandwidth(const RMH_Handle handle, uint32_t *response)
Return the node Id with the maximum available bandwidth.
RMH_PQoSFlow_GetLeaseTime
RMH_Result RMH_PQoSFlow_GetLeaseTime(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the lease time in seconds for the flow specified by flowId.
RMH_Log_PrintFlows
RMH_Result RMH_Log_PrintFlows(const RMH_Handle handle, const char *filename)
Print a generic status summary of the MoCA flows.
RMH_Self_GetFrequencyMask
RMH_Result RMH_Self_GetFrequencyMask(const RMH_Handle handle, uint32_t *response)
Gets the bit mask of frequencies the device used during the listening phase of network search.
RMH_PQoSFlow_GetPeakDataRate
RMH_Result RMH_PQoSFlow_GetPeakDataRate(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the peak data rate in Kbps for the flow specified by flowId.
RMH_PQoSFlow_GetDFID
RMH_Result RMH_PQoSFlow_GetDFID(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the destination flow ID of the flow specified by flowId.
RMH_Stats_GetRxUnknownProtocolPackets
RMH_Result RMH_Stats_GetRxUnknownProtocolPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unknown packets received by this node.
RMH_PQoSFlow_GetIngressMac
RMH_Result RMH_PQoSFlow_GetIngressMac(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the ingress MAC address of the flow specified by flowId.
RMH_PQoSFlow_GetFlowTag
RMH_Result RMH_PQoSFlow_GetFlowTag(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the tag for the flow specified by flowId. This is optional for application use.
RMH_Stats_GetRxTimeoutErrors
RMH_Result RMH_Stats_GetRxTimeoutErrors(const RMH_Handle handle, uint32_t *response)
Return the total number of packets this node has received with timeout errors.
RMH_ACA_GetDestinationNodeMask
RMH_Result RMH_ACA_GetDestinationNodeMask(const RMH_Handle handle, uint32_t *response)
Return the bitmask of the destination nodes for the last requested ACA. [mocaIfAcaReportNodeMask].
RMH_Log_GetAPILevel
RMH_Result RMH_Log_GetAPILevel(const RMH_Handle handle, uint32_t *response)
Return a bitmask of RMH_LogLevel which indicates the currently enabled RMH log types in the RMH libra...
RMH_Stats_GetRxPacketAggregation
RMH_Result RMH_Stats_GetRxPacketAggregation(const RMH_Handle handle, uint32_t *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return an array indicating the number of packets received per aggregation number.
RMH_PQoS_GetEgressBandwidth
RMH_Result RMH_PQoS_GetEgressBandwidth(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the amount of egress bandwidth available on a particular node.
RMH_Self_GetEnabled
RMH_Result RMH_Self_GetEnabled(const RMH_Handle handle, bool *response)
Return if the MoCA driver is actively connected to or attempting to connect to a MoCA network.
RMH_Log_PrintStatus
RMH_Result RMH_Log_PrintStatus(const RMH_Handle handle, const char *filename)
Print a generic status summary of the MoCA device and network.
RMH_Self_SetPrimaryChannelOffset
RMH_Result RMH_Self_SetPrimaryChannelOffset(const RMH_Handle handle, const int32_t value)
TBD [mocaIfSecondaryChannelOffset].
RMH_Self_SetLowBandwidthLimit
RMH_Result RMH_Self_SetLowBandwidthLimit(const RMH_Handle handle, const uint32_t value)
Set the lower threshold for the PHY link bandwidth between two nodes.
RMH_Stats_GetRxCorrectedErrors
RMH_Result RMH_Stats_GetRxCorrectedErrors(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return the number of received packets from every node with errors which were corrected.
RMH_Stats_GetRxReservationRequestPackets
RMH_Result RMH_Stats_GetRxReservationRequestPackets(const RMH_Handle handle, uint32_t *response)
Return the number of reservation request packets received by this node.
RMH_Self_GetMaxFrameSize
RMH_Result RMH_Self_GetMaxFrameSize(const RMH_Handle handle, uint32_t *response)
The maximum number of bytes this node can receive in one frame.
RMH_Network_GetPrimaryChannelFreq
RMH_Result RMH_Network_GetPrimaryChannelFreq(const RMH_Handle handle, uint32_t *response)
Return the primary MoCA 2.0 channel.
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.
RMH_PQoSFlow_GetEgressMac
RMH_Result RMH_PQoSFlow_GetEgressMac(const RMH_Handle handle, const RMH_MacAddress_t flowId, RMH_MacAddress_t *response)
Return the egress MAC address of the flow specified by flowId.
RMH_RemoteNode_GetBondingCapable
RMH_Result RMH_RemoteNode_GetBondingCapable(const RMH_Handle handle, const uint32_t nodeId, bool *response)
Return if the node indicated by nodeId is bonding capable enabled or not.
RMH_Self_SetTurboEnabled
RMH_Result RMH_Self_SetTurboEnabled(const RMH_Handle handle, const bool value)
Enable or disable turbo mode on this device.
RMH_Network_GetTxMapPhyRate
RMH_Result RMH_Network_GetTxMapPhyRate(const RMH_Handle handle, uint32_t *response)
Return the PHY rate at which MAP packets are transmitted from this node.
RMH_Self_GetQAM256TargetPhyRate
RMH_Result RMH_Self_GetQAM256TargetPhyRate(const RMH_Handle handle, uint32_t *response)
Get the target PHY rate in Mbps.
RMH_Stats_GetRxUnicastPackets
RMH_Result RMH_Stats_GetRxUnicastPackets(const RMH_Handle handle, uint32_t *response)
Return the number of unicast packets received by this node.
RMH_Self_GetLastResetReason
RMH_Result RMH_Self_GetLastResetReason(const RMH_Handle handle, RMH_MoCAResetReason *response)
Return the reason for the most recent link reset [mocaIfResetReason].
RMH_PQoSFlow_GetPacketSize
RMH_Result RMH_PQoSFlow_GetPacketSize(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the packet size in bytes of the flow specified by flowId.
RMH_Interface_GetName
RMH_Result RMH_Interface_GetName(const RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Return the Linux interface name associated with the MoCA device. [mocaIfName].
RMH_Self_GetLOF
RMH_Result RMH_Self_GetLOF(const RMH_Handle handle, uint32_t *response)
The last frequency on which this device operated.
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.
RMH_RemoteNode_GetRxSNR
RMH_Result RMH_RemoteNode_GetRxSNR(const RMH_Handle handle, const uint32_t nodeId, float *response)
The signal to noise ratio of nodeId based on the Type 1 probe from per node.
RMH_Network_GetRemoteNodeIds
RMH_Result RMH_Network_GetRemoteNodeIds(const RMH_Handle handle, RMH_NodeList_Uint32_t *response)
Return a list of every node ID on the network.
RMH_Network_GetMoCAVersion
RMH_Result RMH_Network_GetMoCAVersion(const RMH_Handle handle, RMH_MoCAVersion *response)
Return the version of MoCA under which the network is operating. [mocaIfNetworkVersion].
RMH_Network_GetTxBroadcastPhyRate
RMH_Result RMH_Network_GetTxBroadcastPhyRate(const RMH_Handle handle, uint32_t *response)
Return the PHY rate at which broadcast packets are transmitted from this node.
RMH_Network_GetResetCount
RMH_Result RMH_Network_GetResetCount(const RMH_Handle handle, uint32_t *response)
Returns the number of times the MoCA link has gone down since the last boot. [mocaIfResetCount].
RMH_RemoteNode_GetRxUnicastPower
RMH_Result RMH_RemoteNode_GetRxUnicastPower(const RMH_Handle handle, const uint32_t nodeId, float *response)
Return the power level at which unicast packets are received from nodeId from the self node.
RMH_PQoSFlow_GetLeaseTimeRemaining
RMH_Result RMH_PQoSFlow_GetLeaseTimeRemaining(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the lease time remaining in seconds for the flow specified by flowId.
RMH_PQoSFlow_GetDSCPMoCA
RMH_Result RMH_PQoSFlow_GetDSCPMoCA(const RMH_Handle handle, const RMH_MacAddress_t flowId, uint32_t *response)
Return the DSCP MoCA value for the flow specified by flowId.
RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation
RMH_Result RMH_RemoteNode_GetSecondaryTxUnicastSubcarrierModulation(const RMH_Handle handle, const uint32_t nodeId, const RMH_PERMode perMode, RMH_SubcarrierProfile *responseArray, const size_t responseArraySize, size_t *responseArrayUsed)
Return the unicast transmit subcarrier modulation profiles for the secondary MoCA channel.
RMH_Self_GetTxPowerLimit
RMH_Result RMH_Self_GetTxPowerLimit(const RMH_Handle handle, int32_t *response)
Returns the maximum transmitter power level for this device.
RMH_RemoteNode_GetMaxPacketAggregation
RMH_Result RMH_RemoteNode_GetMaxPacketAggregation(const RMH_Handle handle, const uint32_t nodeId, uint32_t *response)
Return the maximum number of packets for aggregated transmissions for the node indicated by nodeId.
RMH_Self_GetMaxAllocationElements
RMH_Result RMH_Self_GetMaxAllocationElements(const RMH_Handle handle, uint32_t *response)
Return the maximum number of allocation elements, excluding the TAUs and the Dummy DAUs,...
RMH_Self_SetSecondaryChannelOffset
RMH_Result RMH_Self_SetSecondaryChannelOffset(const RMH_Handle handle, const int32_t value)
TBD [mocaIfSecondaryChannelOffset].
RMH_Stats_GetTxLinkControlPackets
RMH_Result RMH_Stats_GetTxLinkControlPackets(const RMH_Handle handle, uint32_t *response)
Return the number of link control transmitted by this node.
RMH_RemoteNode_GetActiveMoCAVersion
RMH_Result RMH_RemoteNode_GetActiveMoCAVersion(const RMH_Handle handle, const uint32_t nodeId, RMH_MoCAVersion *response)
Return the active supported version of MoCA by the remote node specificed by nodeId.
RMH_ACAStatusToString
const char *const RMH_ACAStatusToString(const RMH_ACAStatus value)
Convert ACA status to a printable string.
Definition: librmh_api_no_wrap.c:104
RMH_ACATypeToString
const char *const RMH_ACATypeToString(const RMH_ACAType value)
Convert value to a printable string.
Definition: librmh_api_no_wrap.c:100
RMH_Self_GetPrivacyMACManagementKey
RMH_Result RMH_Self_GetPrivacyMACManagementKey(RMH_Handle handle, char *responseBuf, const size_t responseBufSize)
Get the SHA1 hash of the MoCA password as an ASCII string. [mocaIfPasswordHash].
RMH_Self_GetQAM256Enabled
RMH_Result RMH_Self_GetQAM256Enabled(const RMH_Handle handle, bool *response)
Return if this device is set as QAM256 capable in admission negotiations.