Skip to content

Commit 5448ecf

Browse files
committed
JP LBT: prevent forced TX during backoff, no CAD timeout in Japan mode
Dispatcher's default 4-second getCADFailMaxDuration() would trigger forced transmission before JP LBT backoff completes (max 16s), violating ARIB STD-T108 which prohibits TX while channel is busy. - Add isJapanMode() virtual method to Radio base class (Dispatcher.h) - Override getCADFailMaxDuration() in all Mesh subclasses to return UINT32_MAX in Japan mode — no forced TX, channel must be free - Default non-JP behavior unchanged (4000ms) If ambient noise exceeds -80dBm, TX is blocked indefinitely. Users can monitor noise floor via companion app: menu (⋮) -> Tools -> Noise Floor.
1 parent c8628b6 commit 5448ecf

5 files changed

Lines changed: 18 additions & 0 deletions

File tree

examples/companion_radio/MyMesh.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ class MyMesh : public BaseChatMesh, public DataStoreHost {
151151

152152
uint32_t calcFloodTimeoutMillisFor(uint32_t pkt_airtime_millis) const override;
153153
uint32_t calcDirectTimeoutMillisFor(uint32_t pkt_airtime_millis, uint8_t path_len) const override;
154+
uint32_t getCADFailMaxDuration() const override {
155+
if (_radio->isJapanMode()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
156+
return Dispatcher::getCADFailMaxDuration();
157+
}
154158
void onSendTimeout() override;
155159

156160
// DataStoreHost methods

examples/simple_repeater/MyMesh.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
143143
void logTx(mesh::Packet* pkt, int len) override;
144144
void logTxFail(mesh::Packet* pkt, int len) override;
145145
int calcRxDelay(float score, uint32_t air_time) const override;
146+
uint32_t getCADFailMaxDuration() const override {
147+
if (_radio->isJapanMode()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
148+
return Dispatcher::getCADFailMaxDuration();
149+
}
146150

147151
uint32_t getRetransmitDelay(const mesh::Packet* packet) override;
148152
uint32_t getDirectRetransmitDelay(const mesh::Packet* packet) override;

examples/simple_room_server/MyMesh.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
137137
void logTxFail(mesh::Packet* pkt, int len) override;
138138

139139
int calcRxDelay(float score, uint32_t air_time) const override;
140+
uint32_t getCADFailMaxDuration() const override {
141+
if (_radio->isJapanMode()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
142+
return Dispatcher::getCADFailMaxDuration();
143+
}
144+
140145
const char* getLogDateTime() override;
141146
uint32_t getRetransmitDelay(const mesh::Packet* packet) override;
142147
uint32_t getDirectRetransmitDelay(const mesh::Packet* packet) override;

examples/simple_sensor/SensorMesh.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks {
117117
float getAirtimeBudgetFactor() const override;
118118
bool allowPacketForward(const mesh::Packet* packet) override;
119119
int calcRxDelay(float score, uint32_t air_time) const override;
120+
uint32_t getCADFailMaxDuration() const override {
121+
if (_radio->isJapanMode()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
122+
return Dispatcher::getCADFailMaxDuration();
123+
}
120124
uint32_t getRetransmitDelay(const mesh::Packet* packet) override;
121125
uint32_t getDirectRetransmitDelay(const mesh::Packet* packet) override;
122126
int getInterferenceThreshold() const override;

src/Dispatcher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class Radio {
4040

4141
virtual int getMaxTextLen() const { return 10 * 16; } // default: non-JP
4242
virtual int getMaxGroupTextLen() const { return 10 * 16; } // default: non-JP
43+
virtual bool isJapanMode() const { return false; } // default: non-JP
4344

4445
/**
4546
* \brief starts the raw packet send. (no wait)

0 commit comments

Comments
 (0)