diff --git a/obu-cam-transmistter/main/cam.c b/obu-cam-transmistter/main/cam.c index 8f4a148..8d800e7 100644 --- a/obu-cam-transmistter/main/cam.c +++ b/obu-cam-transmistter/main/cam.c @@ -117,9 +117,13 @@ int cam_encode(const cam_fields_t *f, uint8_t *buf, size_t buf_len) bw_put_bits(&bw, 0, 1); // extension bit: value is in the root list bw_put_bits(&bw, 2, 2); // unavailable(2) // YawRate: YawRateValue(-32766..32767)->16 (offset from -32766), - // YawRateConfidence ENUM 8 values -> 3 bits + // YawRateConfidence ENUM with NINE values, degSec-000-01(0) .. unavailable(8) + // (cdd_1_3_1_1.asn) -> 4 bits. This wrote 3 bits with value 7, one bit short and the + // wrong symbol (7 is outOfRange), so every field after it shifted for any + // standards-compliant receiver. The app's CamUperCodec.kt fixed the same line on + // 2026-08-20; this copy was missed until 2026-09-11. bw_put_bits(&bw, 32767 - (uint32_t)(-32766), 16); // yawRateValue: unavailable(32767) - bw_put_bits(&bw, 7, 3); // yawRateConfidence: unavailable(7) + bw_put_bits(&bw, 8, 4); // yawRateConfidence: unavailable(8) // ---- LowFrequencyContainer ---- CHOICE { basicVehicleContainerLowFrequency, // ... } - EXTENSIBLE, 1 root alternative (index needs 0 bits). diff --git a/obu-firmware/main/cam.c b/obu-firmware/main/cam.c index 14cb8a3..14c17b7 100644 --- a/obu-firmware/main/cam.c +++ b/obu-firmware/main/cam.c @@ -122,9 +122,13 @@ int cam_encode(const cam_fields_t *f, uint8_t *buf, size_t buf_len) bw_put_bits(&bw, 0, 1); // extension bit: value is in the root list bw_put_bits(&bw, 2, 2); // unavailable(2) // YawRate: YawRateValue(-32766..32767)->16 (offset from -32766), - // YawRateConfidence ENUM 8 values -> 3 bits + // YawRateConfidence ENUM with NINE values, degSec-000-01(0) .. unavailable(8) + // (cdd_1_3_1_1.asn) -> 4 bits. This wrote 3 bits with value 7, one bit short and the + // wrong symbol (7 is outOfRange), so every field after it shifted for any + // standards-compliant receiver. The app's CamUperCodec.kt fixed the same line on + // 2026-08-20; this reference copy was missed until 2026-09-11. bw_put_bits(&bw, 32767 - (uint32_t)(-32766), 16); // yawRateValue: unavailable(32767) - bw_put_bits(&bw, 7, 3); // yawRateConfidence: unavailable(7) + bw_put_bits(&bw, 8, 4); // yawRateConfidence: unavailable(8) // ---- LowFrequencyContainer ---- CHOICE { basicVehicleContainerLowFrequency, // ... } - EXTENSIBLE, 1 root alternative (index needs 0 bits).