mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-01 07:30:33 +00:00
Merge branch 'meshtastic:master' into compression
This commit is contained in:
@@ -71,17 +71,7 @@ int MeshService::handleFromRadio(const MeshPacket *mp)
|
||||
printPacket("Forwarding to phone", mp);
|
||||
nodeDB.updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio
|
||||
|
||||
fromNum++;
|
||||
|
||||
if (toPhoneQueue.numFree() == 0) {
|
||||
DEBUG_MSG("NOTE: tophone queue is full, discarding oldest\n");
|
||||
MeshPacket *d = toPhoneQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseToPool(d);
|
||||
}
|
||||
|
||||
MeshPacket *copied = packetPool.allocCopy(*mp);
|
||||
assert(toPhoneQueue.enqueue(copied, 0)); // FIXME, instead of failing for full queue, delete the oldest mssages
|
||||
sendToPhone((MeshPacket *)mp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -161,12 +151,16 @@ bool MeshService::cancelSending(PacketId id)
|
||||
return router->cancelSending(nodeDB.getNodeNum(), id);
|
||||
}
|
||||
|
||||
void MeshService::sendToMesh(MeshPacket *p, RxSource src)
|
||||
void MeshService::sendToMesh(MeshPacket *p, RxSource src, bool ccToPhone)
|
||||
{
|
||||
nodeDB.updateFrom(*p); // update our local DB for this packet (because phone might have sent position packets etc...)
|
||||
|
||||
// Note: We might return !OK if our fifo was full, at that point the only option we have is to drop it
|
||||
router->sendLocal(p, src);
|
||||
|
||||
if (ccToPhone) {
|
||||
sendToPhone(p);
|
||||
}
|
||||
}
|
||||
|
||||
void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies)
|
||||
@@ -187,6 +181,20 @@ void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies)
|
||||
}
|
||||
}
|
||||
|
||||
void MeshService::sendToPhone(MeshPacket *p) {
|
||||
if (toPhoneQueue.numFree() == 0) {
|
||||
DEBUG_MSG("NOTE: tophone queue is full, discarding oldest\n");
|
||||
MeshPacket *d = toPhoneQueue.dequeuePtr(0);
|
||||
if (d)
|
||||
releaseToPool(d);
|
||||
}
|
||||
|
||||
MeshPacket *copied = packetPool.allocCopy(*p);
|
||||
perhapsDecode(copied);
|
||||
assert(toPhoneQueue.enqueue(copied, 0)); // FIXME, instead of failing for full queue, delete the oldest mssages
|
||||
fromNum++;
|
||||
}
|
||||
|
||||
NodeInfo *MeshService::refreshMyNodeInfo()
|
||||
{
|
||||
NodeInfo *node = nodeDB.getNode(nodeDB.getNodeNum());
|
||||
@@ -224,7 +232,7 @@ int MeshService::onGPSChanged(const meshtastic::GPSStatus *newStatus)
|
||||
} else {
|
||||
// The GPS has lost lock, if we are fixed position we should just keep using
|
||||
// the old position
|
||||
#if GPS_EXTRAVERBOSE
|
||||
#ifdef GPS_EXTRAVERBOSE
|
||||
DEBUG_MSG("onGPSchanged() - lost validLocation\n");
|
||||
#endif
|
||||
if (radioConfig.preferences.fixed_position) {
|
||||
|
||||
@@ -75,7 +75,7 @@ class MeshService
|
||||
/// Send a packet into the mesh - note p must have been allocated from packetPool. We will return it to that pool after
|
||||
/// sending. This is the ONLY function you should use for sending messages into the mesh, because it also updates the nodedb
|
||||
/// cache
|
||||
void sendToMesh(MeshPacket *p, RxSource src = RX_SRC_LOCAL);
|
||||
void sendToMesh(MeshPacket *p, RxSource src = RX_SRC_LOCAL, bool ccToPhone = false);
|
||||
|
||||
/** Attempt to cancel a previously sent packet from this _local_ node. Returns true if a packet was found we could cancel */
|
||||
bool cancelSending(PacketId id);
|
||||
@@ -83,6 +83,9 @@ class MeshService
|
||||
/// Pull the latest power and time info into my nodeinfo
|
||||
NodeInfo *refreshMyNodeInfo();
|
||||
|
||||
/// Send a packet to the phone
|
||||
void sendToPhone(MeshPacket *p);
|
||||
|
||||
private:
|
||||
/// Called when our gps position has changed - updates nodedb and sends Location message out into the mesh
|
||||
/// returns 0 to allow futher processing
|
||||
|
||||
@@ -35,6 +35,7 @@ NodeDB nodeDB;
|
||||
EXT_RAM_ATTR DeviceState devicestate;
|
||||
MyNodeInfo &myNodeInfo = devicestate.my_node;
|
||||
RadioConfig radioConfig;
|
||||
Config config;
|
||||
ChannelFile channelFile;
|
||||
|
||||
/** The current change # for radio settings. Starts at 0 on boot and any time the radio settings
|
||||
@@ -142,6 +143,11 @@ bool NodeDB::resetRadioConfig()
|
||||
return didFactoryReset;
|
||||
}
|
||||
|
||||
void NodeDB::installDefaultConfig()
|
||||
{
|
||||
memset(&config, 0, sizeof(config));
|
||||
}
|
||||
|
||||
void NodeDB::installDefaultRadioConfig()
|
||||
{
|
||||
memset(&radioConfig, 0, sizeof(radioConfig));
|
||||
@@ -280,6 +286,7 @@ void NodeDB::pickNewNodeNum()
|
||||
|
||||
static const char *preffile = "/prefs/db.proto";
|
||||
static const char *radiofile = "/prefs/radio.proto";
|
||||
static const char *configfile = "/prefs/config.proto";
|
||||
static const char *channelfile = "/prefs/channels.proto";
|
||||
|
||||
/** Load a protobuf from a file, return true for success */
|
||||
@@ -332,6 +339,10 @@ void NodeDB::loadFromDisk()
|
||||
installDefaultRadioConfig(); // Our in RAM copy might now be corrupt
|
||||
}
|
||||
|
||||
if (!loadProto(configfile, Config_size, sizeof(Config), Config_fields, &config)) {
|
||||
installDefaultConfig(); // Our in RAM copy might now be corrupt
|
||||
}
|
||||
|
||||
if (!loadProto(channelfile, ChannelFile_size, sizeof(ChannelFile), ChannelFile_fields, &channelFile)) {
|
||||
installDefaultChannels(); // Our in RAM copy might now be corrupt
|
||||
}
|
||||
@@ -390,6 +401,7 @@ void NodeDB::saveToDisk()
|
||||
#endif
|
||||
saveProto(preffile, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate);
|
||||
saveProto(radiofile, RadioConfig_size, sizeof(RadioConfig), RadioConfig_fields, &radioConfig);
|
||||
saveProto(configfile, Config_size, sizeof(Config), Config_fields, &config);
|
||||
saveChannelsToDisk();
|
||||
|
||||
} else {
|
||||
|
||||
@@ -12,6 +12,7 @@ extern DeviceState devicestate;
|
||||
extern ChannelFile channelFile;
|
||||
extern MyNodeInfo &myNodeInfo;
|
||||
extern RadioConfig radioConfig;
|
||||
extern Config config;
|
||||
extern User &owner;
|
||||
|
||||
/// Given a node, return how many seconds in the past (vs now) that we last heard from it
|
||||
@@ -122,7 +123,7 @@ class NodeDB
|
||||
void loadFromDisk();
|
||||
|
||||
/// Reinit device state from scratch (not loading from disk)
|
||||
void installDefaultDeviceState(), installDefaultRadioConfig(), installDefaultChannels();
|
||||
void installDefaultDeviceState(), installDefaultRadioConfig(), installDefaultChannels(), installDefaultConfig();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -161,13 +162,17 @@ extern NodeDB nodeDB;
|
||||
|
||||
#define IF_ROUTER(routerVal, normalVal) ((radioConfig.preferences.role == Role_Router) ? (routerVal) : (normalVal))
|
||||
|
||||
#define default_broadcast_interval_secs IF_ROUTER(12 * 60 * 60, 15 * 60)
|
||||
|
||||
inline uint32_t getIntervalOrDefaultMs(uint32_t interval) {
|
||||
if (interval > 0) return interval * 1000;
|
||||
return default_broadcast_interval_secs * 1000;
|
||||
}
|
||||
|
||||
#define PREF_GET(name, defaultVal) \
|
||||
inline uint32_t getPref_##name() { return radioConfig.preferences.name ? radioConfig.preferences.name : (defaultVal); }
|
||||
|
||||
PREF_GET(position_broadcast_secs, IF_ROUTER(12 * 60 * 60, 15 * 60))
|
||||
// Defaulting Telemetry to the same as position interval for now
|
||||
PREF_GET(telemetry_module_device_update_interval, IF_ROUTER(12 * 60 * 60, 15 * 60))
|
||||
PREF_GET(telemetry_module_environment_update_interval, IF_ROUTER(12 * 60 * 60, 15 * 60))
|
||||
|
||||
|
||||
// Each time we wake into the DARK state allow 1 minute to send and receive BLE packets to the phone
|
||||
@@ -189,3 +194,5 @@ PREF_GET(min_wake_secs, 10)
|
||||
*/
|
||||
extern uint32_t radioGeneration;
|
||||
|
||||
// Config doesn't have a nanopb generated full size constant
|
||||
#define Config_size (Config_DeviceConfig_size + Config_DisplayConfig_size + Config_GpsConfig_size + Config_LoRaConfig_size + Config_ModuleConfig_CannedMessageConfig_size + Config_ModuleConfig_ExternalNotificationConfig_size + Config_ModuleConfig_MQTTConfig_size + Config_ModuleConfig_RangeTestConfig_size + Config_ModuleConfig_SerialConfig_size + Config_ModuleConfig_StoreForwardConfig_size + Config_ModuleConfig_TelemetryConfig_size + Config_ModuleConfig_size + Config_PowerConfig_size)
|
||||
@@ -65,7 +65,7 @@ bool SX126xInterface<T>::init()
|
||||
#ifdef SX126X_TXEN
|
||||
// lora.begin sets Dio2 as RF switch control, which is not true if we are manually controlling RX and TX
|
||||
if (res == ERR_NONE)
|
||||
res = lora.setDio2AsRfSwitch(false);
|
||||
res = lora.setDio2AsRfSwitch(true);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
@@ -194,6 +194,9 @@ void SX126xInterface<T>::configHardwareForSend()
|
||||
#ifdef SX126X_TXEN // we have RXEN/TXEN control - turn on TX power / off RX power
|
||||
digitalWrite(SX126X_TXEN, HIGH);
|
||||
#endif
|
||||
#ifdef SX126X_RXEN
|
||||
digitalWrite(SX126X_RXEN, LOW);
|
||||
#endif
|
||||
|
||||
RadioLibInterface::configHardwareForSend();
|
||||
}
|
||||
@@ -213,7 +216,10 @@ void SX126xInterface<T>::startReceive()
|
||||
#ifdef SX126X_RXEN // we have RXEN/TXEN control - turn on RX power / off TX power
|
||||
digitalWrite(SX126X_RXEN, HIGH);
|
||||
#endif
|
||||
|
||||
#ifdef SX126X_TXEN
|
||||
digitalWrite(SX126X_TXEN, LOW);
|
||||
#endif
|
||||
|
||||
// int err = lora.startReceive();
|
||||
int err = lora.startReceiveDutyCycleAuto(); // We use a 32 bit preamble so this should save some power by letting radio sit in
|
||||
// standby mostly.
|
||||
@@ -283,4 +289,4 @@ bool SX126xInterface<T>::sleep()
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ PB_BIND(AdminMessage, AdminMessage, 2)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#define PB_ADMIN_PB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include "channel.pb.h"
|
||||
#include "config.pb.h"
|
||||
#include "mesh.pb.h"
|
||||
#include "radioconfig.pb.h"
|
||||
|
||||
@@ -12,6 +13,26 @@
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _AdminMessage_ConfigType {
|
||||
AdminMessage_ConfigType_ALL = 0,
|
||||
AdminMessage_ConfigType_CORE_ONLY = 1,
|
||||
AdminMessage_ConfigType_MODULE_ONLY = 2,
|
||||
AdminMessage_ConfigType_DEVICE_CONFIG = 3,
|
||||
AdminMessage_ConfigType_GPS_CONFIG = 4,
|
||||
AdminMessage_ConfigType_POWER_CONFIG = 5,
|
||||
AdminMessage_ConfigType_WIFI_CONFIG = 6,
|
||||
AdminMessage_ConfigType_DISPLAY_CONFIG = 7,
|
||||
AdminMessage_ConfigType_LORA_CONFIG = 8,
|
||||
AdminMessage_ConfigType_MODULE_MQTT_CONFIG = 9,
|
||||
AdminMessage_ConfigType_MODULE_SERIAL_CONFIG = 10,
|
||||
AdminMessage_ConfigType_MODULE_EXTNOTIF_CONFIG = 11,
|
||||
AdminMessage_ConfigType_MODULE_STOREFORWARD_CONFIG = 12,
|
||||
AdminMessage_ConfigType_MODULE_RANGETEST_CONFIG = 13,
|
||||
AdminMessage_ConfigType_MODULE_TELEMETRY_CONFIG = 14,
|
||||
AdminMessage_ConfigType_MODULE_CANNEDMSG_CONFIG = 15
|
||||
} AdminMessage_ConfigType;
|
||||
|
||||
/* Struct definitions */
|
||||
/* This message is handled by the Admin module and is responsible for all settings/channel read/write operations.
|
||||
This message is used to do settings operations to both remote AND local nodes.
|
||||
@@ -29,6 +50,10 @@ typedef struct _AdminMessage {
|
||||
Channel get_channel_response;
|
||||
bool get_owner_request;
|
||||
User get_owner_response;
|
||||
AdminMessage_ConfigType get_config_request;
|
||||
Config get_config_response;
|
||||
Config set_config;
|
||||
bool confirm_set_config;
|
||||
bool confirm_set_channel;
|
||||
bool confirm_set_radio;
|
||||
bool exit_simulator;
|
||||
@@ -50,6 +75,12 @@ typedef struct _AdminMessage {
|
||||
} AdminMessage;
|
||||
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _AdminMessage_ConfigType_MIN AdminMessage_ConfigType_ALL
|
||||
#define _AdminMessage_ConfigType_MAX AdminMessage_ConfigType_MODULE_CANNEDMSG_CONFIG
|
||||
#define _AdminMessage_ConfigType_ARRAYSIZE ((AdminMessage_ConfigType)(AdminMessage_ConfigType_MODULE_CANNEDMSG_CONFIG+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -68,6 +99,10 @@ extern "C" {
|
||||
#define AdminMessage_get_channel_response_tag 7
|
||||
#define AdminMessage_get_owner_request_tag 8
|
||||
#define AdminMessage_get_owner_response_tag 9
|
||||
#define AdminMessage_get_config_request_tag 10
|
||||
#define AdminMessage_get_config_response_tag 11
|
||||
#define AdminMessage_set_config_tag 12
|
||||
#define AdminMessage_confirm_set_config_tag 13
|
||||
#define AdminMessage_confirm_set_channel_tag 32
|
||||
#define AdminMessage_confirm_set_radio_tag 33
|
||||
#define AdminMessage_exit_simulator_tag 34
|
||||
@@ -97,6 +132,10 @@ X(a, STATIC, ONEOF, UINT32, (variant,get_channel_request,get_channel_requ
|
||||
X(a, STATIC, ONEOF, MESSAGE, (variant,get_channel_response,get_channel_response), 7) \
|
||||
X(a, STATIC, ONEOF, BOOL, (variant,get_owner_request,get_owner_request), 8) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (variant,get_owner_response,get_owner_response), 9) \
|
||||
X(a, STATIC, ONEOF, UENUM, (variant,get_config_request,get_config_request), 10) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (variant,get_config_response,get_config_response), 11) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (variant,set_config,set_config), 12) \
|
||||
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_config,confirm_set_config), 13) \
|
||||
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_channel,confirm_set_channel), 32) \
|
||||
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_radio,confirm_set_radio), 33) \
|
||||
X(a, STATIC, ONEOF, BOOL, (variant,exit_simulator,exit_simulator), 34) \
|
||||
@@ -122,6 +161,8 @@ X(a, STATIC, ONEOF, INT32, (variant,shutdown_seconds,shutdown_seconds),
|
||||
#define AdminMessage_variant_get_radio_response_MSGTYPE RadioConfig
|
||||
#define AdminMessage_variant_get_channel_response_MSGTYPE Channel
|
||||
#define AdminMessage_variant_get_owner_response_MSGTYPE User
|
||||
#define AdminMessage_variant_get_config_response_MSGTYPE Config
|
||||
#define AdminMessage_variant_set_config_MSGTYPE Config
|
||||
|
||||
extern const pb_msgdesc_t AdminMessage_msg;
|
||||
|
||||
@@ -129,7 +170,10 @@ extern const pb_msgdesc_t AdminMessage_msg;
|
||||
#define AdminMessage_fields &AdminMessage_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define AdminMessage_size 598
|
||||
#if defined(Config_size) && defined(Config_size)
|
||||
#define AdminMessage_size (0 + sizeof(union AdminMessage_variant_size_union))
|
||||
union AdminMessage_variant_size_union {char f0[551]; char f11[(6 + Config_size)]; char f12[(6 + Config_size)];};
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
54
src/mesh/generated/config.pb.c
Normal file
54
src/mesh/generated/config.pb.c
Normal file
@@ -0,0 +1,54 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
|
||||
#include "config.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
PB_BIND(Config, Config, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_DeviceConfig, Config_DeviceConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_GpsConfig, Config_GpsConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_PowerConfig, Config_PowerConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_WiFiConfig, Config_WiFiConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_DisplayConfig, Config_DisplayConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_LoRaConfig, Config_LoRaConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig, Config_ModuleConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_MQTTConfig, Config_ModuleConfig_MQTTConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_SerialConfig, Config_ModuleConfig_SerialConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_ExternalNotificationConfig, Config_ModuleConfig_ExternalNotificationConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_StoreForwardConfig, Config_ModuleConfig_StoreForwardConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_RangeTestConfig, Config_ModuleConfig_RangeTestConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_TelemetryConfig, Config_ModuleConfig_TelemetryConfig, AUTO)
|
||||
|
||||
|
||||
PB_BIND(Config_ModuleConfig_CannedMessageConfig, Config_ModuleConfig_CannedMessageConfig, AUTO)
|
||||
|
||||
|
||||
|
||||
334
src/mesh/generated/config.pb.h
Normal file
334
src/mesh/generated/config.pb.h
Normal file
@@ -0,0 +1,334 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
|
||||
#ifndef PB_CONFIG_PB_H_INCLUDED
|
||||
#define PB_CONFIG_PB_H_INCLUDED
|
||||
#include <pb.h>
|
||||
#include "telemetry.pb.h"
|
||||
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _Config_DeviceConfig {
|
||||
char dummy_field;
|
||||
} Config_DeviceConfig;
|
||||
|
||||
typedef struct _Config_DisplayConfig {
|
||||
char dummy_field;
|
||||
} Config_DisplayConfig;
|
||||
|
||||
typedef struct _Config_GpsConfig {
|
||||
char dummy_field;
|
||||
} Config_GpsConfig;
|
||||
|
||||
typedef struct _Config_LoRaConfig {
|
||||
char dummy_field;
|
||||
} Config_LoRaConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_CannedMessageConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_CannedMessageConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_ExternalNotificationConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_ExternalNotificationConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_MQTTConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_MQTTConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_RangeTestConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_RangeTestConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_SerialConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_SerialConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_StoreForwardConfig {
|
||||
char dummy_field;
|
||||
} Config_ModuleConfig_StoreForwardConfig;
|
||||
|
||||
typedef struct _Config_PowerConfig {
|
||||
char dummy_field;
|
||||
} Config_PowerConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig_TelemetryConfig {
|
||||
uint32_t device_update_interval;
|
||||
uint32_t environment_update_interval;
|
||||
bool environment_measurement_enabled;
|
||||
bool environment_screen_enabled;
|
||||
uint32_t environment_read_error_count_threshold;
|
||||
uint32_t environment_recovery_interval;
|
||||
bool environment_display_fahrenheit;
|
||||
TelemetrySensorType environment_sensor_type;
|
||||
uint32_t environment_sensor_pin;
|
||||
} Config_ModuleConfig_TelemetryConfig;
|
||||
|
||||
typedef struct _Config_WiFiConfig {
|
||||
pb_callback_t wifi_ssid;
|
||||
pb_callback_t wifi_password;
|
||||
bool wifi_ap_mode;
|
||||
} Config_WiFiConfig;
|
||||
|
||||
typedef struct _Config_ModuleConfig {
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
Config_ModuleConfig_MQTTConfig mqtt_config;
|
||||
Config_ModuleConfig_SerialConfig serial_config;
|
||||
Config_ModuleConfig_ExternalNotificationConfig external_notification_config;
|
||||
Config_ModuleConfig_StoreForwardConfig store_forward_config;
|
||||
Config_ModuleConfig_RangeTestConfig range_test_config;
|
||||
Config_ModuleConfig_TelemetryConfig telemetry_config;
|
||||
Config_ModuleConfig_CannedMessageConfig canned_message_config;
|
||||
} payloadVariant;
|
||||
} Config_ModuleConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
/* TODO: REPLACE */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
Config_DeviceConfig device_config;
|
||||
Config_GpsConfig gps_config;
|
||||
Config_PowerConfig power_config;
|
||||
Config_WiFiConfig wifi_config;
|
||||
Config_DisplayConfig display_config;
|
||||
Config_LoRaConfig lora_config;
|
||||
Config_ModuleConfig module_config;
|
||||
} payloadVariant;
|
||||
} Config;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define Config_init_default {0, {Config_DeviceConfig_init_default}}
|
||||
#define Config_DeviceConfig_init_default {0}
|
||||
#define Config_GpsConfig_init_default {0}
|
||||
#define Config_PowerConfig_init_default {0}
|
||||
#define Config_WiFiConfig_init_default {{{NULL}, NULL}, {{NULL}, NULL}, 0}
|
||||
#define Config_DisplayConfig_init_default {0}
|
||||
#define Config_LoRaConfig_init_default {0}
|
||||
#define Config_ModuleConfig_init_default {0, {Config_ModuleConfig_MQTTConfig_init_default}}
|
||||
#define Config_ModuleConfig_MQTTConfig_init_default {0}
|
||||
#define Config_ModuleConfig_SerialConfig_init_default {0}
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_init_default {0}
|
||||
#define Config_ModuleConfig_StoreForwardConfig_init_default {0}
|
||||
#define Config_ModuleConfig_RangeTestConfig_init_default {0}
|
||||
#define Config_ModuleConfig_TelemetryConfig_init_default {0, 0, 0, 0, 0, 0, 0, _TelemetrySensorType_MIN, 0}
|
||||
#define Config_ModuleConfig_CannedMessageConfig_init_default {0}
|
||||
#define Config_init_zero {0, {Config_DeviceConfig_init_zero}}
|
||||
#define Config_DeviceConfig_init_zero {0}
|
||||
#define Config_GpsConfig_init_zero {0}
|
||||
#define Config_PowerConfig_init_zero {0}
|
||||
#define Config_WiFiConfig_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, 0}
|
||||
#define Config_DisplayConfig_init_zero {0}
|
||||
#define Config_LoRaConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_init_zero {0, {Config_ModuleConfig_MQTTConfig_init_zero}}
|
||||
#define Config_ModuleConfig_MQTTConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_SerialConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_StoreForwardConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_RangeTestConfig_init_zero {0}
|
||||
#define Config_ModuleConfig_TelemetryConfig_init_zero {0, 0, 0, 0, 0, 0, 0, _TelemetrySensorType_MIN, 0}
|
||||
#define Config_ModuleConfig_CannedMessageConfig_init_zero {0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define Config_ModuleConfig_TelemetryConfig_device_update_interval_tag 1
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_update_interval_tag 2
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_read_error_count_threshold_tag 5
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_recovery_interval_tag 6
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 7
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_sensor_type_tag 8
|
||||
#define Config_ModuleConfig_TelemetryConfig_environment_sensor_pin_tag 9
|
||||
#define Config_WiFiConfig_wifi_ssid_tag 1
|
||||
#define Config_WiFiConfig_wifi_password_tag 2
|
||||
#define Config_WiFiConfig_wifi_ap_mode_tag 3
|
||||
#define Config_ModuleConfig_mqtt_config_tag 1
|
||||
#define Config_ModuleConfig_serial_config_tag 2
|
||||
#define Config_ModuleConfig_external_notification_config_tag 3
|
||||
#define Config_ModuleConfig_store_forward_config_tag 4
|
||||
#define Config_ModuleConfig_range_test_config_tag 5
|
||||
#define Config_ModuleConfig_telemetry_config_tag 6
|
||||
#define Config_ModuleConfig_canned_message_config_tag 7
|
||||
#define Config_device_config_tag 1
|
||||
#define Config_gps_config_tag 2
|
||||
#define Config_power_config_tag 3
|
||||
#define Config_wifi_config_tag 4
|
||||
#define Config_display_config_tag 5
|
||||
#define Config_lora_config_tag 6
|
||||
#define Config_module_config_tag 7
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define Config_FIELDLIST(X, a) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,device_config,payloadVariant.device_config), 1) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,gps_config,payloadVariant.gps_config), 2) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,power_config,payloadVariant.power_config), 3) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,wifi_config,payloadVariant.wifi_config), 4) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,display_config,payloadVariant.display_config), 5) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,lora_config,payloadVariant.lora_config), 6) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,module_config,payloadVariant.module_config), 7)
|
||||
#define Config_CALLBACK NULL
|
||||
#define Config_DEFAULT NULL
|
||||
#define Config_payloadVariant_device_config_MSGTYPE Config_DeviceConfig
|
||||
#define Config_payloadVariant_gps_config_MSGTYPE Config_GpsConfig
|
||||
#define Config_payloadVariant_power_config_MSGTYPE Config_PowerConfig
|
||||
#define Config_payloadVariant_wifi_config_MSGTYPE Config_WiFiConfig
|
||||
#define Config_payloadVariant_display_config_MSGTYPE Config_DisplayConfig
|
||||
#define Config_payloadVariant_lora_config_MSGTYPE Config_LoRaConfig
|
||||
#define Config_payloadVariant_module_config_MSGTYPE Config_ModuleConfig
|
||||
|
||||
#define Config_DeviceConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_DeviceConfig_CALLBACK NULL
|
||||
#define Config_DeviceConfig_DEFAULT NULL
|
||||
|
||||
#define Config_GpsConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_GpsConfig_CALLBACK NULL
|
||||
#define Config_GpsConfig_DEFAULT NULL
|
||||
|
||||
#define Config_PowerConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_PowerConfig_CALLBACK NULL
|
||||
#define Config_PowerConfig_DEFAULT NULL
|
||||
|
||||
#define Config_WiFiConfig_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, SINGULAR, STRING, wifi_ssid, 1) \
|
||||
X(a, CALLBACK, SINGULAR, STRING, wifi_password, 2) \
|
||||
X(a, STATIC, SINGULAR, BOOL, wifi_ap_mode, 3)
|
||||
#define Config_WiFiConfig_CALLBACK pb_default_field_callback
|
||||
#define Config_WiFiConfig_DEFAULT NULL
|
||||
|
||||
#define Config_DisplayConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_DisplayConfig_CALLBACK NULL
|
||||
#define Config_DisplayConfig_DEFAULT NULL
|
||||
|
||||
#define Config_LoRaConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_LoRaConfig_CALLBACK NULL
|
||||
#define Config_LoRaConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_FIELDLIST(X, a) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,mqtt_config,payloadVariant.mqtt_config), 1) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,serial_config,payloadVariant.serial_config), 2) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,external_notification_config,payloadVariant.external_notification_config), 3) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,store_forward_config,payloadVariant.store_forward_config), 4) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,range_test_config,payloadVariant.range_test_config), 5) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,telemetry_config,payloadVariant.telemetry_config), 6) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,canned_message_config,payloadVariant.canned_message_config), 7)
|
||||
#define Config_ModuleConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_DEFAULT NULL
|
||||
#define Config_ModuleConfig_payloadVariant_mqtt_config_MSGTYPE Config_ModuleConfig_MQTTConfig
|
||||
#define Config_ModuleConfig_payloadVariant_serial_config_MSGTYPE Config_ModuleConfig_SerialConfig
|
||||
#define Config_ModuleConfig_payloadVariant_external_notification_config_MSGTYPE Config_ModuleConfig_ExternalNotificationConfig
|
||||
#define Config_ModuleConfig_payloadVariant_store_forward_config_MSGTYPE Config_ModuleConfig_StoreForwardConfig
|
||||
#define Config_ModuleConfig_payloadVariant_range_test_config_MSGTYPE Config_ModuleConfig_RangeTestConfig
|
||||
#define Config_ModuleConfig_payloadVariant_telemetry_config_MSGTYPE Config_ModuleConfig_TelemetryConfig
|
||||
#define Config_ModuleConfig_payloadVariant_canned_message_config_MSGTYPE Config_ModuleConfig_CannedMessageConfig
|
||||
|
||||
#define Config_ModuleConfig_MQTTConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_MQTTConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_MQTTConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_SerialConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_SerialConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_SerialConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_StoreForwardConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_StoreForwardConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_StoreForwardConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_RangeTestConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_RangeTestConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_RangeTestConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_TelemetryConfig_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, device_update_interval, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, environment_update_interval, 2) \
|
||||
X(a, STATIC, SINGULAR, BOOL, environment_measurement_enabled, 3) \
|
||||
X(a, STATIC, SINGULAR, BOOL, environment_screen_enabled, 4) \
|
||||
X(a, STATIC, SINGULAR, UINT32, environment_read_error_count_threshold, 5) \
|
||||
X(a, STATIC, SINGULAR, UINT32, environment_recovery_interval, 6) \
|
||||
X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 7) \
|
||||
X(a, STATIC, SINGULAR, UENUM, environment_sensor_type, 8) \
|
||||
X(a, STATIC, SINGULAR, UINT32, environment_sensor_pin, 9)
|
||||
#define Config_ModuleConfig_TelemetryConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_TelemetryConfig_DEFAULT NULL
|
||||
|
||||
#define Config_ModuleConfig_CannedMessageConfig_FIELDLIST(X, a) \
|
||||
|
||||
#define Config_ModuleConfig_CannedMessageConfig_CALLBACK NULL
|
||||
#define Config_ModuleConfig_CannedMessageConfig_DEFAULT NULL
|
||||
|
||||
extern const pb_msgdesc_t Config_msg;
|
||||
extern const pb_msgdesc_t Config_DeviceConfig_msg;
|
||||
extern const pb_msgdesc_t Config_GpsConfig_msg;
|
||||
extern const pb_msgdesc_t Config_PowerConfig_msg;
|
||||
extern const pb_msgdesc_t Config_WiFiConfig_msg;
|
||||
extern const pb_msgdesc_t Config_DisplayConfig_msg;
|
||||
extern const pb_msgdesc_t Config_LoRaConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_MQTTConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_SerialConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_ExternalNotificationConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_StoreForwardConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_RangeTestConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_TelemetryConfig_msg;
|
||||
extern const pb_msgdesc_t Config_ModuleConfig_CannedMessageConfig_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define Config_fields &Config_msg
|
||||
#define Config_DeviceConfig_fields &Config_DeviceConfig_msg
|
||||
#define Config_GpsConfig_fields &Config_GpsConfig_msg
|
||||
#define Config_PowerConfig_fields &Config_PowerConfig_msg
|
||||
#define Config_WiFiConfig_fields &Config_WiFiConfig_msg
|
||||
#define Config_DisplayConfig_fields &Config_DisplayConfig_msg
|
||||
#define Config_LoRaConfig_fields &Config_LoRaConfig_msg
|
||||
#define Config_ModuleConfig_fields &Config_ModuleConfig_msg
|
||||
#define Config_ModuleConfig_MQTTConfig_fields &Config_ModuleConfig_MQTTConfig_msg
|
||||
#define Config_ModuleConfig_SerialConfig_fields &Config_ModuleConfig_SerialConfig_msg
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_fields &Config_ModuleConfig_ExternalNotificationConfig_msg
|
||||
#define Config_ModuleConfig_StoreForwardConfig_fields &Config_ModuleConfig_StoreForwardConfig_msg
|
||||
#define Config_ModuleConfig_RangeTestConfig_fields &Config_ModuleConfig_RangeTestConfig_msg
|
||||
#define Config_ModuleConfig_TelemetryConfig_fields &Config_ModuleConfig_TelemetryConfig_msg
|
||||
#define Config_ModuleConfig_CannedMessageConfig_fields &Config_ModuleConfig_CannedMessageConfig_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* Config_size depends on runtime parameters */
|
||||
/* Config_WiFiConfig_size depends on runtime parameters */
|
||||
#define Config_DeviceConfig_size 0
|
||||
#define Config_DisplayConfig_size 0
|
||||
#define Config_GpsConfig_size 0
|
||||
#define Config_LoRaConfig_size 0
|
||||
#define Config_ModuleConfig_CannedMessageConfig_size 0
|
||||
#define Config_ModuleConfig_ExternalNotificationConfig_size 0
|
||||
#define Config_ModuleConfig_MQTTConfig_size 0
|
||||
#define Config_ModuleConfig_RangeTestConfig_size 0
|
||||
#define Config_ModuleConfig_SerialConfig_size 0
|
||||
#define Config_ModuleConfig_StoreForwardConfig_size 0
|
||||
#define Config_ModuleConfig_TelemetryConfig_size 38
|
||||
#define Config_ModuleConfig_size 40
|
||||
#define Config_PowerConfig_size 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -159,7 +159,7 @@ extern const pb_msgdesc_t OEMStore_msg;
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define ChannelFile_size 832
|
||||
#define DeviceState_size 19327
|
||||
#define DeviceState_size 19197
|
||||
#define OEMStore_size 2106
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -69,41 +69,6 @@ typedef enum _HardwareModel {
|
||||
HardwareModel_PRIVATE_HW = 255
|
||||
} HardwareModel;
|
||||
|
||||
/* The team colors are based on the names of "friendly teams" in ATAK:
|
||||
https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV/blob/master/atak/ATAK/app/src/main/assets/filters/team_filters.xml */
|
||||
typedef enum _Team {
|
||||
/* the default (unset) is "achromatic" (unaffiliated) */
|
||||
Team_CLEAR = 0,
|
||||
/* TODO: REPLACE */
|
||||
Team_CYAN = 1,
|
||||
/* TODO: REPLACE */
|
||||
Team_WHITE = 2,
|
||||
/* TODO: REPLACE */
|
||||
Team_YELLOW = 3,
|
||||
/* TODO: REPLACE */
|
||||
Team_ORANGE = 4,
|
||||
/* TODO: REPLACE */
|
||||
Team_MAGENTA = 5,
|
||||
/* TODO: REPLACE */
|
||||
Team_RED = 6,
|
||||
/* TODO: REPLACE */
|
||||
Team_MAROON = 7,
|
||||
/* TODO: REPLACE */
|
||||
Team_PURPLE = 8,
|
||||
/* TODO: REPLACE */
|
||||
Team_DARK_BLUE = 9,
|
||||
/* TODO: REPLACE */
|
||||
Team_BLUE = 10,
|
||||
/* TODO: REPLACE */
|
||||
Team_TEAL = 11,
|
||||
/* TODO: REPLACE */
|
||||
Team_GREEN = 12,
|
||||
/* TODO: REPLACE */
|
||||
Team_DARK_GREEN = 13,
|
||||
/* TODO: REPLACE */
|
||||
Team_BROWN = 14
|
||||
} Team;
|
||||
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _Constants {
|
||||
/* First enum must be zero, and we are just using this enum to
|
||||
@@ -164,18 +129,17 @@ typedef enum _Position_LocSource {
|
||||
Position_LocSource_LOCSRC_GPS_EXTERNAL = 3
|
||||
} Position_LocSource;
|
||||
|
||||
/* The team colors are based on the names of "friendly teams" in ATAK:
|
||||
https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV/blob/master/atak/ATAK/app/src/main/assets/filters/team_filters.xml */
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _Position_AltSource {
|
||||
/* the default (unset) is "achromatic" (unaffiliated) */
|
||||
/* First enum must be zero, and we are just using this enum to
|
||||
pass int constants between two very different environments */
|
||||
Position_AltSource_ALTSRC_UNSPECIFIED = 0,
|
||||
/* TODO: REPLACE */
|
||||
/* From mesh.options
|
||||
note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
|
||||
outside of this envelope */
|
||||
Position_AltSource_ALTSRC_MANUAL_ENTRY = 1,
|
||||
/* TODO: REPLACE */
|
||||
Position_AltSource_ALTSRC_GPS_INTERNAL = 2,
|
||||
/* TODO: REPLACE */
|
||||
Position_AltSource_ALTSRC_GPS_EXTERNAL = 3,
|
||||
/* TODO: REPLACE */
|
||||
Position_AltSource_ALTSRC_BAROMETRIC = 4
|
||||
} Position_AltSource;
|
||||
|
||||
@@ -232,14 +196,15 @@ typedef enum _MeshPacket_Priority {
|
||||
MeshPacket_Priority_MAX = 127
|
||||
} MeshPacket_Priority;
|
||||
|
||||
/* The team colors are based on the names of "friendly teams" in ATAK:
|
||||
https://github.com/deptofdefense/AndroidTacticalAssaultKit-CIV/blob/master/atak/ATAK/app/src/main/assets/filters/team_filters.xml */
|
||||
/* Shared constants between device and phone */
|
||||
typedef enum _MeshPacket_Delayed {
|
||||
/* the default (unset) is "achromatic" (unaffiliated) */
|
||||
/* First enum must be zero, and we are just using this enum to
|
||||
pass int constants between two very different environments */
|
||||
MeshPacket_Delayed_NO_DELAY = 0,
|
||||
/* TODO: REPLACE */
|
||||
/* From mesh.options
|
||||
note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
|
||||
outside of this envelope */
|
||||
MeshPacket_Delayed_DELAYED_BROADCAST = 1,
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_Delayed_DELAYED_DIRECT = 2
|
||||
} MeshPacket_Delayed;
|
||||
|
||||
@@ -480,12 +445,6 @@ typedef struct _User {
|
||||
If this user is a licensed operator, set this flag.
|
||||
Also, "long_name" should be their licence number. */
|
||||
bool is_licensed;
|
||||
/* Participants in the same network can self-group into different teams.
|
||||
Short-term this can be used to visually differentiate them on the map;
|
||||
in the longer term it could also help users to semi-automatically
|
||||
select or ignore messages according to team affiliation.
|
||||
In total, 14 teams are defined (encoded in 4 bits) */
|
||||
Team team;
|
||||
/* Transmit power at antenna connector, in decibel-milliwatt
|
||||
An optional self-reported value useful in network planning, discovery
|
||||
and positioning - along with ant_gain_dbi and ant_azimuth below */
|
||||
@@ -697,10 +656,6 @@ typedef struct _ToRadio {
|
||||
#define _HardwareModel_MAX HardwareModel_PRIVATE_HW
|
||||
#define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_PRIVATE_HW+1))
|
||||
|
||||
#define _Team_MIN Team_CLEAR
|
||||
#define _Team_MAX Team_BROWN
|
||||
#define _Team_ARRAYSIZE ((Team)(Team_BROWN+1))
|
||||
|
||||
#define _Constants_MIN Constants_Unused
|
||||
#define _Constants_MAX Constants_DATA_PAYLOAD_LEN
|
||||
#define _Constants_ARRAYSIZE ((Constants)(Constants_DATA_PAYLOAD_LEN+1))
|
||||
@@ -740,7 +695,7 @@ extern "C" {
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define Position_init_default {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0}
|
||||
#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
||||
#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||
#define Routing_init_default {0, {RouteDiscovery_init_default}}
|
||||
#define Data_init_default {_PortNum_MIN, 0, {{0, {0}}}, 0, 0, 0, 0, 0, 0, false, Location_init_default}
|
||||
@@ -753,7 +708,7 @@ extern "C" {
|
||||
#define ToRadio_init_default {0, {MeshPacket_init_default}}
|
||||
#define ToRadio_PeerInfo_init_default {0, 0}
|
||||
#define Position_init_zero {0, 0, 0, 0, _Position_LocSource_MIN, _Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, _Team_MIN, 0, 0, 0}
|
||||
#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
||||
#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
|
||||
#define Data_init_zero {_PortNum_MIN, 0, {{0, {0}}}, 0, 0, 0, 0, 0, 0, false, Location_init_zero}
|
||||
@@ -824,7 +779,6 @@ extern "C" {
|
||||
#define User_macaddr_tag 4
|
||||
#define User_hw_model_tag 6
|
||||
#define User_is_licensed_tag 7
|
||||
#define User_team_tag 8
|
||||
#define User_tx_power_dbm_tag 10
|
||||
#define User_ant_gain_dbi_tag 11
|
||||
#define User_ant_azimuth_tag 12
|
||||
@@ -906,7 +860,6 @@ X(a, STATIC, SINGULAR, STRING, short_name, 3) \
|
||||
X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \
|
||||
X(a, STATIC, SINGULAR, UENUM, hw_model, 6) \
|
||||
X(a, STATIC, SINGULAR, BOOL, is_licensed, 7) \
|
||||
X(a, STATIC, SINGULAR, UENUM, team, 8) \
|
||||
X(a, STATIC, SINGULAR, UINT32, tx_power_dbm, 10) \
|
||||
X(a, STATIC, SINGULAR, UINT32, ant_gain_dbi, 11) \
|
||||
X(a, STATIC, SINGULAR, UINT32, ant_azimuth, 12)
|
||||
@@ -1078,13 +1031,13 @@ extern const pb_msgdesc_t ToRadio_PeerInfo_msg;
|
||||
#define LogRecord_size 81
|
||||
#define MeshPacket_size 347
|
||||
#define MyNodeInfo_size 210
|
||||
#define NodeInfo_size 283
|
||||
#define NodeInfo_size 281
|
||||
#define Position_size 142
|
||||
#define RouteDiscovery_size 40
|
||||
#define Routing_size 42
|
||||
#define ToRadio_PeerInfo_size 8
|
||||
#define ToRadio_size 350
|
||||
#define User_size 97
|
||||
#define User_size 95
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -21,4 +21,3 @@ PB_BIND(RadioConfig_UserPreferences, RadioConfig_UserPreferences, 2)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -237,31 +237,6 @@ typedef enum _RadioConfig_UserPreferences_Serial_Mode {
|
||||
RadioConfig_UserPreferences_Serial_Mode_MODE_PROTO = 2
|
||||
} RadioConfig_UserPreferences_Serial_Mode;
|
||||
|
||||
/* Sets the charge control current of devices with a battery charger that can be
|
||||
configured. This is passed into the axp power management chip like on the tbeam. */
|
||||
typedef enum _RadioConfig_UserPreferences_TelemetrySensorType {
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_None = 0,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_DHT11 = 1,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_DS18B20 = 2,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_DHT12 = 3,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_DHT21 = 4,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_DHT22 = 5,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_BME280 = 6,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_BME680 = 7,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_MCP9808 = 8,
|
||||
/* TODO: REPLACE */
|
||||
RadioConfig_UserPreferences_TelemetrySensorType_SHTC3 = 9
|
||||
} RadioConfig_UserPreferences_TelemetrySensorType;
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _RadioConfig_UserPreferences {
|
||||
uint32_t position_broadcast_secs;
|
||||
@@ -314,14 +289,6 @@ typedef struct _RadioConfig_UserPreferences {
|
||||
uint32_t store_forward_module_records;
|
||||
uint32_t store_forward_module_history_return_max;
|
||||
uint32_t store_forward_module_history_return_window;
|
||||
bool telemetry_module_environment_measurement_enabled;
|
||||
bool telemetry_module_environment_screen_enabled;
|
||||
uint32_t telemetry_module_environment_read_error_count_threshold;
|
||||
uint32_t telemetry_module_device_update_interval;
|
||||
uint32_t telemetry_module_environment_recovery_interval;
|
||||
bool telemetry_module_environment_display_fahrenheit;
|
||||
RadioConfig_UserPreferences_TelemetrySensorType telemetry_module_environment_sensor_type;
|
||||
uint32_t telemetry_module_environment_sensor_pin;
|
||||
bool store_forward_module_enabled;
|
||||
bool store_forward_module_heartbeat;
|
||||
uint32_t position_flags;
|
||||
@@ -347,7 +314,6 @@ typedef struct _RadioConfig_UserPreferences {
|
||||
bool mqtt_encryption_enabled;
|
||||
float adc_multiplier_override;
|
||||
RadioConfig_UserPreferences_Serial_Baud serial_module_baud;
|
||||
uint32_t telemetry_module_environment_update_interval;
|
||||
} RadioConfig_UserPreferences;
|
||||
|
||||
/* The entire set of user settable/readable settings for our radio device.
|
||||
@@ -393,10 +359,6 @@ typedef struct _RadioConfig {
|
||||
#define _RadioConfig_UserPreferences_Serial_Mode_MAX RadioConfig_UserPreferences_Serial_Mode_MODE_PROTO
|
||||
#define _RadioConfig_UserPreferences_Serial_Mode_ARRAYSIZE ((RadioConfig_UserPreferences_Serial_Mode)(RadioConfig_UserPreferences_Serial_Mode_MODE_PROTO+1))
|
||||
|
||||
#define _RadioConfig_UserPreferences_TelemetrySensorType_MIN RadioConfig_UserPreferences_TelemetrySensorType_None
|
||||
#define _RadioConfig_UserPreferences_TelemetrySensorType_MAX RadioConfig_UserPreferences_TelemetrySensorType_SHTC3
|
||||
#define _RadioConfig_UserPreferences_TelemetrySensorType_ARRAYSIZE ((RadioConfig_UserPreferences_TelemetrySensorType)(RadioConfig_UserPreferences_TelemetrySensorType_SHTC3+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -404,9 +366,9 @@ extern "C" {
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default}
|
||||
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _Role_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_Serial_Mode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_TelemetrySensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, 0, "", 0, 0, 0, _RadioConfig_UserPreferences_Serial_Baud_MIN, 0}
|
||||
#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _Role_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_Serial_Mode_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, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, 0, "", 0, 0, 0, _RadioConfig_UserPreferences_Serial_Baud_MIN}
|
||||
#define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero}
|
||||
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _Role_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_Serial_Mode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_TelemetrySensorType_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, 0, 0, 0, 0, 0, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, 0, "", 0, 0, 0, _RadioConfig_UserPreferences_Serial_Baud_MIN, 0}
|
||||
#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, 0, _Role_MIN, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, _GpsCoordinateFormat_MIN, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_Serial_Mode_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, _InputEventChar_MIN, _InputEventChar_MIN, _InputEventChar_MIN, 0, 0, "", 0, 0, 0, _RadioConfig_UserPreferences_Serial_Baud_MIN}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define RadioConfig_UserPreferences_position_broadcast_secs_tag 1
|
||||
@@ -458,14 +420,6 @@ extern "C" {
|
||||
#define RadioConfig_UserPreferences_store_forward_module_records_tag 137
|
||||
#define RadioConfig_UserPreferences_store_forward_module_history_return_max_tag 138
|
||||
#define RadioConfig_UserPreferences_store_forward_module_history_return_window_tag 139
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_measurement_enabled_tag 140
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_screen_enabled_tag 141
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_read_error_count_threshold_tag 142
|
||||
#define RadioConfig_UserPreferences_telemetry_module_device_update_interval_tag 143
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_recovery_interval_tag 144
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_display_fahrenheit_tag 145
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_sensor_type_tag 146
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_sensor_pin_tag 147
|
||||
#define RadioConfig_UserPreferences_store_forward_module_enabled_tag 148
|
||||
#define RadioConfig_UserPreferences_store_forward_module_heartbeat_tag 149
|
||||
#define RadioConfig_UserPreferences_position_flags_tag 150
|
||||
@@ -491,7 +445,6 @@ extern "C" {
|
||||
#define RadioConfig_UserPreferences_mqtt_encryption_enabled_tag 174
|
||||
#define RadioConfig_UserPreferences_adc_multiplier_override_tag 175
|
||||
#define RadioConfig_UserPreferences_serial_module_baud_tag 176
|
||||
#define RadioConfig_UserPreferences_telemetry_module_environment_update_interval_tag 177
|
||||
#define RadioConfig_preferences_tag 1
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
@@ -551,14 +504,6 @@ X(a, STATIC, SINGULAR, BOOL, range_test_module_save, 134) \
|
||||
X(a, STATIC, SINGULAR, UINT32, store_forward_module_records, 137) \
|
||||
X(a, STATIC, SINGULAR, UINT32, store_forward_module_history_return_max, 138) \
|
||||
X(a, STATIC, SINGULAR, UINT32, store_forward_module_history_return_window, 139) \
|
||||
X(a, STATIC, SINGULAR, BOOL, telemetry_module_environment_measurement_enabled, 140) \
|
||||
X(a, STATIC, SINGULAR, BOOL, telemetry_module_environment_screen_enabled, 141) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_environment_read_error_count_threshold, 142) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_device_update_interval, 143) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_environment_recovery_interval, 144) \
|
||||
X(a, STATIC, SINGULAR, BOOL, telemetry_module_environment_display_fahrenheit, 145) \
|
||||
X(a, STATIC, SINGULAR, UENUM, telemetry_module_environment_sensor_type, 146) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_environment_sensor_pin, 147) \
|
||||
X(a, STATIC, SINGULAR, BOOL, store_forward_module_enabled, 148) \
|
||||
X(a, STATIC, SINGULAR, BOOL, store_forward_module_heartbeat, 149) \
|
||||
X(a, STATIC, SINGULAR, UINT32, position_flags, 150) \
|
||||
@@ -583,8 +528,7 @@ X(a, STATIC, SINGULAR, STRING, canned_message_module_allow_input_source, 171
|
||||
X(a, STATIC, SINGULAR, BOOL, canned_message_module_send_bell, 173) \
|
||||
X(a, STATIC, SINGULAR, BOOL, mqtt_encryption_enabled, 174) \
|
||||
X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 175) \
|
||||
X(a, STATIC, SINGULAR, UENUM, serial_module_baud, 176) \
|
||||
X(a, STATIC, SINGULAR, UINT32, telemetry_module_environment_update_interval, 177)
|
||||
X(a, STATIC, SINGULAR, UENUM, serial_module_baud, 176)
|
||||
#define RadioConfig_UserPreferences_CALLBACK NULL
|
||||
#define RadioConfig_UserPreferences_DEFAULT NULL
|
||||
|
||||
@@ -596,8 +540,8 @@ extern const pb_msgdesc_t RadioConfig_UserPreferences_msg;
|
||||
#define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define RadioConfig_UserPreferences_size 592
|
||||
#define RadioConfig_size 595
|
||||
#define RadioConfig_UserPreferences_size 545
|
||||
#define RadioConfig_size 548
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
||||
@@ -16,3 +16,4 @@ PB_BIND(Telemetry, Telemetry, AUTO)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,31 @@
|
||||
#error Regenerate this file with the current version of nanopb generator.
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
/* TODO: REPLACE */
|
||||
typedef enum _TelemetrySensorType {
|
||||
/* No external telemetry sensor */
|
||||
TelemetrySensorType_NotSet = 0,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_DHT11 = 1,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_DS18B20 = 2,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_DHT12 = 3,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_DHT21 = 4,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_DHT22 = 5,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_BME280 = 6,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_BME680 = 7,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_MCP9808 = 8,
|
||||
/* TODO: REPLACE */
|
||||
TelemetrySensorType_SHTC3 = 9
|
||||
} TelemetrySensorType;
|
||||
|
||||
/* Struct definitions */
|
||||
/* Key native device metrics such as battery level */
|
||||
typedef struct _DeviceMetrics {
|
||||
@@ -55,6 +80,12 @@ typedef struct _Telemetry {
|
||||
} Telemetry;
|
||||
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _TelemetrySensorType_MIN TelemetrySensorType_NotSet
|
||||
#define _TelemetrySensorType_MAX TelemetrySensorType_SHTC3
|
||||
#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_SHTC3+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user