elemy-sensortree 1.0.0
Macros | Functions
el_sensorsnode_blob.h File Reference

Parse blob (blobmsg) and create blob (blobmsg) for el_sensorsnode.h types. More...

#include <libubox/blobmsg.h>
#include "elutils/el_utils.h"
#include "elsensortree/el_sensorsnode.h"
#include "elutils/c_decls.h"
Include dependency graph for el_sensorsnode_blob.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE   (1)
 
#define ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE_MSG   "Can't open table FW_VERSION_KEY"
 
#define ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA   (2)
 
#define ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA_MSG   "Error on adding data to table FW_VERSION_KEY"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE   (1)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE_MSG   "Can't parse NODE_FW_VERSION"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH   (2)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH_MSG   "Can't get NODE_FW_VERSION_SW_PATCH"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR   (3)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR_MSG   "Can't get NODE_FW_VERSION_SW_MINOR"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR   (4)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR_MSG   "Can't get NODE_FW_VERSION_SW_MAJOR"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT   (5)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT_MSG   "Can't get NODE_FW_VERSION_BOOT"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION   (6)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION_MSG   "Can't get NODE_FW_VERSION_HW_REVISION"
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL   (7)
 
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL_MSG   "Can't get NODE_FW_VERSION_PROTOCOL"
 
#define SENSOR_VALUE_ANALOG_VALUE_2KEY   "analog_value"
 
#define SENSOR_VALUE_DISCRETE_VALUE_2KEY   "discrete_value"
 
#define SENSOR_VALUE_DISCRETE_COUNT_2KEY   "discrete_count"
 
#define SENSORS_NODE_VALUES_COUNT   "values_cnt"
 

Functions

__BEGIN_DECLS int ps_blobmsg_parse (const struct blobmsg_policy *policy, int policy_len, struct blob_attr **tb, void *data, unsigned int len)
 
void dump_blob_attr (struct blob_attr *attr, char *msg)
 
int ps_parse_blob (const struct blobmsg_policy *policy, int cnt_policy, struct blob_attr **attrs, struct blob_attr *attr, char **err_msg)
 
int get_table_field (struct blob_attr *attr, char *field_name, int type, struct blob_attr **res, char **err_msg)
 
int blob_node_fw_version (struct blob_buf *bb, node_fw_version_t *p, bool named, char **err_msg)
 put into blob_buf node_fw_version_t as table More...
 
int unblob_node_fw_version (node_fw_version_t *p, struct blob_attr *attr, char **err_msg)
 put into blob_buf node_fw_version_t as table More...
 
int unblob_node_addr (node_addr_t *p, struct blob_attr *attr, char **err_msg)
 
int blob_node_addr (struct blob_buf *bb, node_addr_t *p)
 
int unblob_node_serial_num (node_serial_num_t *p, struct blob_attr *attr, char **err_msg)
 
int blob_node_serial_num (struct blob_buf *bb, node_serial_num_t *p)
 
int unblob_node_info (node_info_t *p, struct blob_attr *attr, char **err_msg)
 
int blob_node_info (struct blob_buf *bb, node_info_t *p)
 
int get_node_info (struct blob_attr *attr, struct blob_attr **res, char **err_msg)
 extract ptr to node_info attr from table object by name NODE_INFO_KEY More...
 
int unblob_sensor_value (sensor_value_t *p, struct blob_attr *attr, char **err_msg)
 
int blob_sensor_value (struct blob_buf *bb, sensor_value_t *p, char *name)
 
int unblob_sensors_node (sensors_node_t *p, struct blob_attr *attr, char **err_msg)
 
int blob_sensors_node (struct blob_buf *bb, sensors_node_t *p, int named)
 

Detailed Description

Parse blob (blobmsg) and create blob (blobmsg) for el_sensorsnode.h types.

Created on: 10 апр. 2024 г. Author: ps

Macro Definition Documentation

◆ ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA

#define ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA   (2)

◆ ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA_MSG

#define ERR_BLOB_NODE_FW_VERSION_BAD_ADD_DATA_MSG   "Error on adding data to table FW_VERSION_KEY"

◆ ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE

#define ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE   (1)

◆ ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE_MSG

#define ERR_BLOB_NODE_FW_VERSION_BAD_OPEN_TABLE_MSG   "Can't open table FW_VERSION_KEY"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT   (5)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_BOOT_MSG   "Can't get NODE_FW_VERSION_BOOT"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION   (6)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_HW_REVISION_MSG   "Can't get NODE_FW_VERSION_HW_REVISION"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL   (7)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_PROTOCOL_MSG   "Can't get NODE_FW_VERSION_PROTOCOL"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR   (4)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MAJOR_MSG   "Can't get NODE_FW_VERSION_SW_MAJOR"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR   (3)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_MINOR_MSG   "Can't get NODE_FW_VERSION_SW_MINOR"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH   (2)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_GET_SW_PATCH_MSG   "Can't get NODE_FW_VERSION_SW_PATCH"

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE   (1)

