mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-20 16:56:17 +00:00
Merged Brnaches
This commit is contained in:
parent
69e6e9cac3
commit
37a91d6a07
1
firmware
1
firmware
@ -1 +0,0 @@
|
||||
Subproject commit 7185551d1ae72ec21b4ff217b9e1c3cbc79a7761
|
@ -336,6 +336,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MESHTASTIC_EXCLUDE_SERIAL 1
|
||||
#define MESHTASTIC_EXCLUDE_POWERSTRESS 1
|
||||
#define MESHTASTIC_EXCLUDE_ADMIN 1
|
||||
#define MESHTASTIC_EXCLUDE_FISHEYESTATEROUTING 1
|
||||
#endif
|
||||
|
||||
// // Turn off wifi even if HW supports wifi (webserver relies on wifi and is also disabled)
|
||||
|
@ -86,7 +86,7 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
|
||||
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo"); // because this potentially a Repeater which will
|
||||
// ignore our request for its NodeInfo
|
||||
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !nodeDB->getMeshNode(mp->from)->has_user &&
|
||||
nodeInfoModule && !isPreferredRebroadcaster && !nodeDB->isFull() && !(config.network.routingAlgorithm == meshtastic_Config_RoutingConfig_FisheyeState)) {
|
||||
nodeInfoModule && !isPreferredRebroadcaster && !nodeDB->isFull() && !(config.network.routingAlgorithm == meshtastic_Config_RoutingConfig_FishEyeState)) {
|
||||
if (airTime->isTxAllowedChannelUtil(true)) {
|
||||
// Hops used by the request. If somebody in between running modified firmware modified it, ignore it
|
||||
auto hopStart = mp->hop_start;
|
||||
|
@ -730,6 +730,9 @@ void NodeDB::installDefaultModuleConfig()
|
||||
moduleConfig.has_neighbor_info = true;
|
||||
moduleConfig.neighbor_info.enabled = false;
|
||||
|
||||
moduleConfig.has_fish_eye_state_routing = true;
|
||||
moduleConfig.fish_eye_state_routing.enabled = false;
|
||||
|
||||
moduleConfig.has_detection_sensor = true;
|
||||
moduleConfig.detection_sensor.enabled = false;
|
||||
moduleConfig.detection_sensor.detection_trigger_type = meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_LOGIC_HIGH;
|
||||
@ -1255,6 +1258,7 @@ bool NodeDB::saveToDiskNoRetry(int saveWhat)
|
||||
moduleConfig.has_ambient_lighting = true;
|
||||
moduleConfig.has_audio = true;
|
||||
moduleConfig.has_paxcounter = true;
|
||||
moduleConfig.has_fish_eye_state_routing = true;
|
||||
|
||||
success &=
|
||||
saveProto(moduleConfigFileName, meshtastic_LocalModuleConfig_size, &meshtastic_LocalModuleConfig_msg, &moduleConfig);
|
||||
|
@ -366,6 +366,11 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
|
||||
fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_neighbor_info_tag;
|
||||
fromRadioScratch.moduleConfig.payload_variant.neighbor_info = moduleConfig.neighbor_info;
|
||||
break;
|
||||
case meshtastic_ModuleConfig_fish_eye_state_routing_tag:
|
||||
LOG_DEBUG("Send module config: FishEyeStateRouting");
|
||||
fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_fish_eye_state_routing_tag;
|
||||
fromRadioScratch.moduleConfig.payload_variant.fish_eye_state_routing = moduleConfig.fish_eye_state_routing;
|
||||
break;
|
||||
case meshtastic_ModuleConfig_detection_sensor_tag:
|
||||
LOG_DEBUG("Send module config: detection sensor");
|
||||
fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_detection_sensor_tag;
|
||||
|
@ -67,7 +67,9 @@ typedef enum _meshtastic_AdminMessage_ModuleConfigType {
|
||||
/* TODO: REPLACE */
|
||||
meshtastic_AdminMessage_ModuleConfigType_DETECTIONSENSOR_CONFIG = 11,
|
||||
/* TODO: REPLACE */
|
||||
meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG = 12
|
||||
meshtastic_AdminMessage_ModuleConfigType_PAXCOUNTER_CONFIG = 12,
|
||||
/* TODO: REPLACE */
|
||||
meshtastic_AdminMessage_ModuleConfigType_FISHEYESTATEROUTING_CONFIG = 13
|
||||
} meshtastic_AdminMessage_ModuleConfigType;
|
||||
|
||||
typedef enum _meshtastic_AdminMessage_BackupLocation {
|
||||
|
@ -304,7 +304,7 @@ typedef enum _meshtastic_Config_BluetoothConfig_PairingMode {
|
||||
|
||||
typedef enum _meshtastic_Config_RoutingConfig_RoutingAlgo {
|
||||
meshtastic_Config_RoutingConfig_Flooding = 0,
|
||||
meshtastic_Config_RoutingConfig_FisheyeState = 1,
|
||||
meshtastic_Config_RoutingConfig_FishEyeState = 1,
|
||||
meshtastic_Config_RoutingConfig_Ad_hoc_On_Demand_Distance_Vector = 2
|
||||
} meshtastic_Config_RoutingConfig_RoutingAlgo;
|
||||
|
||||
|
@ -87,6 +87,9 @@ typedef struct _meshtastic_LocalModuleConfig {
|
||||
/* Paxcounter Config */
|
||||
bool has_paxcounter;
|
||||
meshtastic_ModuleConfig_PaxcounterConfig paxcounter;
|
||||
/* The part of the config that is specific to the FisheyeState-Routing module */
|
||||
bool has_fish_eye_state_routing;
|
||||
meshtastic_ModuleConfig_FishEyeStateRoutingConfig fish_eye_state_routing;
|
||||
} meshtastic_LocalModuleConfig;
|
||||
|
||||
|
||||
@ -96,9 +99,9 @@ extern "C" {
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define meshtastic_LocalConfig_init_default {false, meshtastic_Config_DeviceConfig_init_default, false, meshtastic_Config_PositionConfig_init_default, false, meshtastic_Config_PowerConfig_init_default, false, meshtastic_Config_NetworkConfig_init_default, false, meshtastic_Config_DisplayConfig_init_default, false, meshtastic_Config_LoRaConfig_init_default, false, meshtastic_Config_BluetoothConfig_init_default, 0, false, meshtastic_Config_SecurityConfig_init_default}
|
||||
#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_default, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_default, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_default, false, meshtastic_ModuleConfig_PaxcounterConfig_init_default}
|
||||
#define meshtastic_LocalModuleConfig_init_default {false, meshtastic_ModuleConfig_MQTTConfig_init_default, false, meshtastic_ModuleConfig_SerialConfig_init_default, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_default, false, meshtastic_ModuleConfig_StoreForwardConfig_init_default, false, meshtastic_ModuleConfig_RangeTestConfig_init_default, false, meshtastic_ModuleConfig_TelemetryConfig_init_default, false, meshtastic_ModuleConfig_CannedMessageConfig_init_default, 0, false, meshtastic_ModuleConfig_AudioConfig_init_default, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_default, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_default, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_default, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_default, false, meshtastic_ModuleConfig_PaxcounterConfig_init_default, false, meshtastic_ModuleConfig_FishEyeStateRoutingConfig_init_default}
|
||||
#define meshtastic_LocalConfig_init_zero {false, meshtastic_Config_DeviceConfig_init_zero, false, meshtastic_Config_PositionConfig_init_zero, false, meshtastic_Config_PowerConfig_init_zero, false, meshtastic_Config_NetworkConfig_init_zero, false, meshtastic_Config_DisplayConfig_init_zero, false, meshtastic_Config_LoRaConfig_init_zero, false, meshtastic_Config_BluetoothConfig_init_zero, 0, false, meshtastic_Config_SecurityConfig_init_zero}
|
||||
#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_zero, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_zero, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_zero, false, meshtastic_ModuleConfig_PaxcounterConfig_init_zero}
|
||||
#define meshtastic_LocalModuleConfig_init_zero {false, meshtastic_ModuleConfig_MQTTConfig_init_zero, false, meshtastic_ModuleConfig_SerialConfig_init_zero, false, meshtastic_ModuleConfig_ExternalNotificationConfig_init_zero, false, meshtastic_ModuleConfig_StoreForwardConfig_init_zero, false, meshtastic_ModuleConfig_RangeTestConfig_init_zero, false, meshtastic_ModuleConfig_TelemetryConfig_init_zero, false, meshtastic_ModuleConfig_CannedMessageConfig_init_zero, 0, false, meshtastic_ModuleConfig_AudioConfig_init_zero, false, meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero, false, meshtastic_ModuleConfig_NeighborInfoConfig_init_zero, false, meshtastic_ModuleConfig_AmbientLightingConfig_init_zero, false, meshtastic_ModuleConfig_DetectionSensorConfig_init_zero, false, meshtastic_ModuleConfig_PaxcounterConfig_init_zero, false, meshtastic_ModuleConfig_FishEyeStateRoutingConfig_init_zero}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define meshtastic_LocalConfig_device_tag 1
|
||||
@ -124,6 +127,7 @@ extern "C" {
|
||||
#define meshtastic_LocalModuleConfig_ambient_lighting_tag 12
|
||||
#define meshtastic_LocalModuleConfig_detection_sensor_tag 13
|
||||
#define meshtastic_LocalModuleConfig_paxcounter_tag 14
|
||||
#define meshtastic_LocalModuleConfig_fish_eye_state_routing_tag 15
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define meshtastic_LocalConfig_FIELDLIST(X, a) \
|
||||
@ -161,7 +165,8 @@ X(a, STATIC, OPTIONAL, MESSAGE, remote_hardware, 10) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, neighbor_info, 11) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, ambient_lighting, 12) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, detection_sensor, 13) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14)
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14) \
|
||||
X(a, STATIC, OPTIONAL, MESSAGE, fish_eye_state_routing, 15)
|
||||
#define meshtastic_LocalModuleConfig_CALLBACK NULL
|
||||
#define meshtastic_LocalModuleConfig_DEFAULT NULL
|
||||
#define meshtastic_LocalModuleConfig_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig
|
||||
@ -177,6 +182,7 @@ X(a, STATIC, OPTIONAL, MESSAGE, paxcounter, 14)
|
||||
#define meshtastic_LocalModuleConfig_ambient_lighting_MSGTYPE meshtastic_ModuleConfig_AmbientLightingConfig
|
||||
#define meshtastic_LocalModuleConfig_detection_sensor_MSGTYPE meshtastic_ModuleConfig_DetectionSensorConfig
|
||||
#define meshtastic_LocalModuleConfig_paxcounter_MSGTYPE meshtastic_ModuleConfig_PaxcounterConfig
|
||||
#define meshtastic_LocalModuleConfig_fish_eye_state_routing_MSGTYPE meshtastic_ModuleConfig_FishEyeStateRoutingConfig
|
||||
|
||||
extern const pb_msgdesc_t meshtastic_LocalConfig_msg;
|
||||
extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg;
|
||||
|
@ -63,6 +63,9 @@ PB_BIND(meshtastic_NeighborInfo, meshtastic_NeighborInfo, AUTO)
|
||||
PB_BIND(meshtastic_Neighbor, meshtastic_Neighbor, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_FishEyeStateRouting, meshtastic_FishEyeStateRouting, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_DeviceMetadata, meshtastic_DeviceMetadata, AUTO)
|
||||
|
||||
|
||||
|
@ -325,7 +325,9 @@ typedef enum _meshtastic_ExcludedModules {
|
||||
/* Detection Sensor module */
|
||||
meshtastic_ExcludedModules_DETECTIONSENSOR_CONFIG = 2048,
|
||||
/* Paxcounter module */
|
||||
meshtastic_ExcludedModules_PAXCOUNTER_CONFIG = 4096
|
||||
meshtastic_ExcludedModules_PAXCOUNTER_CONFIG = 4096,
|
||||
/* Fisheye StateRouting Module */
|
||||
meshtastic_ExcludedModules_FISHEYESTATEROUTING_CONFIG = 8192
|
||||
} meshtastic_ExcludedModules;
|
||||
|
||||
/* How the location was acquired: manual, onboard GPS, external (EUD) GPS */
|
||||
@ -947,8 +949,8 @@ typedef struct _meshtastic_NeighborInfo {
|
||||
uint32_t creation;
|
||||
} meshtastic_NeighborInfo;
|
||||
|
||||
/* Struct for an LSP-Package */
|
||||
typedef struct _meshtastic_LSPPkg {
|
||||
/* Struct for an FishEyeState/ Link-State-Package */
|
||||
typedef struct _meshtastic_FishEyeStateRouting {
|
||||
/* The node ID of the node of origin */
|
||||
uint32_t node_id;
|
||||
/* Number of Hops, this LSP-Package alredy traveled */
|
||||
@ -958,7 +960,7 @@ typedef struct _meshtastic_LSPPkg {
|
||||
meshtastic_Neighbor neighbors[10];
|
||||
/* UNIX-Timestamp of Creation*/
|
||||
uint32_t creation;
|
||||
} meshtastic_LSPPkg;
|
||||
} meshtastic_FishEyeStateRouting;
|
||||
|
||||
/* Device metadata response */
|
||||
typedef struct _meshtastic_DeviceMetadata {
|
||||
@ -1221,7 +1223,7 @@ extern "C" {
|
||||
#define meshtastic_ToRadio_init_default {0, {meshtastic_MeshPacket_init_default}}
|
||||
#define meshtastic_Compressed_init_default {_meshtastic_PortNum_MIN, {0, {0}}}
|
||||
#define meshtastic_NeighborInfo_init_default {0, 0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default},0}
|
||||
#define meshtastic_LSPPkg_init_default {0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default},0}
|
||||
#define meshtastic_FishEyeStateRouting_init_default {0, 0, 0, {meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default, meshtastic_Neighbor_init_default},0}
|
||||
#define meshtastic_Neighbor_init_default {0, 0, 0, 0}
|
||||
#define meshtastic_DeviceMetadata_init_default {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0, 0, 0}
|
||||
#define meshtastic_Heartbeat_init_default {0}
|
||||
@ -1247,7 +1249,7 @@ extern "C" {
|
||||
#define meshtastic_ToRadio_init_zero {0, {meshtastic_MeshPacket_init_zero}}
|
||||
#define meshtastic_Compressed_init_zero {_meshtastic_PortNum_MIN, {0, {0}}}
|
||||
#define meshtastic_NeighborInfo_init_zero {0, 0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero},0}
|
||||
#define meshtastic_LSPPkg_init_zero {0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero},0}
|
||||
#define meshtastic_FishEyeStateRouting_init_zero {0, 0, 0, {meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero, meshtastic_Neighbor_init_zero},0}
|
||||
#define meshtastic_Neighbor_init_zero {0, 0, 0, 0}
|
||||
#define meshtastic_DeviceMetadata_init_zero {"", 0, 0, 0, 0, 0, _meshtastic_Config_DeviceConfig_Role_MIN, 0, _meshtastic_HardwareModel_MIN, 0, 0, 0}
|
||||
#define meshtastic_Heartbeat_init_zero {0}
|
||||
@ -1376,6 +1378,11 @@ extern "C" {
|
||||
#define meshtastic_NeighborInfo_last_sent_by_id_tag 2
|
||||
#define meshtastic_NeighborInfo_node_broadcast_interval_secs_tag 3
|
||||
#define meshtastic_NeighborInfo_neighbors_tag 4
|
||||
#define meshtastic_NeighborInfo_creation_tag 5
|
||||
#define meshtastic_FishEyeStateRouting_node_tag 1
|
||||
#define meshtastic_FishEyeStateRouting_traveledHops_tag 2
|
||||
#define meshtastic_FishEyeStateRouting_neighbors_tag 3
|
||||
#define meshtastic_FishEyeStateRouting_creation_tag 4
|
||||
#define meshtastic_DeviceMetadata_firmware_version_tag 1
|
||||
#define meshtastic_DeviceMetadata_device_state_version_tag 2
|
||||
#define meshtastic_DeviceMetadata_canShutdown_tag 3
|
||||
@ -1660,14 +1667,14 @@ X(a, STATIC, SINGULAR, UINT32, creation, 5)
|
||||
#define meshtastic_NeighborInfo_DEFAULT NULL
|
||||
#define meshtastic_NeighborInfo_neighbors_MSGTYPE meshtastic_Neighbor
|
||||
|
||||
#define meshtastic_LSPPkg_FIELDLIST(X, a) \
|
||||
#define meshtastic_FishEyeStateRouting_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, node_id, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, traveledHops, 2) \
|
||||
X(a, STATIC, REPEATED, MESSAGE, neighbors, 3)\
|
||||
X(a, STATIC, SINGULAR, UINT32, creation, 4)
|
||||
#define meshtastic_LSPPkg_CALLBACK NULL
|
||||
#define meshtastic_LSPPkg_DEFAULT NULL
|
||||
#define meshtastic_LSPPkg_neighbors_MSGTYPE meshtastic_Neighbor
|
||||
#define meshtastic_FishEyeStateRouting_CALLBACK NULL
|
||||
#define meshtastic_FishEyeStateRouting_DEFAULT NULL
|
||||
#define meshtastic_FishEyeStateRouting_neighbors_MSGTYPE meshtastic_Neighbor
|
||||
|
||||
#define meshtastic_Neighbor_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UINT32, node_id, 1) \
|
||||
@ -1745,7 +1752,7 @@ extern const pb_msgdesc_t meshtastic_FileInfo_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ToRadio_msg;
|
||||
extern const pb_msgdesc_t meshtastic_Compressed_msg;
|
||||
extern const pb_msgdesc_t meshtastic_NeighborInfo_msg;
|
||||
extern const pb_msgdesc_t meshtastic_LSPPkg_msg;
|
||||
extern const pb_msgdesc_t meshtastic_FishEyeStateRouting_msg;
|
||||
extern const pb_msgdesc_t meshtastic_Neighbor_msg;
|
||||
extern const pb_msgdesc_t meshtastic_DeviceMetadata_msg;
|
||||
extern const pb_msgdesc_t meshtastic_Heartbeat_msg;
|
||||
@ -1773,7 +1780,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg;
|
||||
#define meshtastic_ToRadio_fields &meshtastic_ToRadio_msg
|
||||
#define meshtastic_Compressed_fields &meshtastic_Compressed_msg
|
||||
#define meshtastic_NeighborInfo_fields &meshtastic_NeighborInfo_msg
|
||||
#define meshtastic_LSPPkg_fields &meshtastic_LSPPkg_msg
|
||||
#define meshtastic_FishEyeStateRouting_fields &meshtastic_FishEyeStateRouting_msg
|
||||
#define meshtastic_Neighbor_fields &meshtastic_Neighbor_msg
|
||||
#define meshtastic_DeviceMetadata_fields &meshtastic_DeviceMetadata_msg
|
||||
#define meshtastic_Heartbeat_fields &meshtastic_Heartbeat_msg
|
||||
@ -1799,7 +1806,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg;
|
||||
#define meshtastic_MqttClientProxyMessage_size 501
|
||||
#define meshtastic_MyNodeInfo_size 77
|
||||
#define meshtastic_NeighborInfo_size 262
|
||||
#define meshtastic_LSPPkg_size 258
|
||||
#define meshtastic_FishEyeStateRouting_size 258
|
||||
#define meshtastic_Neighbor_size 22
|
||||
#define meshtastic_NodeInfo_size 319
|
||||
#define meshtastic_NodeRemoteHardwarePin_size 29
|
||||
|
@ -54,6 +54,9 @@ PB_BIND(meshtastic_ModuleConfig_AmbientLightingConfig, meshtastic_ModuleConfig_A
|
||||
PB_BIND(meshtastic_RemoteHardwarePin, meshtastic_RemoteHardwarePin, AUTO)
|
||||
|
||||
|
||||
PB_BIND(meshtastic_ModuleConfig_FishEyeStateRoutingConfig, meshtastic_ModuleConfig_FishEyeStateRoutingConfig, AUTO)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -160,6 +160,12 @@ typedef struct _meshtastic_ModuleConfig_NeighborInfoConfig {
|
||||
bool transmit_over_lora;
|
||||
} meshtastic_ModuleConfig_NeighborInfoConfig;
|
||||
|
||||
/* FishEyeStateRouting Config */
|
||||
typedef struct _meshtastic_ModuleConfig_FishEyeStateRoutingConfig {
|
||||
/* Whether the Module is enabled */
|
||||
bool enabled;
|
||||
} meshtastic_ModuleConfig_FishEyeStateRoutingConfig;
|
||||
|
||||
/* Detection Sensor Module Config */
|
||||
typedef struct _meshtastic_ModuleConfig_DetectionSensorConfig {
|
||||
/* Whether the Module is enabled */
|
||||
@ -441,6 +447,8 @@ typedef struct _meshtastic_ModuleConfig {
|
||||
meshtastic_ModuleConfig_DetectionSensorConfig detection_sensor;
|
||||
/* TODO: REPLACE */
|
||||
meshtastic_ModuleConfig_PaxcounterConfig paxcounter;
|
||||
/* TODO: REPLACE */
|
||||
meshtastic_ModuleConfig_FishEyeStateRoutingConfig fish_eye_state_routing;
|
||||
} payload_variant;
|
||||
} meshtastic_ModuleConfig;
|
||||
|
||||
@ -505,6 +513,7 @@ extern "C" {
|
||||
#define meshtastic_ModuleConfig_MapReportSettings_init_default {0, 0}
|
||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_default {0, 0, 0, {meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default, meshtastic_RemoteHardwarePin_init_default}}
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_default {0, 0, 0}
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_init_default {0}
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_default {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
||||
#define meshtastic_ModuleConfig_AudioConfig_init_default {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
||||
#define meshtastic_ModuleConfig_PaxcounterConfig_init_default {0, 0, 0, 0}
|
||||
@ -521,6 +530,7 @@ extern "C" {
|
||||
#define meshtastic_ModuleConfig_MapReportSettings_init_zero {0, 0}
|
||||
#define meshtastic_ModuleConfig_RemoteHardwareConfig_init_zero {0, 0, 0, {meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero, meshtastic_RemoteHardwarePin_init_zero}}
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_init_zero {0, 0, 0}
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_init_zero {0}
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_init_zero {0, 0, 0, 0, "", 0, _meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_MIN, 0}
|
||||
#define meshtastic_ModuleConfig_AudioConfig_init_zero {0, 0, _meshtastic_ModuleConfig_AudioConfig_Audio_Baud_MIN, 0, 0, 0, 0}
|
||||
#define meshtastic_ModuleConfig_PaxcounterConfig_init_zero {0, 0, 0, 0}
|
||||
@ -550,6 +560,7 @@ extern "C" {
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_enabled_tag 1
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_update_interval_tag 2
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_transmit_over_lora_tag 3
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_enabled_tag 1
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_enabled_tag 1
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_minimum_broadcast_secs_tag 2
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_state_broadcast_secs_tag 3
|
||||
@ -649,6 +660,7 @@ extern "C" {
|
||||
#define meshtastic_ModuleConfig_ambient_lighting_tag 11
|
||||
#define meshtastic_ModuleConfig_detection_sensor_tag 12
|
||||
#define meshtastic_ModuleConfig_paxcounter_tag 13
|
||||
#define meshtastic_ModuleConfig_fish_eye_state_routing_tag 14
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define meshtastic_ModuleConfig_FIELDLIST(X, a) \
|
||||
@ -664,7 +676,8 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,remote_hardware,payload_vari
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,neighbor_info,payload_variant.neighbor_info), 10) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,ambient_lighting,payload_variant.ambient_lighting), 11) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,detection_sensor,payload_variant.detection_sensor), 12) \
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,paxcounter,payload_variant.paxcounter), 13)
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,paxcounter,payload_variant.paxcounter), 13)\
|
||||
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,fish_eye_state_routing,payload_variant.fish_eye_state_routing), 14)
|
||||
#define meshtastic_ModuleConfig_CALLBACK NULL
|
||||
#define meshtastic_ModuleConfig_DEFAULT NULL
|
||||
#define meshtastic_ModuleConfig_payload_variant_mqtt_MSGTYPE meshtastic_ModuleConfig_MQTTConfig
|
||||
@ -680,6 +693,7 @@ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,paxcounter,payload_variant.p
|
||||
#define meshtastic_ModuleConfig_payload_variant_ambient_lighting_MSGTYPE meshtastic_ModuleConfig_AmbientLightingConfig
|
||||
#define meshtastic_ModuleConfig_payload_variant_detection_sensor_MSGTYPE meshtastic_ModuleConfig_DetectionSensorConfig
|
||||
#define meshtastic_ModuleConfig_payload_variant_paxcounter_MSGTYPE meshtastic_ModuleConfig_PaxcounterConfig
|
||||
#define meshtastic_ModuleConfig_payload_variant_fish_eye_state_routing_MSGTYPE meshtastic_ModuleConfig_FishEyeStateRoutingConfig
|
||||
|
||||
#define meshtastic_ModuleConfig_MQTTConfig_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 1) \
|
||||
@ -718,6 +732,11 @@ X(a, STATIC, SINGULAR, BOOL, transmit_over_lora, 3)
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_CALLBACK NULL
|
||||
#define meshtastic_ModuleConfig_NeighborInfoConfig_DEFAULT NULL
|
||||
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 1)
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_CALLBACK NULL
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_DEFAULT NULL
|
||||
|
||||
#define meshtastic_ModuleConfig_DetectionSensorConfig_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, BOOL, enabled, 1) \
|
||||
X(a, STATIC, SINGULAR, UINT32, minimum_broadcast_secs, 2) \
|
||||
@ -861,6 +880,7 @@ extern const pb_msgdesc_t meshtastic_ModuleConfig_TelemetryConfig_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_CannedMessageConfig_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_AmbientLightingConfig_msg;
|
||||
extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
||||
extern const pb_msgdesc_t meshtastic_ModuleConfig_FishEyeStateRoutingConfig_msg;
|
||||
|
||||
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
||||
#define meshtastic_ModuleConfig_fields &meshtastic_ModuleConfig_msg
|
||||
@ -879,6 +899,7 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
||||
#define meshtastic_ModuleConfig_CannedMessageConfig_fields &meshtastic_ModuleConfig_CannedMessageConfig_msg
|
||||
#define meshtastic_ModuleConfig_AmbientLightingConfig_fields &meshtastic_ModuleConfig_AmbientLightingConfig_msg
|
||||
#define meshtastic_RemoteHardwarePin_fields &meshtastic_RemoteHardwarePin_msg
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_fields &meshtastic_ModuleConfig_FishEyeStateRoutingConfig_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define MESHTASTIC_MESHTASTIC_MODULE_CONFIG_PB_H_MAX_SIZE meshtastic_ModuleConfig_size
|
||||
@ -898,6 +919,7 @@ extern const pb_msgdesc_t meshtastic_RemoteHardwarePin_msg;
|
||||
#define meshtastic_ModuleConfig_TelemetryConfig_size 46
|
||||
#define meshtastic_ModuleConfig_size 225
|
||||
#define meshtastic_RemoteHardwarePin_size 21
|
||||
#define meshtastic_ModuleConfig_FishEyeStateRoutingConfig_size 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
@ -84,6 +84,7 @@ typedef enum _meshtastic_PortNum {
|
||||
/* Paxcounter lib included in the firmware
|
||||
ENCODING: protobuf */
|
||||
meshtastic_PortNum_PAXCOUNTER_APP = 34,
|
||||
|
||||
/* Provides a hardware serial interface to send and receive from the Meshtastic network.
|
||||
Connect to the RX/TX pins of a device with 38400 8N1. Packets received from the Meshtastic
|
||||
network is forwarded to the RX pin while sending a packet to TX will go out to the Mesh network.
|
||||
@ -128,9 +129,16 @@ typedef enum _meshtastic_PortNum {
|
||||
meshtastic_PortNum_MAP_REPORT_APP = 73,
|
||||
/* PowerStress based monitoring support (for automated power consumption testing) */
|
||||
meshtastic_PortNum_POWERSTRESS_APP = 74,
|
||||
<<<<<<< HEAD
|
||||
/* Reticulum Network Stack Tunnel App
|
||||
ENCODING: Fragmented RNS Packet. Handled by Meshtastic RNS interface */
|
||||
meshtastic_PortNum_RETICULUM_TUNNEL_APP = 76,
|
||||
||||||| parent of b49c93ed (SetUp for FishEyeStateRoutingModule ready, Implementation still missing)
|
||||
=======
|
||||
/* FishEyeStateRouting-Module */
|
||||
meshtastic_PortNum_FISHEYESTATEROUTING_APP = 75,
|
||||
|
||||
>>>>>>> b49c93ed (SetUp for FishEyeStateRoutingModule ready, Implementation still missing)
|
||||
/* Private applications should use portnums >= 256.
|
||||
To simplify initial development and testing you can use "PRIVATE_APP"
|
||||
in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/firmware/blob/master/bin/regen-protos.sh)) */
|
||||
|
@ -764,6 +764,11 @@ bool AdminModule::handleSetModuleConfig(const meshtastic_ModuleConfig &c)
|
||||
}
|
||||
moduleConfig.neighbor_info = c.payload_variant.neighbor_info;
|
||||
break;
|
||||
case meshtastic_ModuleConfig_fish_eye_state_routing_tag:
|
||||
LOG_INFO("Set module config: FishEyeStateRouting");
|
||||
moduleConfig.has_fish_eye_state_routing = true;
|
||||
moduleConfig.fish_eye_state_routing = c.payload_variant.fish_eye_state_routing;
|
||||
break;
|
||||
case meshtastic_ModuleConfig_detection_sensor_tag:
|
||||
LOG_INFO("Set module config: Detection Sensor");
|
||||
moduleConfig.has_detection_sensor = true;
|
||||
@ -937,6 +942,11 @@ void AdminModule::handleGetModuleConfig(const meshtastic_MeshPacket &req, const
|
||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_neighbor_info_tag;
|
||||
res.get_module_config_response.payload_variant.neighbor_info = moduleConfig.neighbor_info;
|
||||
break;
|
||||
case meshtastic_AdminMessage_ModuleConfigType_FISHEYESTATEROUTING_CONFIG:
|
||||
LOG_INFO("Get module config: FishEyeStateRouting");
|
||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_fish_eye_state_routing_tag;
|
||||
res.get_module_config_response.payload_variant.fish_eye_state_routing = moduleConfig.fish_eye_state_routing;
|
||||
break;
|
||||
case meshtastic_AdminMessage_ModuleConfigType_DETECTIONSENSOR_CONFIG:
|
||||
LOG_INFO("Get module config: Detection Sensor");
|
||||
res.get_module_config_response.which_payload_variant = meshtastic_ModuleConfig_detection_sensor_tag;
|
||||
|
51
src/modules/FishEyeStateRoutingModule.cpp
Normal file
51
src/modules/FishEyeStateRoutingModule.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
#include "FishEyeStateRoutingModule.h"
|
||||
#include "Default.h"
|
||||
#include "MeshService.h"
|
||||
#include "NodeDB.h"
|
||||
#include "RTC.h"
|
||||
#include <Throttle.h>
|
||||
|
||||
FishEyeStateRoutingModule *fishEyeStateRoutingModule;
|
||||
|
||||
|
||||
/*
|
||||
* check if Extension is enabled
|
||||
*/
|
||||
FishEyeStateRoutingModule::FishEyeStateRoutingModule()
|
||||
: ProtobufModule("fishEyeStateRouting", meshtastic_PortNum_FISHEYESTATEROUTING_APP, &meshtastic_FishEyeStateRouting_msg),
|
||||
concurrency::OSThread("FishEyeStateRoutingModule")
|
||||
{
|
||||
if(moduleConfig.fish_eye_state_routing.enabled && config.network.routingAlgorithm == meshtastic_Config_RoutingConfig_FishEyeState){
|
||||
setIntervalFromNow(Default::getConfiguredOrDefaultMs(moduleConfig.neighbor_info.update_interval,
|
||||
default_telemetry_broadcast_interval_secs));
|
||||
}else{
|
||||
LOG_DEBUG("FishEyeStateRouting Module is disabled");
|
||||
disable();
|
||||
}
|
||||
}
|
||||
|
||||
bool FishEyeStateRoutingModule::addNeighborInfo(meshtastic_NeighborInfo Ninfo){
|
||||
|
||||
}
|
||||
|
||||
uint32_t FishEyeStateRoutingModule::getNextHopForID(uint32_t dest){
|
||||
|
||||
}
|
||||
|
||||
bool FishEyeStateRoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_FishEyeStateRouting *lsp)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int32_t FishEyeStateRoutingModule::runOnce(){
|
||||
|
||||
}
|
||||
|
||||
bool FishEyeStateRoutingModule::calcNextHop(){
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Collect a received neighbor info packet from another node
|
||||
Pass it to an upper client; do not persist this data on the mesh
|
||||
*/
|
58
src/modules/FishEyeStateRoutingModule.h
Normal file
58
src/modules/FishEyeStateRoutingModule.h
Normal file
@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
#include "ProtobufModule.h"
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
|
||||
/*
|
||||
* FishEyeStateRouting Module, for Routing in the Mesh
|
||||
*/
|
||||
class FishEyeStateRoutingModule : public ProtobufModule<meshtastic_FishEyeStateRouting>, private concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
/*
|
||||
* Expose the constructor
|
||||
*/
|
||||
FishEyeStateRoutingModule();
|
||||
|
||||
/*
|
||||
* Get Information of direct Neighbors from the NeighborInfoModule and process it
|
||||
*/
|
||||
bool addNeighborInfo(meshtastic_NeighborInfo Ninfo);
|
||||
|
||||
/*
|
||||
* Get Next-Hop for Package to dest
|
||||
*/
|
||||
uint32_t getNextHopForID(uint32_t dest);
|
||||
|
||||
|
||||
protected:
|
||||
/*
|
||||
* Called to handle an incomming LSP-Package, adds it to it's collection
|
||||
* and calculates an offset for it
|
||||
*/
|
||||
virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_FishEyeStateRouting *lsp) override;
|
||||
|
||||
/*
|
||||
* Check whether we have to forward an LSP-Package an does so if necessary
|
||||
*/
|
||||
int32_t runOnce() override;
|
||||
|
||||
private:
|
||||
|
||||
struct LSPDBEntry{
|
||||
uint32_t nextHop;
|
||||
meshtastic_FishEyeStateRouting LSP;
|
||||
};
|
||||
|
||||
/*
|
||||
* Database for the received LSP-Packages and their Next-Hop
|
||||
*/
|
||||
std::unordered_map<uint32_t,LSPDBEntry> LSPDB;
|
||||
|
||||
/*
|
||||
* Calculate nextHop and distance from this node all other nodes an updates Next-Hop tabel
|
||||
*/
|
||||
bool calcNextHop();
|
||||
|
||||
};
|
||||
extern FishEyeStateRoutingModule *fishEyeStateRoutingModule;
|
@ -28,6 +28,9 @@
|
||||
#if !MESHTASTIC_EXCLUDE_NODEINFO
|
||||
#include "modules/NodeInfoModule.h"
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_FISHEYESTATEROUTING
|
||||
#include "modules/FishEyeStateRoutingModule.h"
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
#include "modules/PositionModule.h"
|
||||
#endif
|
||||
@ -105,6 +108,9 @@ void setupModules()
|
||||
#if !MESHTASTIC_EXCLUDE_NODEINFO
|
||||
nodeInfoModule = new NodeInfoModule();
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_FISHEYESTATEROUTING
|
||||
fishEyeStateRoutingModule = new FishEyeStateRoutingModule();
|
||||
#endif
|
||||
#if !MESHTASTIC_EXCLUDE_GPS
|
||||
positionModule = new PositionModule();
|
||||
#endif
|
||||
|
@ -105,7 +105,7 @@ void NeighborInfoModule::sendNeighborInfo(NodeNum dest, bool wantReplies)
|
||||
{
|
||||
meshtastic_NeighborInfo neighborInfo = meshtastic_NeighborInfo_init_zero;
|
||||
collectNeighborInfo(&neighborInfo);
|
||||
neighborInfo.creation = (uint32_t) std::time(nullptr);
|
||||
neighborInfo.creation = getTime();
|
||||
meshtastic_MeshPacket *p = allocDataProtobuf(neighborInfo);
|
||||
// send regardless of whether or not we have neighbors in our DB,
|
||||
// because we want to get neighbors for the next cycle
|
||||
|
Loading…
Reference in New Issue
Block a user