From ceae89e149c5685a39fa9ca56700e8a856698512 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 29 Dec 2022 16:34:53 +0100 Subject: [PATCH] Enable big page support The Oceanic Pro Plus 4 appears to support the big page B4 and B8 read commands, but with some strange twists: * When sending the B8 read command, a 256 byte packet is received. The checksums of the packet are valid, but the upper half of the payload data is always filled with zero bytes. That means we can't use this command. * The B4 read command appears to use a 2 byte checksum instead of the normal 1 byte checksum. That means we can use this command with a small model specific tweak. --- src/oceanic_atom2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index de52e96..ee60215 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -948,7 +948,8 @@ oceanic_atom2_device_open (dc_device_t **out, dc_context_t *context, dc_iostream } // Set the big page support. - if (device->base.layout == &aeris_f11_layout) { + if (device->base.layout == &aeris_f11_layout || + device->base.layout == &oceanic_proplus3_layout) { device->bigpage = 8; } else if (device->base.layout == &oceanic_proplusx_layout || device->base.layout == &aqualung_i770r_layout || @@ -1042,7 +1043,7 @@ oceanic_atom2_device_read (dc_device_t *abstract, unsigned int address, unsigned break; case 8: read_cmd = CMD_READ8; - crc_size = 1; + crc_size = device->base.model == PROPLUS4 ? 2 : 1; break; case 16: read_cmd = CMD_READ16;