◆ ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE_MSG

#define ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE_MSG   "Can't parse NODE_FW_VERSION"

◆ SENSOR_VALUE_ANALOG_VALUE_2KEY

#define SENSOR_VALUE_ANALOG_VALUE_2KEY   "analog_value"

◆ SENSOR_VALUE_DISCRETE_COUNT_2KEY

#define SENSOR_VALUE_DISCRETE_COUNT_2KEY   "discrete_count"

◆ SENSOR_VALUE_DISCRETE_VALUE_2KEY

#define SENSOR_VALUE_DISCRETE_VALUE_2KEY   "discrete_value"

◆ SENSORS_NODE_VALUES_COUNT

#define SENSORS_NODE_VALUES_COUNT   "values_cnt"

Function Documentation

◆ blob_node_addr()

int blob_node_addr ( struct blob_buf *  bb,
node_addr_t p 
)
Here is the caller graph for this function:

◆ blob_node_fw_version()

int blob_node_fw_version ( struct blob_buf *  bb,
node_fw_version_t *  p,
bool  named,
char **  err_msg 
)

put into blob_buf node_fw_version_t as table

Parameters
bbptr to struct blob_buf to add data to
pptr to source node_fw_version_t
Returns
on success 0
on error error_code from header. In this case into err_msg will put ptr to error message.
Here is the caller graph for this function:

◆ blob_node_info()

int blob_node_info ( struct blob_buf *  bb,
node_info_t p 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ blob_node_serial_num()

int blob_node_serial_num ( struct blob_buf *  bb,
node_serial_num_t *  p 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ blob_sensor_value()

int blob_sensor_value ( struct blob_buf *  bb,
sensor_value_t *  p,
char *  name 
)
Here is the caller graph for this function:

◆ blob_sensors_node()

int blob_sensors_node ( struct blob_buf *  bb,
sensors_node_t *  p,
int  named 
)
Here is the call graph for this function:

◆ dump_blob_attr()

void dump_blob_attr ( struct blob_attr *  attr,
char *  msg 
)
Here is the caller graph for this function:

◆ get_node_info()

int get_node_info ( struct blob_attr *  attr,
struct blob_attr **  res,
char **  err_msg 
)

extract ptr to node_info attr from table object by name NODE_INFO_KEY

Parameters
attrptr to table where search NODE_INFO_KEY field \err_msg holder for error message
Returns
0 on success and *res ptr to NODE_INFO_KEY attr
-1 on error and *err_msg ptr to error message

◆ get_table_field()

int get_table_field ( struct blob_attr *  attr,
char *  field_name,
int  type,
struct blob_attr **  res,
char **  err_msg 
)

◆ ps_blobmsg_parse()

__BEGIN_DECLS int ps_blobmsg_parse ( const struct blobmsg_policy *  policy,
int  policy_len,
struct blob_attr **  tb,
void *  data,
unsigned int  len 
)
Here is the call graph for this function:

◆ ps_parse_blob()

int ps_parse_blob ( const struct blobmsg_policy *  policy,
int  cnt_policy,
struct blob_attr **  attrs,
struct blob_attr *  attr,
char **  err_msg 
)

◆ unblob_node_addr()

int unblob_node_addr ( node_addr_t p,
struct blob_attr *  attr,
char **  err_msg 
)
Here is the caller graph for this function:

◆ unblob_node_fw_version()

int unblob_node_fw_version ( node_fw_version_t *  p,
struct blob_attr *  attr,
char **  err_msg 
)

put into blob_buf node_fw_version_t as table

Parameters
pptr to node_fw_version_t target to fill
attrptr to blob_attr with object data node_fw_version_t
err_msgif not NULL ptr to return error message if return != 0
Returns
on success 0
on error. error_code from header. In this case into err_msg will put ptr to error message.
Here is the caller graph for this function:

◆ unblob_node_info()

int unblob_node_info ( node_info_t p,
struct blob_attr *  attr,
char **  err_msg 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unblob_node_serial_num()

int unblob_node_serial_num ( node_serial_num_t *  p,
struct blob_attr *  attr,
char **  err_msg 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unblob_sensor_value()

int unblob_sensor_value ( sensor_value_t *  p,
struct blob_attr *  attr,
char **  err_msg 
)
Here is the caller graph for this function:

◆ unblob_sensors_node()

int unblob_sensors_node ( sensors_node_t *  p,
struct blob_attr *  attr,
char **  err_msg 
)
Here is the call graph for this function: