Corrected the channel selection #372

This commit is contained in:
Henrik Ekblad
2016-01-27 20:33:46 +01:00
parent 4002636168
commit 242d0a94ee
4 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
Arduino Arduino
======= =======
MySensors Arduino Library v1.5 MySensors Arduino Library v2.0.0-beta
Please visit www.mysensors.org for more information Please visit www.mysensors.org for more information
+11 -1
View File
@@ -371,7 +371,17 @@
/** /**
* @def MY_RF24_CHANNEL * @def MY_RF24_CHANNEL
* @brief RF channel for the sensor net, 0-127. * @brief RF channel for the sensor net, 0-125.
* Frequence: 2400 Mhz - 2525 Mhz Channels: 126
* http://www.mysensors.org/radio/nRF24L01Plus.pdf
* 0 => 2400 Mhz (RF24 channel 1)
* 1 => 2401 Mhz (RF24 channel 2)
* 76 => 2476 Mhz (RF24 channel 77)
* 83 => 2483 Mhz (RF24 channel 84)
* 124 => 2524 Mhz (RF24 channel 125)
* 125 => 2525 Mhz (RF24 channel 126)
* In some countries there might be limitations, in Germany for example only the range 2400,0 - 2483,5 Mhz is allowed
* http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2013_10_WLAN_2,4GHz_pdf.pdf
*/ */
#ifndef MY_RF24_CHANNEL #ifndef MY_RF24_CHANNEL
#define MY_RF24_CHANNEL 76 #define MY_RF24_CHANNEL 76
+1 -1
View File
@@ -388,7 +388,7 @@ RF24::RF24(uint8_t _cepin, uint8_t _cspin):
void RF24::setChannel(uint8_t channel) void RF24::setChannel(uint8_t channel)
{ {
const uint8_t max_channel = 127; const uint8_t max_channel = 125;
write_register(RF_CH,min(channel,max_channel)); write_register(RF_CH,min(channel,max_channel));
} }
+1 -1
View File
@@ -601,7 +601,7 @@ public:
/** /**
* Set RF communication channel * Set RF communication channel
* *
* @param channel Which RF channel to communicate on, 0-127 * @param channel Which RF channel to communicate on, 0-125
*/ */
void setChannel(uint8_t channel); void setChannel(uint8_t channel);