DB library for EEPROM question

I am using successfully the DB.h library.
However I want to go further and use all the memory available on my 256KB EEPROM.
I saw the limitations of the library:

  • Tables are limited to a maximum of 255 records
  • Tables are limited to the amount of EEPROM on your Arduino
  • Maximum number of records: (EEPROM size / record size = max records)

I need to create 2 tables: 1 for the conf data and 1 for a data logger.

My table for the conf contains this kind of records:
struct MyConf {
char name[20];
int value;
} myconf;

My table for the data logger contains this kind of records:
struct MyData{ /* Still 4 bytes free */
int datetime; // MilTime
int device_id;
int device_value;
} mydata;

I have 10 entries in the conf table.
I want to store as much as possible data entry in the second table.
Can you tell me how many records I can put in this 2nd table to fill my memory, and how can I detect in my code that the memory is full so I can send the data to a web server when the memory is full, and the overwrite or free-up the memory to start again…
Any help would be very appreciated.

Create a little sketch that creates instances of these structures.

myconf one;
mydata two;

Then, use the sizeof operator to determine the size of the instances.

int sizeOfMyConf = sizeof(one);
int sizeOfMyData = sizeof(two);

Multiply the size of the instance of myconf by the number of records you want. Subtract that from the available memory. Divide the result by the size of the mydata instance to determine how many instances of that structure you can store.

I don't know what overhead the DB library imposes, if any, but you will need to keep that in mind.