From 264f9e73dd98d6898bf4979ca3c90812b4f4b0fa Mon Sep 17 00:00:00 2001 From: GUVWAF Date: Sat, 1 Oct 2022 12:16:04 +0200 Subject: [PATCH 1/4] Add PortNum for Simulator App --- portnums.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/portnums.proto b/portnums.proto index 14c5eef..1ebd7f8 100644 --- a/portnums.proto +++ b/portnums.proto @@ -120,6 +120,14 @@ enum PortNum { */ ZPS_APP = 68; + /* + * Used to let multiple instances of Linux native applications communicate + * as if they did using their LoRa chip. + * Maintained by GitHub user GUVWAF. + * Project files at https://github.com/GUVWAF/Meshtasticator + */ + SIMULATOR_APP = 69; + /* * Private applications should use portnums >= 256. * To simplify initial development and testing you can use "PRIVATE_APP" From 8fa20d8d0d1d3f51f575454838695bf46f18ca1b Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 30 Sep 2022 16:39:21 -0300 Subject: [PATCH 2/4] move channel_num to LoRaConfig --- channel.proto | 21 ++------------------- config.proto | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/channel.proto b/channel.proto index 19afc19..eaa7f15 100644 --- a/channel.proto +++ b/channel.proto @@ -31,26 +31,9 @@ option java_outer_classname = "ChannelProtos"; message ChannelSettings { /* - * NOTE: this field is _independent_ and unrelated to the concepts in channel.proto. - * this is controlling the actual hardware frequency the radio is transmitting on. - * In a perfect world we would have called it something else (band?) but I forgot to make this change during the big 1.2 renaming. - * Most users should never need to be exposed to this field/concept. - * 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 - * algorithm 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; - * } + * Deprecated in favor of LoraConfig.channel_num */ - uint32 channel_num = 1; + uint32 channel_num = 1 [deprecated = true]; /* * A simple pre-shared key for now for crypto. diff --git a/config.proto b/config.proto index f9b8a51..c4c5db9 100644 --- a/config.proto +++ b/config.proto @@ -572,6 +572,25 @@ message Config { */ int32 tx_power = 10; + /* + * This is controlling the actual hardware frequency the radio is transmitting on. + * Most users should never need to be exposed to this field/concept. + * A channel number between 1 and N (whatever the max is in the current region). + * If ZERO then the rule is "use the old channel name hash based + * algorithm 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). + * 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 = 11; + /* * For testing it is useful sometimes to force a node to never listen to * particular other nodes (simulating radio out of range). All nodenums listed From 7cf4d8a9b3db42fe4a456c992657052e055aa180 Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 30 Sep 2022 17:31:42 -0300 Subject: [PATCH 3/4] update channel and config options --- channel.options | 5 ----- config.options | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/channel.options b/channel.options index d4f22c1..d0bdcbc 100644 --- a/channel.options +++ b/channel.options @@ -3,8 +3,3 @@ # 256 bit or 128 bit psk key *ChannelSettings.psk max_size:32 *ChannelSettings.name max_size:12 -*ChannelSettings.tx_power int_size:8 -*ChannelSettings.bandwidth int_size:16 -*ChannelSettings.coding_rate int_size:8 -*ChannelSettings.channel_num int_size:8 - diff --git a/config.options b/config.options index 0290b2d..8fd359c 100644 --- a/config.options +++ b/config.options @@ -1,7 +1,11 @@ *NetworkConfig.wifi_ssid max_size:33 *NetworkConfig.wifi_psk max_size:64 +*NetworkConfig.ntp_server max_size:33 # Max of three ignored nodes for our testing *LoRaConfig.ignore_incoming max_count:3 -*NetworkConfig.ntp_server max_size:33 +*LoRaConfig.tx_power int_size:8 +*LoRaConfig.bandwidth int_size:16 +*LoRaConfig.coding_rate int_size:8 +*LoRaConfig.channel_num int_size:8 From d3375fe599da1dd48572354325d3186eccf6f449 Mon Sep 17 00:00:00 2001 From: andrekir Date: Fri, 30 Sep 2022 22:19:22 -0300 Subject: [PATCH 4/4] clean up channel_num comment --- config.proto | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/config.proto b/config.proto index c4c5db9..223b2c9 100644 --- a/config.proto +++ b/config.proto @@ -575,19 +575,11 @@ message Config { /* * This is controlling the actual hardware frequency the radio is transmitting on. * Most users should never need to be exposed to this field/concept. - * A channel number between 1 and N (whatever the max is in the current region). + * A channel number between 1 and NUM_CHANNELS (whatever the max is in the current region). * If ZERO then the rule is "use the old channel name hash based * algorithm 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). - * 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 = 11;