Apparently the device can store up to 60 records per user, for 2 users,
and each record is 20 bytes.
Considering that the data has some header info like:
M160...M260...
the buffer must be at least:
(20 * 60 * 2) + 8 + 2 = 2410 bytes
Finally, the extra 2 bytes are the STX and ETX bytes.
Increase the buffer size to 4096 bytes to be safe.
Thanks-to: Cornelis Broeders <cornelis.broeders@web.de>
#define visomat_device libusb_device_handle
static int visomat_dump_eeprom(visomat_device *dev, unsigned int user_mask)
{
- /* Assuming an EEPROM of 1 KiB */
- uint8_t buffer[1024] = { 0 };
+ /* Assuming an EEPROM of 4 KiB */
+ uint8_t buffer[4096] = { 0 };
int ret;
ret = send_command(dev, VISOMAT_CMD_DUMP_EEPROM);