Skip to content

Commit 3a88765

Browse files
committed
rename isJapanMode() to isAS923_1_JP() for precision
AS923-2 shares the same frequency band as AS923-1 (JP), making isJapanMode() ambiguous. isAS923_1_JP() matches the sub-plan naming convention used in LoRaMac-node and clarifies that LBT is an ARIB STD-T108 requirement specific to Japan's AS923-1 deployment, not a property of AS923 in general. Intermediate name until radio_law framework (RFC #2285) lands.
1 parent c70e066 commit 3a88765

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

examples/companion_radio/MyMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class MyMesh : public BaseChatMesh, public DataStoreHost {
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;
154154
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
155+
if (_radio->isAS923_1_JP()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
156156
return Dispatcher::getCADFailMaxDuration();
157157
}
158158
void onSendTimeout() override;

examples/simple_repeater/MyMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
144144
void logTxFail(mesh::Packet* pkt, int len) override;
145145
int calcRxDelay(float score, uint32_t air_time) const override;
146146
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
147+
if (_radio->isAS923_1_JP()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
148148
return Dispatcher::getCADFailMaxDuration();
149149
}
150150

examples/simple_room_server/MyMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
138138

139139
int calcRxDelay(float score, uint32_t air_time) const override;
140140
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
141+
if (_radio->isAS923_1_JP()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
142142
return Dispatcher::getCADFailMaxDuration();
143143
}
144144

examples/simple_sensor/SensorMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class SensorMesh : public mesh::Mesh, public CommonCLICallbacks {
118118
bool allowPacketForward(const mesh::Packet* packet) override;
119119
int calcRxDelay(float score, uint32_t air_time) const override;
120120
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
121+
if (_radio->isAS923_1_JP()) return UINT32_MAX; // JP LBT: no forced TX — channel must be free per ARIB STD-T108
122122
return Dispatcher::getCADFailMaxDuration();
123123
}
124124
uint32_t getRetransmitDelay(const mesh::Packet* packet) override;

src/Dispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +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
43+
virtual bool isAS923_1_JP() const { return false; } // default: non-JP
4444

4545
/**
4646
* \brief starts the raw packet send. (no wait)

src/helpers/radiolib/RadioLibWrappers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool RadioLibWrapper::isSendComplete() {
175175
void RadioLibWrapper::onSendFinished() {
176176
_radio->finishTransmit();
177177
_board->onAfterTransmit();
178-
if (isJapanMode()) {
178+
if (isAS923_1_JP()) {
179179
// ARIB STD-T108: wait >= 50ms after TX before next transmission
180180
delay(50);
181181
}
@@ -191,7 +191,7 @@ bool RadioLibWrapper::isChannelActive() {
191191

192192
// Activate JP_STRICT LBT on Japan 920MHz band 3 channels only
193193
// CH25=920.800MHz, CH26=921.000MHz, CH27=921.200MHz (ARIB STD-T108)
194-
if (isJapanMode()) {
194+
if (isAS923_1_JP()) {
195195
// ARIB STD-T108 compliant LBT: continuous RSSI sensing for >= 5ms
196196
// Energy-based sensing required; LoRa CAD not used
197197
uint32_t sense_start = millis();

src/helpers/radiolib/RadioLibWrappers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ class RadioLibWrapper : public mesh::Radio {
4646
virtual uint8_t getCodingRate() const { return 8; } // default CR4/8, override in subclass
4747
virtual float getFreqMHz() const { return 0.0f; } // default unknown, override in subclass
4848
//
49-
bool isJapanMode() const {
49+
bool isAS923_1_JP() const {
5050
float freq = getFreqMHz();
5151
return (fabsf(freq - 920.800f) < 0.05f ||
5252
fabsf(freq - 921.000f) < 0.05f ||
5353
fabsf(freq - 921.200f) < 0.05f);
5454
}
5555

5656
int getMaxTextLen() const {
57-
if (!isJapanMode()) return 10 * 16; // default 160 bytes
57+
if (!isAS923_1_JP()) return 10 * 16; // default 160 bytes
5858
uint8_t cr = getCodingRate();
5959
if (cr <= 5) return 64; // 3874ms @ SF12/BW125/CR4-5
6060
if (cr == 6) return 48; // 3874ms @ SF12/BW125/CR4-6
@@ -63,7 +63,7 @@ class RadioLibWrapper : public mesh::Radio {
6363
}
6464

6565
int getMaxGroupTextLen() const {
66-
if (!isJapanMode()) return 10 * 16; // default 160 bytes
66+
if (!isAS923_1_JP()) return 10 * 16; // default 160 bytes
6767
uint8_t cr = getCodingRate();
6868
if (cr <= 5) return 64; // 3710ms @ SF12/BW125/CR4-5
6969
if (cr == 6) return 48; // 3678ms @ SF12/BW125/CR4-6

0 commit comments

Comments
 (0)