Reduce the default channel list

By default, LMIC uses 6 standard channels for joining and 3 standard
channels for normal operation which are defined in the LoRaWAN
specification. On top of that, it defines 3 additional channels.

However, in practice it turns out that 3 of the 6 joining channels are
not actually used by gateway, and neither are the 3 additional channels
for normal operation. To maximize default operability, this commit
reduces the default channels list to just (the same) 3 channels for both
joining and normal operation (but at different duty cycles).

Extra channels  can be configured from the sketch, using
LMIC_setupChannel(), and the example sketches will be modifed according
to this.
This commit is contained in:
Matthijs Kooijman 2016-02-03 14:25:36 +01:00
parent f19d2cb759
commit 03ec06b3d0

View file

@ -526,15 +526,12 @@ void LMIC_setPingable (u1_t intvExp) {
//
// BEG: EU868 related stuff
//
enum { NUM_DEFAULT_CHANNELS=6 };
static CONST_TABLE(u4_t, iniChannelFreq)[12] = {
enum { NUM_DEFAULT_CHANNELS=3 };
static CONST_TABLE(u4_t, iniChannelFreq)[6] = {
// Join frequencies and duty cycle limit (0.1%)
EU868_F1|BAND_MILLI, EU868_J4|BAND_MILLI,
EU868_F2|BAND_MILLI, EU868_J5|BAND_MILLI,
EU868_F3|BAND_MILLI, EU868_J6|BAND_MILLI,
EU868_F1|BAND_MILLI, EU868_F2|BAND_MILLI, EU868_F3|BAND_MILLI,
// Default operational frequencies
EU868_F1|BAND_CENTI, EU868_F2|BAND_CENTI, EU868_F3|BAND_CENTI,
EU868_F4|BAND_MILLI, EU868_F5|BAND_MILLI, EU868_F6|BAND_DECI
};
static void initDefaultChannels (bit_t join) {
@ -542,16 +539,12 @@ static void initDefaultChannels (bit_t join) {
os_clearMem(&LMIC.channelDrMap, sizeof(LMIC.channelDrMap));
os_clearMem(&LMIC.bands, sizeof(LMIC.bands));
LMIC.channelMap = 0x3F;
u1_t su = join ? 0 : 6;
for( u1_t fu=0; fu<6; fu++,su++ ) {
LMIC.channelMap = 0x07;
u1_t su = join ? 0 : 3;
for( u1_t fu=0; fu<3; fu++,su++ ) {
LMIC.channelFreq[fu] = TABLE_GET_U4(iniChannelFreq, su);
LMIC.channelDrMap[fu] = DR_RANGE_MAP(DR_SF12,DR_SF7);
}
if( !join ) {
LMIC.channelDrMap[5] = DR_RANGE_MAP(DR_SF12,DR_SF7);
LMIC.channelDrMap[1] = DR_RANGE_MAP(DR_SF12,DR_FSK);
}
LMIC.bands[BAND_MILLI].txcap = 1000; // 0.1%
LMIC.bands[BAND_MILLI].txpow = 14;