Merge remote-tracking branch 'origin/master'

pull/3/head
geeksville 2020-09-19 11:11:04 -07:00
commit 4e431c8410
1 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -430,6 +430,21 @@ message ChannelSettings {
A channel number between 1 and 13 (or whatever the max is in the current
region). If ZERO then the rule is "use the old channel name hash based
algoritm to derive the channel number")
If using the hash algorithm the channel number will be: hash(channel_name) %
NUM_CHANNELS (Where num channels depends on the regulatory region).
NUM_CHANNELS_US is 13, for other values see MeshRadio.h in the device code.
// hash a string into an integer - djb2 by Dan Bernstein. -
// http://www.cse.yorku.ca/~oz/hash.html
unsigned long hash(char *str) {
unsigned long hash = 5381; int c;
while ((c = *str++) != 0)
hash = ((hash << 5) + hash) + (unsigned char) c;
return hash;
}
*/
uint32 channel_num = 9;