mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-19 03:22:07 +00:00
Merge branch 'master' into tft-gui-work
This commit is contained in:
commit
2b350ba6aa
@ -1 +1 @@
|
||||
Subproject commit bfbf4a65e220581f45c5ed949c659953ac4d080f
|
||||
Subproject commit a641c5ce4fca158d18ca3cffc92ac7a10f9b6a04
|
@ -66,6 +66,15 @@ PB_BIND(meshtastic_Heartbeat, meshtastic_Heartbeat, AUTO)
|
||||
PB_BIND(meshtastic_NodeRemoteHardwarePin, meshtastic_NodeRemoteHardwarePin, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_ChunkedPayload, meshtastic_ChunkedPayload, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_resend_chunks, meshtastic_resend_chunks, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_ChunkedPayloadResponse, meshtastic_ChunkedPayloadResponse, AUTO)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -65,6 +65,8 @@ typedef enum _meshtastic_HardwareModel {
|
||||
meshtastic_HardwareModel_LORA_TYPE = 19,
|
||||
/* wiphone https://www.wiphone.io/ */
|
||||
meshtastic_HardwareModel_WIPHONE = 20,
|
||||
/* WIO Tracker WM1110 family from Seeed Studio. Includes wio-1110-tracker and wio-1110-sdk */
|
||||
meshtastic_HardwareModel_WIO_WM1110 = 21,
|
||||
/* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */
|
||||
meshtastic_HardwareModel_STATION_G1 = 25,
|
||||
/* RAK11310 (RP2040 + SX1262) */
|
||||
@ -853,6 +855,38 @@ typedef struct _meshtastic_NodeRemoteHardwarePin {
|
||||
meshtastic_RemoteHardwarePin pin;
|
||||
} meshtastic_NodeRemoteHardwarePin;
|
||||
|
||||
typedef PB_BYTES_ARRAY_T(228) meshtastic_ChunkedPayload_payload_chunk_t;
|
||||
typedef struct _meshtastic_ChunkedPayload {
|
||||
/* The ID of the entire payload */
|
||||
uint32_t payload_id;
|
||||
/* The total number of chunks in the payload */
|
||||
uint16_t chunk_count;
|
||||
/* The current chunk index in the total */
|
||||
uint16_t chunk_index;
|
||||
/* The binary data of the current chunk */
|
||||
meshtastic_ChunkedPayload_payload_chunk_t payload_chunk;
|
||||
} meshtastic_ChunkedPayload;
|
||||
|
||||
/* Wrapper message for broken repeated oneof support */
|
||||
typedef struct _meshtastic_resend_chunks {
|
||||
pb_callback_t chunks;
|
||||
} meshtastic_resend_chunks;
|
||||
|
||||
/* Responses to a ChunkedPayload request */
|
||||
typedef struct _meshtastic_ChunkedPayloadResponse {
|
||||
/* The ID of the entire payload */
|
||||
uint32_t payload_id;
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
/* Request to transfer chunked payload */
|
||||
bool request_transfer;
|
||||
/* Accept the transfer chunked payload */
|
||||
bool accept_transfer;
|
||||
/* Request missing indexes in the chunked payload */
|
||||
meshtastic_resend_chunks resend_chunks;
|
||||
} payload_variant;
|
||||
} meshtastic_ChunkedPayloadResponse;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -928,6 +962,9 @@ extern "C" {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define meshtastic_Position_init_default {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define meshtastic_User_init_default {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN}
|
||||
@ -949,6 +986,9 @@ extern "C" {
|
||||
#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0}
|
||||
#define meshtastic_Heartbeat_init_default {0}
|
||||
#define meshtastic_NodeRemoteHardwarePin_init_default {0, false, meshtastic_RemoteHardwarePin_init_default}
|
||||
#define meshtastic_ChunkedPayload_init_default {0, 0, 0, {0, {0}}}
|
||||
#define meshtastic_resend_chunks_init_default {{{NULL}, NULL}}
|
||||
#define meshtastic_ChunkedPayloadResponse_init_default {0, 0, {0}}
|
||||
#define meshtastic_Position_init_zero {0, 0, 0, 0, _meshtastic_Position_LocSource_MIN, _meshtastic_Position_AltSource_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define meshtastic_User_init_zero {"", "", "", {0}, _meshtastic_HardwareModel_MIN, 0, _meshtastic_Config_DeviceConfig_Role_MIN}
|
||||
#define meshtastic_RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||
@ -969,6 +1009,9 @@ extern "C" {
|
||||
#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0}
|
||||
#define meshtastic_Heartbeat_init_zero {0}
|
||||
#define meshtastic_NodeRemoteHardwarePin_init_zero {0, false, meshtastic_RemoteHardwarePin_init_zero}
|
||||
#define meshtastic_ChunkedPayload_init_zero {0, 0, 0, {0, {0}}}
|
||||
#define meshtastic_resend_chunks_init_zero {{{NULL}, NULL}}
|
||||
#define meshtastic_ChunkedPayloadResponse_init_zero {0, 0, {0}}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define meshtastic_Position_latitude_i_tag 1
|
||||
@ -1103,6 +1146,15 @@ extern "C" {
|
||||
#define meshtastic_ToRadio_heartbeat_tag 7
|
||||
#define meshtastic_NodeRemoteHardwarePin_node_num_tag 1
|
||||
#define meshtastic_NodeRemoteHardwarePin_pin_tag 2
|
||||
#define meshtastic_ChunkedPayload_payload_id_tag 1
|
||||
#define meshtastic_ChunkedPayload_chunk_count_tag 2
|
||||
#define meshtastic_ChunkedPayload_chunk_index_tag 3
|
||||
#define meshtastic_ChunkedPayload_payload_chunk_tag 4
|
||||
#define meshtastic_resend_chunks_chunks_tag 1
|
||||
#define meshtastic_ChunkedPayloadResponse_payload_id_tag 1
|
||||
#define meshtastic_ChunkedPayloadResponse_request_transfer_tag 2
|
||||
#define meshtastic_ChunkedPayloadResponse_accept_transfer_tag 3
|
||||
#define meshtastic_ChunkedPayloadResponse_resend_chunks_tag 4
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define meshtastic_Position_FIELDLIST(X, a) \
|
||||
@ -1341,6 +1393,28 @@ X(a, STATIC, OPTIONAL, MESSAGE, pin, 2)
|
||||
#define meshtastic_NodeRemoteHardwarePin_DEFAULT NULL
|
||||
#define meshtastic_NodeRemoteHardwarePin_pin_MSGTYPE meshtastic_RemoteHardwarePin
|
||||
|
||||
#define meshtastic_ChunkedPayload_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, payload_id, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, chunk_count, 2) \
|
||||
X(a, STATIC, SINGULAR, UINT32, chunk_index, 3) \
|
||||
X(a, STATIC, SINGULAR, BYTES, payload_chunk, 4)
|
||||
#define meshtastic_ChunkedPayload_CALLBACK NULL
|
||||
#define meshtastic_ChunkedPayload_DEFAULT NULL
|
||||
|
||||
#define meshtastic_resend_chunks_FIELDLIST(X, a) \
|
||||
X(a, CALLBACK, REPEATED, UINT32, chunks, 1)
|
||||
#define meshtastic_resend_chunks_CALLBACK pb_default_field_callback
|
||||
#define meshtastic_resend_chunks_DEFAULT NULL
|
||||
|
||||
#define meshtastic_ChunkedPayloadResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, payload_id, 1) \
|
||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,request_transfer,payload_variant.request_transfer), 2) \
|
||||
X(a, STATIC, ONEOF, BOOL, (payload_variant,accept_transfer,payload_variant.accept_transfer), 3) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,resend_chunks,payload_variant.resend_chunks), 4)
|
||||
#define meshtastic_ChunkedPayloadResponse_CALLBACK NULL
|
||||
#define meshtastic_ChunkedPayloadResponse_DEFAULT NULL
|
||||
#define meshtastic_ChunkedPayloadResponse_payload_variant_resend_chunks_MSGTYPE meshtastic_resend_chunks
|
||||
|
||||
extern const pb_msgdesc_t meshtastic_Position_msg;
|
||||
extern const pb_msgdesc_t meshtastic_User_msg;
|
||||
extern const pb_msgdesc_t meshtastic_RouteDiscovery_msg;
|
||||
@ -1361,6 +1435,9 @@ extern const pb_msgdesc_t meshtastic_Neighbor_msg;
|
||||
extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg;
|
||||
extern const pb_msgdesc_t meshtastic_Heartbeat_msg;
|
||||
extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePin_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ChunkedPayload_msg;
|
||||
extern const pb_msgdesc_t meshtastic_resend_chunks_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define meshtastic_Position_fields &meshtastic_Position_msg
|
||||
@ -1383,9 +1460,15 @@ extern const pb_msgdesc_t meshtastic_NodeRemoteHardwarePin_msg;
|
||||
#define meshtastic_DeviceMetadata_fields &meshtastic_DeviceMetadata_msg
|
||||
#define meshtastic_Heartbeat_fields &meshtastic_Heartbeat_msg
|
||||
#define meshtastic_NodeRemoteHardwarePin_fields &meshtastic_NodeRemoteHardwarePin_msg
|
||||
#define meshtastic_ChunkedPayload_fields &meshtastic_ChunkedPayload_msg
|
||||
#define meshtastic_resend_chunks_fields &meshtastic_resend_chunks_msg
|
||||
#define meshtastic_ChunkedPayloadResponse_fields &meshtastic_ChunkedPayloadResponse_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
/* meshtastic_resend_chunks_size depends on runtime parameters */
|
||||
/* meshtastic_ChunkedPayloadResponse_size depends on runtime parameters */
|
||||
#define MESHTASTIC_MESHTASTIC_MESH_PB_H_MAX_SIZE meshtastic_FromRadio_size
|
||||
#define meshtastic_ChunkedPayload_size 245
|
||||
#define meshtastic_Compressed_size 243
|
||||
#define meshtastic_Data_size 270
|
||||
#define meshtastic_DeviceMetadata_size 46
|
||||
|
@ -92,7 +92,7 @@ bool AirQualityTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
return false;
|
||||
}
|
||||
|
||||
meshtastic_Telemetry m;
|
||||
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||
m.time = getTime();
|
||||
m.which_variant = meshtastic_Telemetry_air_quality_metrics_tag;
|
||||
m.variant.air_quality_metrics.pm10_standard = data.pm10_standard;
|
||||
|
@ -64,7 +64,7 @@ meshtastic_MeshPacket *DeviceTelemetryModule::allocReply()
|
||||
|
||||
meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry()
|
||||
{
|
||||
meshtastic_Telemetry t;
|
||||
meshtastic_Telemetry t = meshtastic_Telemetry_init_zero;
|
||||
|
||||
t.time = getTime();
|
||||
t.which_variant = meshtastic_Telemetry_device_metrics_tag;
|
||||
|
@ -261,7 +261,7 @@ bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPac
|
||||
|
||||
bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
{
|
||||
meshtastic_Telemetry m;
|
||||
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||
bool valid = true;
|
||||
bool hasSensor = false;
|
||||
m.time = getTime();
|
||||
@ -337,7 +337,7 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
hasSensor = true;
|
||||
} else {
|
||||
// prefer bmp280 temp if both sensors are present, fetch only humidity
|
||||
meshtastic_Telemetry m_ahtx;
|
||||
meshtastic_Telemetry m_ahtx = meshtastic_Telemetry_init_zero;
|
||||
LOG_INFO("AHTX0+BMP280 module detected: using temp from BMP280 and humy from AHTX0\n");
|
||||
aht10Sensor.getMetrics(&m_ahtx);
|
||||
m.variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity;
|
||||
|
@ -165,7 +165,7 @@ bool PowerTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &m
|
||||
|
||||
bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
{
|
||||
meshtastic_Telemetry m;
|
||||
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||
bool valid = false;
|
||||
m.time = getTime();
|
||||
m.which_variant = meshtastic_Telemetry_power_metrics_tag;
|
||||
|
@ -1,7 +1,11 @@
|
||||
#include "AHT10.h"
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "AHT10.h"
|
||||
#include "TelemetrySensor.h"
|
||||
|
||||
#include <Adafruit_AHTX0.h>
|
||||
#include <typeinfo>
|
||||
|
||||
@ -33,3 +37,5 @@ bool AHT10Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,3 +1,7 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Adafruit_AHTX0.h>
|
||||
@ -15,3 +19,5 @@ class AHT10Sensor : public TelemetrySensor
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,7 +1,10 @@
|
||||
#include "TSL2591Sensor.h"
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TSL2591Sensor.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Adafruit_TSL2591.h>
|
||||
#include <typeinfo>
|
||||
|
||||
@ -36,3 +39,5 @@ bool TSL2591Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,3 +1,7 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Adafruit_TSL2591.h>
|
||||
@ -15,3 +19,4 @@ class TSL2591Sensor : public TelemetrySensor
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
};
|
||||
#endif
|
@ -1,7 +1,11 @@
|
||||
#include "VEML7700Sensor.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
#include "VEML7700Sensor.h"
|
||||
|
||||
#include <Adafruit_VEML7700.h>
|
||||
#include <typeinfo>
|
||||
|
||||
@ -58,3 +62,4 @@ bool VEML7700Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
@ -1,3 +1,7 @@
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include <Adafruit_VEML7700.h>
|
||||
@ -20,3 +24,4 @@ class VEML7700Sensor : public TelemetrySensor
|
||||
virtual int32_t runOnce() override;
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
};
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user