TR181-XPON  1.4.0
TR-181 PON manager.
pon_cfg.c File Reference
#include "pon_cfg.h"
#include <amxc/amxc.h>
#include "xpon_trace.h"
#include "data_model.h"

Go to the source code of this file.

Functions

int pon_cfg_get_param_value (const char *function_name, amxc_var_t *args, amxc_var_t *ret)
 

Function Documentation

◆ pon_cfg_get_param_value()

int pon_cfg_get_param_value ( const char *  function_name,
amxc_var_t *  args,
amxc_var_t *  ret 
)

Allow vendor module for ask a parameters value from the data model.

Parameters
[in]pathpath of the object containing the parameter
[in]argshtable of function arguments. The following keys are required: path (cstring): path to object containing the parameter name (cstring): parameter name
[in,out]retfunction returns result via this parameter. This will be a variant with the type matching the data model.
Returns
0 on success, -1 upon error

Definition at line 85 of file pon_cfg.c.

87  {
88 
89  const char* const path = GET_CHAR(args, "path");
90  const char* const name = GET_CHAR(args, "name");
91 
92  SAH_TRACEZ_DEBUG(ME, "func='%s' path='%s', name='%s'", function_name, path, name);
93 
94  if(!dm_get_param(path, name, ret)) {
95  SAH_TRACEZ_ERROR(ME, "failed to retrieve %s from DM", name);
96  return -1;
97  }
98 
99  return 0;
100 }
bool dm_get_param(const char *path, const char *name, amxc_var_t *resp)
Definition: data_model.c:1204
#define SAH_TRACEZ_DEBUG(zone, format,...)
Definition: xpon_trace.h:115
#define ME
Definition: xpon_trace.h:78
Here is the call graph for this function: