Merge branch 'master' into caveman99-patch-1

This commit is contained in:
Thomas Göttgens 2022-01-28 08:44:46 +01:00 committed by GitHub
commit 0a1125d7e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 18 deletions

2
proto

@ -1 +1 @@
Subproject commit a9bba331e69b16ba7cd9b35d19b11732eff8d1b5 Subproject commit 07ed86d8b44f53091fafd007f729a67f4785e270

View File

@ -145,7 +145,7 @@ extern const pb_msgdesc_t AdminMessage_msg;
#define AdminMessage_fields &AdminMessage_msg #define AdminMessage_fields &AdminMessage_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define AdminMessage_size 795 #define AdminMessage_size 798
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -140,7 +140,7 @@ extern const pb_msgdesc_t ChannelFile_msg;
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define LegacyRadioConfig_size 4 #define LegacyRadioConfig_size 4
#define LegacyRadioConfig_LegacyPreferences_size 2 #define LegacyRadioConfig_LegacyPreferences_size 2
#define DeviceState_size 10981 #define DeviceState_size 11014
#define ChannelFile_size 832 #define ChannelFile_size 832
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -32,7 +32,8 @@ typedef enum _HardwareModel {
HardwareModel_PORTDUINO = 37, HardwareModel_PORTDUINO = 37,
HardwareModel_ANDROID_SIM = 38, HardwareModel_ANDROID_SIM = 38,
HardwareModel_DIY_V1 = 39, HardwareModel_DIY_V1 = 39,
HardwareModel_RAK11200 = 40 HardwareModel_RAK11200 = 40,
HardwareModel_PRIVATE_HW = 255
} HardwareModel; } HardwareModel;
typedef enum _Team { typedef enum _Team {
@ -286,8 +287,8 @@ typedef struct _ToRadio {
/* Helper constants for enums */ /* Helper constants for enums */
#define _HardwareModel_MIN HardwareModel_UNSET #define _HardwareModel_MIN HardwareModel_UNSET
#define _HardwareModel_MAX HardwareModel_RAK11200 #define _HardwareModel_MAX HardwareModel_PRIVATE_HW
#define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_RAK11200+1)) #define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_PRIVATE_HW+1))
#define _Team_MIN Team_CLEAR #define _Team_MIN Team_CLEAR
#define _Team_MAX Team_BROWN #define _Team_MAX Team_BROWN
@ -645,12 +646,12 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg;
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define Position_size 153 #define Position_size 153
#define User_size 96 #define User_size 97
#define RouteDiscovery_size 40 #define RouteDiscovery_size 40
#define Routing_size 42 #define Routing_size 42
#define Data_size 267 #define Data_size 267
#define MeshPacket_size 318 #define MeshPacket_size 318
#define NodeInfo_size 270 #define NodeInfo_size 271
#define MyNodeInfo_size 457 #define MyNodeInfo_size 457
#define LogRecord_size 81 #define LogRecord_size 81
#define FromRadio_size 466 #define FromRadio_size 466

View File

@ -184,6 +184,7 @@ typedef struct _RadioConfig_UserPreferences {
char canned_message_plugin_allow_input_source[16]; char canned_message_plugin_allow_input_source[16];
char canned_message_plugin_messages[200]; char canned_message_plugin_messages[200];
bool canned_message_plugin_send_bell; bool canned_message_plugin_send_bell;
bool mqtt_encryption_enabled;
} RadioConfig_UserPreferences; } RadioConfig_UserPreferences;
typedef struct _RadioConfig { typedef struct _RadioConfig {
@ -232,9 +233,9 @@ extern "C" {
/* Initializer values for message structs */ /* Initializer values for message structs */
#define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default} #define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default}
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", "", 0} #define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", "", 0, 0}
#define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero} #define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero}
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", "", 0} #define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _LocationSharing_MIN, _GpsOperation_MIN, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, "", "", 0, 0}
/* Field tags (for use in manual encoding/decoding) */ /* Field tags (for use in manual encoding/decoding) */
#define RadioConfig_UserPreferences_position_broadcast_secs_tag 1 #define RadioConfig_UserPreferences_position_broadcast_secs_tag 1
@ -318,6 +319,7 @@ extern "C" {
#define RadioConfig_UserPreferences_canned_message_plugin_allow_input_source_tag 171 #define RadioConfig_UserPreferences_canned_message_plugin_allow_input_source_tag 171
#define RadioConfig_UserPreferences_canned_message_plugin_messages_tag 172 #define RadioConfig_UserPreferences_canned_message_plugin_messages_tag 172
#define RadioConfig_UserPreferences_canned_message_plugin_send_bell_tag 173 #define RadioConfig_UserPreferences_canned_message_plugin_send_bell_tag 173
#define RadioConfig_UserPreferences_mqtt_encryption_enabled_tag 174
#define RadioConfig_preferences_tag 1 #define RadioConfig_preferences_tag 1
/* Struct field encoding specification for nanopb */ /* Struct field encoding specification for nanopb */
@ -408,7 +410,8 @@ X(a, STATIC, SINGULAR, UENUM, rotary1_event_press, 166) \
X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_enabled, 170) \ X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_enabled, 170) \
X(a, STATIC, SINGULAR, STRING, canned_message_plugin_allow_input_source, 171) \ X(a, STATIC, SINGULAR, STRING, canned_message_plugin_allow_input_source, 171) \
X(a, STATIC, SINGULAR, STRING, canned_message_plugin_messages, 172) \ X(a, STATIC, SINGULAR, STRING, canned_message_plugin_messages, 172) \
X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_send_bell, 173) X(a, STATIC, SINGULAR, BOOL, canned_message_plugin_send_bell, 173) \
X(a, STATIC, SINGULAR, BOOL, mqtt_encryption_enabled, 174)
#define RadioConfig_UserPreferences_CALLBACK NULL #define RadioConfig_UserPreferences_CALLBACK NULL
#define RadioConfig_UserPreferences_DEFAULT NULL #define RadioConfig_UserPreferences_DEFAULT NULL
@ -420,8 +423,8 @@ extern const pb_msgdesc_t RadioConfig_UserPreferences_msg;
#define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg #define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg
/* Maximum encoded size of messages (where known) */ /* Maximum encoded size of messages (where known) */
#define RadioConfig_size 792 #define RadioConfig_size 795
#define RadioConfig_UserPreferences_size 789 #define RadioConfig_UserPreferences_size 792
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */

View File

@ -17,7 +17,7 @@
/// Set pin modes for every set bit in a mask /// Set pin modes for every set bit in a mask
static void pinModes(uint64_t mask, uint8_t mode) static void pinModes(uint64_t mask, uint8_t mode)
{ {
for (uint8_t i = 0; i < NUM_GPIOS; i++) { for (uint64_t i = 0; i < NUM_GPIOS; i++) {
if (mask & (1 << i)) { if (mask & (1 << i)) {
pinMode(i, mode); pinMode(i, mode);
} }
@ -29,13 +29,17 @@ static uint64_t digitalReads(uint64_t mask)
{ {
uint64_t res = 0; uint64_t res = 0;
pinModes(mask, INPUT_PULLUP); // The Arduino docs show to run pinMode(). But, when testing, found it is best not to.
// If the line below is uncommented, read will flip the pin to the default of the second
// argument in pinModes(), which will make the read turn the PIN "on".
//pinModes(mask, INPUT_PULLUP);
for (uint8_t i = 0; i < NUM_GPIOS; i++) { for (uint64_t i = 0; i < NUM_GPIOS; i++) {
uint64_t m = 1 << i; uint64_t m = 1 << i;
if (mask & m) { if (mask & m) {
if (digitalRead(i)) if (digitalRead(i)) {
res |= m; res |= m;
}
} }
} }
@ -79,6 +83,7 @@ bool RemoteHardwarePlugin::handleReceivedProtobuf(const MeshPacket &req, Hardwar
HardwareMessage r = HardwareMessage_init_default; HardwareMessage r = HardwareMessage_init_default;
r.typ = HardwareMessage_Type_READ_GPIOS_REPLY; r.typ = HardwareMessage_Type_READ_GPIOS_REPLY;
r.gpio_value = res; r.gpio_value = res;
r.gpio_mask = p.gpio_mask;
MeshPacket *p2 = allocDataProtobuf(r); MeshPacket *p2 = allocDataProtobuf(r);
setReplyTo(p2, req); setReplyTo(p2, req);
myReply = p2; myReply = p2;

View File

@ -1,4 +1,4 @@
[VERSION] [VERSION]
major = 1 major = 1
minor = 2 minor = 2
build = 52 build = 53