elemy-sensortree 1.0.0
|
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"
Go to the source code of this file.
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) |
Parse blob (blobmsg) and create blob (blobmsg) for el_sensorsnode.h types.
Created on: 10 апр. 2024 г. Author: ps
#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_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_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 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_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_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_PARSE (1) |
#define ERR_UNBLOB_NODE_FW_VERSION_BAD_PARSE_MSG "Can't parse NODE_FW_VERSION" |
#define SENSOR_VALUE_ANALOG_VALUE_2KEY "analog_value" |
#define SENSOR_VALUE_DISCRETE_COUNT_2KEY "discrete_count" |
#define SENSOR_VALUE_DISCRETE_VALUE_2KEY "discrete_value" |
#define SENSORS_NODE_VALUES_COUNT "values_cnt" |
int blob_node_addr | ( | struct blob_buf * | bb, |
node_addr_t * | p | ||
) |
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
bb | ptr to struct blob_buf to add data to |
p | ptr to source node_fw_version_t |
int blob_node_info | ( | struct blob_buf * | bb, |
node_info_t * | p | ||
) |
int blob_node_serial_num | ( | struct blob_buf * | bb, |
node_serial_num_t * | p | ||
) |
int blob_sensor_value | ( | struct blob_buf * | bb, |
sensor_value_t * | p, | ||
char * | name | ||
) |
int blob_sensors_node | ( | struct blob_buf * | bb, |
sensors_node_t * | p, | ||
int | named | ||
) |
void dump_blob_attr | ( | struct blob_attr * | attr, |
char * | msg | ||
) |
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
attr | ptr to table where search NODE_INFO_KEY field \err_msg holder for error message |
int get_table_field | ( | struct blob_attr * | attr, |
char * | field_name, | ||
int | type, | ||
struct blob_attr ** | res, | ||
char ** | err_msg | ||
) |
__BEGIN_DECLS int ps_blobmsg_parse | ( | const struct blobmsg_policy * | policy, |
int | policy_len, | ||
struct blob_attr ** | tb, | ||
void * | data, | ||
unsigned int | len | ||
) |
int ps_parse_blob | ( | const struct blobmsg_policy * | policy, |
int | cnt_policy, | ||
struct blob_attr ** | attrs, | ||
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |
int unblob_node_addr | ( | node_addr_t * | p, |
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |
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
p | ptr to node_fw_version_t target to fill |
attr | ptr to blob_attr with object data node_fw_version_t |
err_msg | if not NULL ptr to return error message if return != 0 |
int unblob_node_info | ( | node_info_t * | p, |
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |
int unblob_node_serial_num | ( | node_serial_num_t * | p, |
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |
int unblob_sensor_value | ( | sensor_value_t * | p, |
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |
int unblob_sensors_node | ( | sensors_node_t * | p, |
struct blob_attr * | attr, | ||
char ** | err_msg | ||
) |