RDK Documentation (Open Sourced RDK Components)
rmh_app.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 
20 /* Define for strcasestr */
21 #define _GNU_SOURCE
22 
23 #include <signal.h>
24 #include <stdarg.h>
25 #include "rmh_app.h"
26 
27 #define MAX_DISPLAY_COLUMN_WIDTH 80
28 #define RMH_PrintMsgWrapped(prefix, fmt, ...) RMHApp_PrintWrapped(app, RMH_LOG_MESSAGE, __FUNCTION__, __LINE__, prefix, fmt, ##__VA_ARGS__);
29 
30 
31 /***********************************************************
32  * Search Functions
33  ***********************************************************/
34 static
35 const RMHApp_API* RMHApp_FindHandler(const RMHApp *app, const char *apiName) {
36  uint32_t i;
37  for (i=0; i != app->handledAPIs.apiListSize; i++) {
38  if (strcasecmp(app->handledAPIs.apiList[i].apiName, apiName) == 0) {
39  return &app->handledAPIs.apiList[i];
40  }
41  }
42 
43  /* We didn't find it on our first pass. Check the alias'' */
44  for (i=0; i != app->handledAPIs.apiListSize; i++) {
45  if (!app->handledAPIs.apiList[i].apiAlias || strlen(app->handledAPIs.apiList[i].apiAlias) == 0) continue;
46 
47  char* alias=strdup(app->handledAPIs.apiList[i].apiAlias);
48  if (!alias) continue;
49  char *token = strtok(alias, ",");
50  while(token) {
51  if (strcasecmp(token, apiName) == 0) {
52  free(alias);
53  return &app->handledAPIs.apiList[i];
54  }
55  token = strtok(NULL, ",");
56  }
57  free(alias);
58  }
59  return NULL;
60 }
61 
62 static
63 const RMH_API* RMHApp_FindAPI(const RMHApp *app, const char *apiName) {
64  uint32_t i;
65  for (i=0; i != app->allAPIs->apiListSize; i++) {
66  if (strcasecmp(app->allAPIs->apiList[i]->apiName, apiName) == 0) {
67  return app->allAPIs->apiList[i];
68  }
69  }
70 
71  for (i=0; i != app->local.apiListSize; i++) {
72  if (strcasecmp(app->local.apiList[i]->apiName, apiName) == 0) {
73  return app->local.apiList[i];
74  }
75  }
76  return NULL;
77 }
78 
79 static
80 RMH_Result RMHApp_FindSimilarAPIs(const RMHApp *app, const char *searchString, RMH_APIList *closeMatch) {
81  uint32_t i, j;
82  if (closeMatch) {
83  closeMatch->apiListSize=0;
84  for (i=0; i != app->allAPIs->apiListSize; i++) {
85  RMH_API* api=app->allAPIs->apiList[i];
86  if (strcasestr(api->apiName, searchString) != NULL) {
87  closeMatch->apiList[closeMatch->apiListSize++]=api;
88  }
89  else if (strcasestr(api->apiDefinition, searchString) != NULL) {
90  closeMatch->apiList[closeMatch->apiListSize++]=api;
91  }
92  else if (strcasestr(api->apiDescription, searchString) != NULL) {
93  closeMatch->apiList[closeMatch->apiListSize++]=api;
94  }
95  else if (strcasestr(api->tags, searchString) != NULL) {
96  closeMatch->apiList[closeMatch->apiListSize++]=api;
97  }
98  else {
99  for (j=0; j != api->apiNumParams; j++) {
100  if (strcasestr(api->apiParams[j].desc, searchString) != NULL) {
101  closeMatch->apiList[closeMatch->apiListSize++]=api;
102  }
103  }
104  }
105  }
106  }
107  return (closeMatch && closeMatch->apiListSize) ? RMH_SUCCESS : RMH_FAILURE;
108 }
109 
110 /***********************************************************
111  * Print Functions
112  ***********************************************************/
113 static
114 void RMHApp_PrintWrapped(RMHApp *app, const RMH_LogLevel level, const char *filename, const uint32_t lineNumber, const char *prefix, const char *format, ...) {
115  va_list args;
116  va_start(args, format);
117  char *string;
118  vasprintf (&string, format, args);
119 
120  //char* string=strdup(inStr);
121  if (string) {
122  char *lastBreak = string;
123  char *printEnd = string;
124  char *printStart=NULL;
125  char *lastFoundSpace=NULL;
126  int length = strlen(string);
127  int maxWidth = MAX_DISPLAY_COLUMN_WIDTH - strlen(prefix);
128 
129  while(length>0) {
130  lastFoundSpace=NULL;
131  printStart=NULL;
132  while (true) {
133  if( !printStart && *printEnd != ' ' ) printStart = printEnd;
134  if (*printEnd == '\0' || *printEnd == '\n') break;
135 
136  if( *printEnd == ' ' ) lastFoundSpace=printEnd;
137  if ( printStart && lastFoundSpace && (printEnd >= printStart+maxWidth)) {
138  printEnd = lastFoundSpace; /* Found a wrap point, back up to last space */
139  break;
140  }
141  printEnd++;
142  }
143 
144  *printEnd++ = '\0';
145  if (printStart) RMH_PrintMsg("%s%s\n", prefix, printStart);
146  length -= printEnd-lastBreak;
147  lastBreak = printEnd;
148  }
149  free(string);
150  }
151 
152  va_end(args);
153 }
154 
155 static
156 RMH_Result RMHApp_PrintHelp(RMHApp *app) {
157  RMH_PrintMsg("usage: rmh [-?|-h|--help] [-t|--trace] [-d|--debug] [-s|--search] [-l|--list]\n");
158  RMH_PrintMsg(" <API> [<args>]\n");
159  RMH_PrintMsg("\n");
160  RMH_PrintMsg(" --help Print this help message\n");
161  RMH_PrintMsg(" --list Print a list of all available RMH APIs\n");
162  RMH_PrintMsg(" --debug Monitor MoCA driver level debug logs\n");
163  RMH_PrintMsg(" --trace Enable API trace messages\n");
164  RMH_PrintMsg(" --search Print a menu of all APIs matching the string passed as <API>\n");
165  RMH_PrintMsg("\n");
166  RMH_PrintMsg("'rmh --help <API>' will show detailed information about what that API does\n");
167  RMH_PrintMsg("\n");
168  RMH_PrintMsg("You can run 'rmh' with no parameters to see a menu of available APIs.\n");
169  RMH_PrintMsg("\n");
170  RMH_PrintMsg("\n");
171  return RMH_SUCCESS;
172 }
173 
174 static
175 RMH_Result RMHApp_PrintAPIHelp(RMHApp *app, const RMH_API* api) {
176  int i;
177  bool first = true;
178  char rmh_args[512];
179  int rmh_args_written =0;
180  const RMHApp_API *apiHandler=RMHApp_FindHandler(app, api->apiName);
181  rmh_args[0] = '\0';
182 
183  RMH_PrintMsg("****************************************\n");
184  RMH_PrintMsg("API:\n");
185  RMH_PrintMsg(" %s\n\n", api->apiName);
186 
187  RMH_PrintMsg("ALIAS:\n");
188  if (apiHandler && apiHandler->apiAlias) {
189  RMH_PrintMsg(" %s\n\n", apiHandler->apiAlias);
190  }
191  else {
192  RMH_PrintMsg(" None\n\n");
193  }
194 
195  if (api->apiDefinition) {
196  RMH_PrintMsg("DECLARATION:\n");
197  RMH_PrintMsg(" %s\n\n", api->apiDefinition);
198  }
199 
200  if (api->apiDescription) {
201  RMH_PrintMsg("DESCRIPTION:\n");
202  RMH_PrintMsgWrapped(" ", "%s\n\n", api->apiDescription);
203  }
204 
205  first = true;
206  for (i=0; i != api->apiNumParams; i++) {
207  if (api->apiParams[i].direction == RMH_INPUT_PARAM) {
208  if (first) {
209  RMH_PrintMsg("INPUT PARAMETERS:\n");
210  first = false;
211  }
212  RMH_PrintMsg(" <%s>\n", api->apiParams[i].name);
213  RMH_PrintMsgWrapped(" ", "%s\n\n", api->apiParams[i].desc);
214  if ((rmh_args_written != 0 || strstr(api->apiParams[i].type, "RMH_Handle") == NULL) &&
215  (sizeof(rmh_args)/sizeof(rmh_args[0]) - rmh_args_written > 0))
216  {
217  rmh_args_written += sprintf( &rmh_args[rmh_args_written], "<%s> ", api->apiParams[i].name);
218  }
219  }
220  }
221  first = true;
222  for (i=0; i != api->apiNumParams; i++) {
223  if (api->apiParams[i].direction == RMH_OUTPUT_PARAM) {
224  if (first) {
225  RMH_PrintMsg("OUTPUT PARAMETERS:\n");
226  first = false;
227  }
228  RMH_PrintMsg(" <%s>\n", api->apiParams[i].name);
229  RMH_PrintMsgWrapped(" ", "%s\n\n", api->apiParams[i].desc);
230  }
231  }
232 
233  if (apiHandler) {
234  RMH_PrintMsg("USAGE:\n");
235  RMH_PrintMsg(" rmh %s %s\n\n", api->apiName, rmh_args);
236  }
237  RMH_PrintMsg("****************************************\n\n\n");
238  return RMH_SUCCESS;
239 }
240 
241 static
242 RMH_Result RMHApp_PrintList(RMHApp *app, const RMH_APIList *list, const char *exitString) {
243  uint32_t i;
244  RMH_PrintMsg("\n\n");
245  RMH_PrintMsg("%02d. %s\n", 1, exitString);
246  if (list) {
247  for (i=0; i != list->apiListSize; i++) {
248  RMH_PrintMsg("%02d. %s\n", i+2, list->apiList[i]->apiName);
249  }
250  }
251  return RMH_SUCCESS;
252 }
253 
254 static
255 RMH_Result RMHApp_PrintTagList(RMHApp *app, const RMH_APITagList *tagList) {
256  uint32_t i;
257  RMH_PrintMsg("\n\n");
258  RMH_PrintMsg("%02d. %s\n", 1, "Exit");
259  RMH_PrintMsg("%02d. %s\n", 2, "All APIs");
260  RMH_PrintMsg("%02d. %s\n", 3, "SoC Unimplemented APIs");
261  RMH_PrintMsg("%02d. %s\n", 4, "RMH Local APIs");
262  if (tagList) {
263  for (i=0; i != tagList->tagListSize; i++) {
264  RMH_PrintMsg("%02d. %s\n", i+5, tagList->tagList[i].apiListName);
265  }
266  }
267  return RMH_SUCCESS;
268 }
269 
270 
271 
272 /***********************************************************
273  * Execution Functions
274  ***********************************************************/
275 static RMHApp* gIntApp=NULL;
276 static
277 void RMHApp_CleanupOnInt(int sig) {
278  if (gIntApp) {
279  RMH_Log_SetDriverLevel(gIntApp->rmh, gIntApp->driverLogLevel);
280  RMH_Destroy(gIntApp->rmh);
281  }
282  exit(0);
283 }
284 
285 static
286 RMH_Result RMHApp_ExecuteMonitorDriverDebug(RMHApp *app) {
287  gIntApp=app;
288  signal(SIGINT, RMHApp_CleanupOnInt);
289 
290  RMH_PrintMsg("Monitoring for callbacks and MoCA logs. Press enter to exit...\n");
291  if (RMH_SetEventCallbacks(app->rmh, RMH_EVENT_DRIVER_PRINT) != RMH_SUCCESS) {
292  RMH_PrintErr("Failed to set callback events! Unable to monitor\n");
293  return RMH_FAILURE;
294  }
295 
296  if (RMH_Log_GetDriverLevel(app->rmh, &app->driverLogLevel) != RMH_SUCCESS) {
297  RMH_PrintWrn("Failed to get driver log level. Assuming default!\n");
298  app->driverLogLevel = RMH_LOG_DEFAULT;
299  }
300 
301  if (RMH_Log_SetDriverLevel(app->rmh, app->driverLogLevel | RMH_LOG_DEBUG) != RMH_SUCCESS) {
302  RMH_PrintErr("Failed to set log level to include RMH_LOG_DEBUG!\n");
303  return RMH_FAILURE;
304  }
305  fgetc(stdin);
306 
307  RMH_Log_SetDriverLevel(app->rmh, app->driverLogLevel);
308  return RMH_SUCCESS;
309 }
310 
311 static
312 RMH_Result RMHApp_ExecuteAPIList(RMHApp *app, const RMH_APIList *list, const char *exitString) {
313  uint32_t option;
314  bool helpRequested = false;
315 
316  RMHApp_PrintList(app, list, exitString);
317  while(true) {
318  if (RMHApp_ReadMenuOption(app, &option, true, &helpRequested) == RMH_SUCCESS) {
319  if ( option > 0) {
320  if ( option == 1 ) break;
321  option-=2;
322 
323  if (list && option<list->apiListSize) {
324  RMH_Result ret;
325  const RMH_API* api = list->apiList[option];
326  if (app->argHelpRequested || helpRequested) {
327  RMHApp_PrintAPIHelp(app, api);
328  continue;
329  }
330  RMH_PrintMsg(" ----------------------------------------------------------------------------\n");
331  RMH_PrintMsg("|%s\n", api->apiName);
332  RMH_PrintMsg("|----------------------------------------------------------------------------\n");
333  app->appPrefix="| ";
334 
335  const RMHApp_API *apiHandler=RMHApp_FindHandler(app, api->apiName);
336  if (apiHandler == NULL) {
337  RMH_PrintErr("The RMH library supports '%s' however it has not been exposed in RMH!\n", api->apiName);
338  RMH_PrintErr("Please add a handler function for this API in the rmh test by using SET_API_HANDLER()\n");
339  ret = RMH_FAILURE;
340  }
341  else {
342  ret = apiHandler->apiHandlerFunc(app, apiHandler->apiFunc);
343  }
344  if (ret != RMH_SUCCESS) {
345  RMH_PrintErr("Failed with error: %s!\n", RMH_ResultToString(ret));
346  }
347  app->appPrefix=NULL;
348  RMH_PrintMsg(" ----------------------------------------------------------------------------\n\n\n");
349  continue;
350  }
351  }
352  RMH_PrintErr("Invalid selection\n");
353  }
354  RMHApp_PrintList(app, list, exitString);
355 
356  }
357  return RMH_SUCCESS;
358 }
359 
360 static
361 RMH_Result RMHApp_ExecuteCommand(RMHApp *app) {
362  const RMH_API* api;
363  if (app->argPrintMatch) {
364  RMH_APIList closeMatch;
365  RMHApp_FindSimilarAPIs(app, app->argRunCommand, &closeMatch);
366  if (closeMatch.apiListSize == 0) {
367  RMH_PrintErr("RMH has no API named '%s' and no other API seem to be related to this\n", app->argRunCommand);
368  return RMH_FAILURE;
369  }
370 
371  /* We're done with the command, transition to interactive mode */
372  app->argRunCommand=NULL;
373  return RMHApp_ExecuteAPIList(app, &closeMatch, "Exit");
374  }
375 
376 
377  const RMHApp_API* apiHandler=RMHApp_FindHandler(app, app->argRunCommand);
378  if (app->argHelpRequested) {
379  api = RMHApp_FindAPI(app, apiHandler ? apiHandler->apiName : app->argRunCommand);
380  if (api == NULL) {
381  RMH_PrintErr("RMH has no API named '%s'\n", app->argRunCommand);
382  return RMH_FAILURE;
383  }
384  return RMHApp_PrintAPIHelp(app, api);
385  }
386  else {
387  if (apiHandler == NULL) {
388  api=RMHApp_FindAPI(app, app->argRunCommand);
389  if (api == NULL) {
390  RMH_PrintErr("RMH has no API named '%s'\n", app->argRunCommand);
391  return RMH_FAILURE;
392  }
393  RMH_PrintErr("RMH has supports the API '%s' however it has not been exposed in RMH. Please add a handler function for this API in the rmh test by using SET_API_HANDLER()\n", app->argRunCommand);
394  return RMH_FAILURE;
395  }
396  return apiHandler->apiHandlerFunc(app, apiHandler->apiFunc);
397  }
398 }
399 
400 static
401 RMH_Result RMHApp_ExecuteTagList(RMHApp *app, const RMH_APITagList *tagList) {
402  uint32_t option;
403 
404  RMH_SetEventCallbacks(app->rmh, RMH_EVENT_LINK_STATUS_CHANGED | RMH_EVENT_MOCA_VERSION_CHANGED | RMH_EVENT_API_PRINT);
405  RMHApp_PrintTagList(app, tagList);
406  while(true) {
407  if (RMHApp_ReadMenuOption(app, &option, false, NULL)==RMH_SUCCESS){
408  if ( option > 0 ) {
409  if ( option == 1 )
410  break;
411  else if (option==2) {
412  RMHApp_ExecuteAPIList(app, app->allAPIs, "Go back");
413  }
414  else if (option==3) {
415  RMHApp_ExecuteAPIList(app, app->unimplementedAPIs, "Go back");
416  }
417  else if (option==4) {
418  RMHApp_ExecuteAPIList(app, &app->local, "Go back");
419  }
420  else {
421  option-=5;
422  if (tagList && option < tagList->tagListSize) {
423  RMHApp_ExecuteAPIList(app, &tagList->tagList[option], "Go back");
424  }
425  }
426  }
427  RMH_PrintErr("Invalid selection\n");
428  }
429  RMHApp_PrintTagList(app, tagList);
430  }
431  return RMH_SUCCESS;
432 }
433 
434 /***********************************************************
435  * Util Functions
436  ***********************************************************/
437 static
438 void RMHApp_EventCallback(const enum RMH_Event event, const struct RMH_EventData *eventData, void* userContext){
439  RMHApp *app=(RMHApp *)userContext;
440  switch(event) {
441  case RMH_EVENT_LINK_STATUS_CHANGED:
442  RMH_PrintMsg("\n%p: Link status changed to %s\n", userContext, RMH_LinkStatusToString(eventData->RMH_EVENT_LINK_STATUS_CHANGED.status));
443  break;
444  case RMH_EVENT_MOCA_VERSION_CHANGED:
445  RMH_PrintMsg("\n%p: MoCA Version Changed to %s\n", userContext, RMH_MoCAVersionToString(eventData->RMH_EVENT_MOCA_VERSION_CHANGED.version));
446  break;
447  case RMH_EVENT_API_PRINT:
448  RMH_PrintMsg("%s", eventData->RMH_EVENT_API_PRINT.logMsg);
449  break;
450  case RMH_EVENT_DRIVER_PRINT:
451  RMH_PrintMsg("%s", eventData->RMH_EVENT_DRIVER_PRINT.logMsg);
452  break;
453  default:
454  RMH_PrintWrn("Unhandled MoCA event %u!\n", event);
455  break;
456  }
457 }
458 
459 static
460 RMH_Result RMHApp_ParseOptions(RMHApp *app) {
461  RMHApp_ReadNextArg(app); /* First read to drop program name */
462 
463  do{
464  const char* option=RMHApp_ReadNextArg(app);
465  if (!option) break;
466 
467  if (option[0] == '-') {
468  if (strcmp(option, "-d") == 0 || strcmp(option, "--debug") == 0) {
469  app->argMonitorDriverDebug = true;
470  } else if (strcmp(option, "-t") == 0 || strcmp(option, "--trace") == 0) {
471  app->apiLogLevel |= RMH_LOG_TRACE;
472  } else if (strcmp(option, "-?") == 0 || strcmp(option, "-h") == 0 || strcmp(option, "--help") == 0) {
473  app->argHelpRequested = true;
474  } else if (strcmp(option, "-s") == 0 || strcmp(option, "--search") == 0) {
475  app->argPrintMatch = true;
476  } else if (strcmp(option, "-l") == 0 || strcmp(option, "--list") == 0) {
477  app->argPrintApis = true;
478  }
479  else {
480  RMH_PrintWrn("Unknown option '%s'! Skipping\n", option);
481  break;
482  }
483  }
484  else {
485  app->argRunCommand = option;
486  break;
487  }
488  } while(true);
489 
490  return RMH_SUCCESS;
491 }
492 
493 
494 
495 /***********************************************************
496  * Main
497  ***********************************************************/
498 int main(int argc, char *argv[])
499 {
500  RMHApp appStr;
501  RMHApp* app=&appStr;
502  RMH_Result result;
503 
504  memset(app, 0, sizeof(*app));
505  app->apiLogLevel = RMH_LOG_DEFAULT;
506  app->argc=argc;
507  app->argv=argv;
508  RMHApp_ParseOptions(app);
509 
510  app->rmh=RMH_Initialize(RMHApp_EventCallback, app);
511  if (!app->rmh){
512  RMH_PrintErr("Failed in RMH_Initialize!\n");
513  return RMH_FAILURE;
514  }
515 
516  if (RMH_GetAllAPIs(app->rmh, &app->allAPIs) != RMH_SUCCESS) {
517  RMH_PrintErr("Failed to get list of all APIs!\n");
518  return RMH_FAILURE;
519  }
520 
521  if (RMH_Log_SetAPILevel(app->rmh, app->apiLogLevel ) != RMH_SUCCESS) {
522  RMH_PrintErr("Failed to set the log level!\n");
523  }
524 
525  if (RMH_SetEventCallbacks(app->rmh, RMH_EVENT_API_PRINT) != RMH_SUCCESS) {
526  RMH_PrintErr("Failed to set event callbacks!\n");
527  }
528 
529  if (RMH_GetUnimplementedAPIs(app->rmh, &app->unimplementedAPIs) != RMH_SUCCESS) {
530  RMH_PrintErr("Failed to get list of all unimplemented APIs!\n");
531  }
532 
533  if (RMH_GetAPITags(app->rmh, &app->rmhAPITags) != RMH_SUCCESS) {
534  RMH_PrintErr("Failed to get list of all API tags!\n");
535  }
536 
537  RMHApp_RegisterAPIHandlers(app);
538 
539  if (app->argRunCommand) {
540  result = RMHApp_ExecuteCommand(app);
541  }
542  else if (app->argPrintApis) {
543  uint32_t i;
544  for (i=0; i != app->allAPIs->apiListSize; i++) {
545  RMH_PrintMsg("%s\n", app->allAPIs->apiList[i]->apiName);
546  if (app->argHelpRequested) {
547  RMH_PrintMsgWrapped(" ", "%s\n\n", app->allAPIs->apiList[i]->apiDescription);
548  }
549  }
550  result=RMH_SUCCESS;
551  }
552  else if (app->argMonitorDriverDebug) {
553  result = RMHApp_ExecuteMonitorDriverDebug(app);
554  }
555  else if (app->argHelpRequested) {
556  result=RMHApp_PrintHelp(app);
557  }
558  else {
559  result = RMHApp_ExecuteTagList(app, app->rmhAPITags);
560  }
561 
562  RMH_Destroy(app->rmh);
563  return result;
564 }
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_GetAPITags
RMH_Result RMH_GetAPITags(const RMH_Handle handle, RMH_APITagList **apiTags)
Return the list of all RMH APIs grouped into lists by their tags.
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_GetAllAPIs
RMH_Result RMH_GetAllAPIs(const RMH_Handle handle, RMH_APIList **apiList)
Return a list of all APIs which are part of RMH.
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_APITagList
Definition: rmh_type.h:240
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_GetUnimplementedAPIs
RMH_Result RMH_GetUnimplementedAPIs(const RMH_Handle handle, RMH_APIList **apiList)
Return a list of all RMH APIs which are unimplemented by the SoC library.
RMH_EventData
Definition: rmh_type.h:157
RMHApp
Definition: rmh_app.h:50
RMHApp_API
Definition: rmh_app.h:38
RMH_APIList
Definition: rmh_type.h:234
RMH_Initialize
RMH_Handle RMH_Initialize(const RMH_EventCallback eventCB, void *userContext)
Initialize the RMH library and return a handle to the instance.
Definition: librmh_api_no_wrap.c:23
RMH_API
Definition: rmh_type.h:222
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_Log_SetAPILevel
RMH_Result RMH_Log_SetAPILevel(const RMH_Handle handle, const uint32_t value)
Set the log level of the RMH library.
RMH_SetEventCallbacks
RMH_Result RMH_SetEventCallbacks(RMH_Handle handle, const uint32_t value)
Set the list of callbacks you wish to receive.
RMH_Destroy
RMH_Result RMH_Destroy(RMH_Handle handle)
Destroy the instance of RMH library which was created by RMH_Initialize.