projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
8981c39
)
renamed Function to ModbusRegisterType
author
Jan Vitek
<vitek@vitek-ThinkPad-T500.(none)>
Thu, 6 Jun 2013 13:10:10 +0000
(15:10 +0200)
committer
Marc Fournier
<marc.fournier@camptocamp.com>
Tue, 9 Dec 2014 23:36:08 +0000
(
00:36
+0100)
src/modbus.c
patch
|
blob
|
history
diff --git
a/src/modbus.c
b/src/modbus.c
index
b65371f
..
701406d
100644
(file)
--- a/
src/modbus.c
+++ b/
src/modbus.c
@@
-49,7
+49,7
@@
* RegisterBase 1234
* RegisterType float
* Type gauge
* RegisterBase 1234
* RegisterType float
* Type gauge
- *
Function
holding
+ *
ModbusRegisterType
holding
* Instance "..."
* </Data>
*
* Instance "..."
* </Data>
*
@@
-76,13
+76,13
@@
enum mb_register_type_e /* {{{ */
REG_TYPE_UINT32,
REG_TYPE_FLOAT
}; /* }}} */
REG_TYPE_UINT32,
REG_TYPE_FLOAT
}; /* }}} */
-enum mb_
function
_e /* {{{ */
+enum mb_
mreg_type
_e /* {{{ */
{
{
-
FCN
_HOLDING,
-
FCN
_INPUT
+
MREG
_HOLDING,
+
MREG
_INPUT
}; /* }}} */
typedef enum mb_register_type_e mb_register_type_t;
}; /* }}} */
typedef enum mb_register_type_e mb_register_type_t;
-typedef enum mb_
function_e mb_function
_t;
+typedef enum mb_
mreg_type_e mb_mreg_type
_t;
struct mb_data_s;
typedef struct mb_data_s mb_data_t;
struct mb_data_s;
typedef struct mb_data_s mb_data_t;
@@
-91,7
+91,7
@@
struct mb_data_s /* {{{ */
char *name;
int register_base;
mb_register_type_t register_type;
char *name;
int register_base;
mb_register_type_t register_type;
- mb_
function_t function
;
+ mb_
mreg_type_t modbus_register_type
;
char type[DATA_MAX_NAME_LEN];
char instance[DATA_MAX_NAME_LEN];
char type[DATA_MAX_NAME_LEN];
char instance[DATA_MAX_NAME_LEN];
@@
-475,7
+475,7
@@
static int mb_read_data (mb_host_t *host, mb_slave_t *slave, /* {{{ */
return (-1);
}
#endif
return (-1);
}
#endif
- if (data->
function == FCN
_INPUT){
+ if (data->
modbus_register_type == MREG
_INPUT){
status = modbus_read_input_registers (host->connection,
/* start_addr = */ data->register_base,
/* num_registers = */ values_num, /* buffer = */ values);
status = modbus_read_input_registers (host->connection,
/* start_addr = */ data->register_base,
/* num_registers = */ values_num, /* buffer = */ values);
@@
-723,22
+723,22
@@
static int mb_config_add_data (oconfig_item_t *ci) /* {{{ */
status = -1;
}
}
status = -1;
}
}
- else if (strcasecmp ("
Function
", child->key) == 0)
+ else if (strcasecmp ("
ModbusRegisterType
", child->key) == 0)
{
#if LEGACY_LIBMODBUS
{
#if LEGACY_LIBMODBUS
- ERROR("Modbus plugin:
Function
parameter can not be used with your libmodbus version");
+ ERROR("Modbus plugin:
ModbusRegisterType
parameter can not be used with your libmodbus version");
#else
char tmp[16];
status = cf_util_get_string_buffer (child, tmp, sizeof (tmp));
if (status != 0)
/* do nothing */;
else if (strcasecmp ("holding", tmp) == 0)
#else
char tmp[16];
status = cf_util_get_string_buffer (child, tmp, sizeof (tmp));
if (status != 0)
/* do nothing */;
else if (strcasecmp ("holding", tmp) == 0)
- data.
function = FCN
_HOLDING;
+ data.
modbus_register_type = MREG
_HOLDING;
else if (strcasecmp ("input", tmp) == 0)
else if (strcasecmp ("input", tmp) == 0)
- data.
function = FCN
_INPUT;
+ data.
modbus_register_type = MREG
_INPUT;
else
{
else
{
- ERROR ("Modbus plugin: The
function
type \"%s\" is unknown.", tmp);
+ ERROR ("Modbus plugin: The
modbus_register_
type \"%s\" is unknown.", tmp);
status = -1;
}
#endif
status = -1;
}
#endif