Added max_points in .ini, increased spiff csv file character limit, and file name limit. Added more prints for how many devices you can configure based on current memory size and max_points.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "modbus_memory.h"
|
||||
|
||||
#define MODBUS_MAX_POINTS 80 /* Max point entries per device, including helper registers */
|
||||
/*
|
||||
Modbus Data Type
|
||||
- bool = 1 register
|
||||
@@ -23,7 +22,7 @@
|
||||
|
||||
*/
|
||||
|
||||
#define MODBUS_MAX_CSV_LINE_LEN 256
|
||||
#define MODBUS_MAX_CSV_LINE_LEN 512
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -86,8 +85,9 @@ typedef struct modbus_point
|
||||
|
||||
typedef struct modbus_db
|
||||
{
|
||||
modbus_point_t points[MODBUS_MAX_POINTS];
|
||||
modbus_point_t *points;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} modbus_db_t;
|
||||
|
||||
/* Initialize / clear point database */
|
||||
@@ -95,7 +95,7 @@ void modbus_points_init(modbus_db_t *db);
|
||||
void modbus_points_reset(modbus_db_t *db);
|
||||
|
||||
/* Load points from CSV */
|
||||
bool modbus_points_load(modbus_db_t *db, const char *filename);
|
||||
bool modbus_points_load(modbus_db_t *db, const char *filename, size_t max_points);
|
||||
|
||||
/* Lookup helpers */
|
||||
const modbus_point_t *modbus_points_find_by_type_offset(const modbus_db_t *db,
|
||||
|
||||
Reference in New Issue
Block a user