Skip to content

Commit 309a090

Browse files
committed
Add JP_STRICT mode: enforce MAX_TEXT_LEN for ARIB STD-T108 compliance
JP_STRICT limits MAX_TEXT_LEN to 1*CIPHER_BLOCK_SIZE (16 bytes) to keep TX time under 4 seconds on SF12/BW125/CR4-8 (Japan LoRa settings). SF12/BW125/CR4-8 airtime: 60 bytes total packet = ~3809ms (within 4s limit) packet overhead ~44 bytes, leaving 16 bytes for text payload Enabled only for WioTrackerL1 and RAK_WisMesh_Tag builds.
1 parent 52b9d87 commit 309a090

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/helpers/BaseChatMesh.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
#include <helpers/AdvertDataHelpers.h>
66
#include <helpers/TxtDataHelpers.h>
77

8-
#define MAX_TEXT_LEN (10*CIPHER_BLOCK_SIZE) // must be LESS than (MAX_PACKET_PAYLOAD - 4 - CIPHER_MAC_SIZE - 1)
8+
// JP_STRICT: limit MAX_TEXT_LEN to keep TX time under 4s (ARIB STD-T108)
9+
// SF12/BW125/CR4-8: 60 bytes total packet = ~3809ms, overhead ~44 bytes
10+
// leaving 16 bytes (1*CIPHER_BLOCK_SIZE) for text payload
11+
#ifdef JP_STRICT
12+
#define MAX_TEXT_LEN (1*CIPHER_BLOCK_SIZE) // ~16 chars, TX <= 4s for JP
13+
#else
14+
#define MAX_TEXT_LEN (10*CIPHER_BLOCK_SIZE) // must be LESS than (MAX_PACKET_PAYLOAD - 4 - CIPHER_MAC_SIZE - 1)
15+
#endif
916

1017
#include "ContactInfo.h"
1118

variants/rak_wismesh_tag/platformio.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ build_flags = ${nrf52_base.build_flags}
2525
-D PIN_BUZZER=21
2626
-D PIN_BOARD_SDA=PIN_WIRE_SDA
2727
-D PIN_BOARD_SCL=PIN_WIRE_SCL
28+
-D JP_STRICT
2829
build_src_filter = ${nrf52_base.build_src_filter}
2930
+<../variants/rak_wismesh_tag>
3031
+<helpers/ui/MomentaryButton.cpp>
@@ -118,4 +119,4 @@ build_flags =
118119
; -D MESH_PACKET_LOGGING=1
119120
-D MESH_DEBUG=1
120121
build_src_filter = ${rak4631.build_src_filter}
121-
+<../examples/simple_sensor>
122+
+<../examples/simple_sensor>

variants/wio-tracker-l1/platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ build_flags = ${nrf52_base.build_flags}
1616
-D SX126X_RX_BOOSTED_GAIN=1
1717
-D PIN_OLED_RESET=-1
1818
-D GPS_BAUD_RATE=9600
19+
-D JP_STRICT
1920
build_src_filter = ${nrf52_base.build_src_filter}
2021
+<WioTrackerL1Board.cpp>
2122
+<../variants/wio-tracker-l1>

0 commit comments

Comments
 (0)