Merge branch 'meshtastic:master' into T-beam-display-no-touch

This commit is contained in:
Nasimovy 2025-05-13 08:44:18 +02:00 committed by GitHub
commit 95160c436e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 82 additions and 28 deletions

View File

@ -5,7 +5,10 @@ on:
- cron: 0 0 * * * # Run every day at midnight
workflow_dispatch: {}
permissions: read-all
permissions:
contents: read
actions: read
checks: write
jobs:
native-tests:
@ -44,7 +47,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
- name: Setup pnpm
uses: pnpm/action-setup@v4

View File

@ -0,0 +1 @@
renovate.json

View File

@ -10,11 +10,11 @@ lint:
enabled:
- renovate@40.0.6
- prettier@3.5.3
- trufflehog@3.88.27
- trufflehog@3.88.28
- yamllint@1.37.1
- bandit@1.8.3
- terrascan@1.19.9
- trivy@0.61.1
- trivy@0.62.1
- taplo@0.9.3
- ruff@0.11.8
- isort@6.0.1

View File

@ -108,7 +108,7 @@ lib_deps =
[device-ui_base]
lib_deps =
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
https://github.com/meshtastic/device-ui/archive/35576e131e250f259878ea81819a90df837d1307.zip
https://github.com/meshtastic/device-ui/archive/7dee10ad31a0c6ea04880cba399e240be743d752.zip
; Common libs for environmental measurements in telemetry module
[environmental_base]

View File

@ -9,15 +9,21 @@
"workarounds:all"
],
"forkProcessing": "enabled",
"ignoreDeps": ["protobufs"],
"ignoreDeps": [
"protobufs"
],
"git-submodules": {
"enabled": true
},
"pip_requirements": {
"fileMatch": ["bin/bump_metainfo/requirements.txt"]
"managerFilePatterns": [
"/bin/bump_metainfo/requirements.txt/"
]
},
"commitMessageTopic": "{{depName}}",
"labels": ["dependencies"],
"labels": [
"dependencies"
],
"customDatasources": {
"pio": {
"description": "PlatformIO Registry",
@ -32,8 +38,12 @@
{
"customType": "regex",
"description": "Match meshtastic/web version",
"fileMatch": ["bin/web.version"],
"matchStrings": ["(?<currentValue>.+)$"],
"managerFilePatterns": [
"/bin/web.version/"
],
"matchStrings": [
"(?<currentValue>.+)$"
],
"datasourceTemplate": "github-releases",
"depNameTemplate": "meshtastic/web",
"versioningTemplate": "semver-coerced"
@ -41,7 +51,9 @@
{
"customType": "regex",
"description": "Match normal PIO dependencies",
"fileMatch": [".*\\.ini$"],
"managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?.+?@(?<currentValue>.+?)\\s"
],
@ -50,9 +62,11 @@
{
"customType": "regex",
"description": "Match PIO zipped dependencies with github tag ref",
"fileMatch": [".*\\.ini$"],
"managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [
"# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https:\/\/.+?archive\/(?<currentValue>.+?).zip\\s"
"# renovate: datasource=github-tags(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+?https://.+?archive/(?<currentValue>.+?).zip\\s"
],
"datasourceTemplate": "github-tags",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver-coerced{{/if}}"
@ -60,9 +74,11 @@
{
"customType": "regex",
"description": "Match PIO zipped dependencies with git commit ref",
"fileMatch": [".*\\.ini$"],
"managerFilePatterns": [
"/.*\\.ini$/"
],
"matchStrings": [
"# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https:\/\/.+?archive\/(?<currentDigest>.+?).zip\\s"
"# renovate: datasource=git-refs(?: depName=(?<depName>.+?))? packageName=(?<packageName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\sgitBranch=(?<gitBranch>.+?)\\s+?https://.+?archive/(?<currentDigest>.+?).zip\\s"
],
"datasourceTemplate": "git-refs",
"currentValueTemplate": "{{{gitBranch}}}",
@ -71,8 +87,12 @@
],
"packageRules": [
{
"matchDepNames": ["meshtastic/device-ui"],
"reviewers": ["mverch67"],
"matchDepNames": [
"meshtastic/device-ui"
],
"reviewers": [
"mverch67"
],
"changelogUrl": "https://github.com/meshtastic/device-ui/compare/{{currentDigest}}...{{newDigest}}"
}
]

View File

@ -54,7 +54,13 @@ void PhoneAPI::handleStartConfig()
}
// even if we were already connected - restart our state machine
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes
state = STATE_SEND_OWN_NODEINFO;
LOG_INFO("Client only wants node info, skipping other config");
} else {
state = STATE_SEND_MY_INFO;
}
pauseBluetoothLogging = true;
spiLock->lock();
filesManifest = getFiles("/", 10);
@ -224,7 +230,12 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
// Should allow us to resume sending NodeInfo in STATE_SEND_OTHER_NODEINFOS
nodeInfoForPhone.num = 0;
}
if (config_nonce == SPECIAL_NONCE_ONLY_NODES) {
// If client only wants node info, jump directly to sending nodes
state = STATE_SEND_OTHER_NODEINFOS;
} else {
state = STATE_SEND_METADATA;
}
break;
}
@ -388,8 +399,14 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
config_state++;
// Advance when we have sent all of our ModuleConfig objects
if (config_state > (_meshtastic_AdminMessage_ModuleConfigType_MAX + 1)) {
// Clients sending special nonce don't want to see other nodeinfos
state = config_nonce == SPECIAL_NONCE ? STATE_SEND_FILEMANIFEST : STATE_SEND_OTHER_NODEINFOS;
// Handle special nonce behaviors:
// - SPECIAL_NONCE_ONLY_CONFIG: Skip node info, go directly to file manifest
// - SPECIAL_NONCE_ONLY_NODES: After sending nodes, skip to complete
if (config_nonce == SPECIAL_NONCE_ONLY_CONFIG) {
state = STATE_SEND_FILEMANIFEST;
} else {
state = STATE_SEND_OTHER_NODEINFOS;
}
config_state = 0;
}
break;
@ -415,7 +432,8 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
case STATE_SEND_FILEMANIFEST: {
LOG_DEBUG("FromRadio=STATE_SEND_FILEMANIFEST");
// last element
if (config_state == filesManifest.size()) { // also handles an empty filesManifest
if (config_state == filesManifest.size() ||
config_nonce == SPECIAL_NONCE_ONLY_NODES) { // also handles an empty filesManifest
config_state = 0;
filesManifest.clear();
// Skip to complete packet
@ -547,9 +565,12 @@ bool PhoneAPI::available()
auto nextNode = nodeDB->readNextMeshNode(readIndex);
if (nextNode) {
nodeInfoForPhone = TypeConversions::ConvertToNodeInfo(nextNode);
nodeInfoForPhone.hops_away = nodeInfoForPhone.num == nodeDB->getNodeNum() ? 0 : nodeInfoForPhone.hops_away;
nodeInfoForPhone.is_favorite =
nodeInfoForPhone.is_favorite || nodeInfoForPhone.num == nodeDB->getNodeNum(); // Our node is always a favorite
bool isUs = nodeInfoForPhone.num == nodeDB->getNodeNum();
nodeInfoForPhone.hops_away = isUs ? 0 : nodeInfoForPhone.hops_away;
nodeInfoForPhone.last_heard = isUs ? getValidTime(RTCQualityFromNet) : nodeInfoForPhone.last_heard;
nodeInfoForPhone.snr = isUs ? 0 : nodeInfoForPhone.snr;
nodeInfoForPhone.via_mqtt = isUs ? false : nodeInfoForPhone.via_mqtt;
nodeInfoForPhone.is_favorite = nodeInfoForPhone.is_favorite || isUs; // Our node is always a favorite
}
}
return true; // Always say we have something, because we might need to advance our state machine

View File

@ -18,7 +18,8 @@
#error "meshtastic_ToRadio_size is too large for our BLE packets"
#endif
#define SPECIAL_NONCE 69420
#define SPECIAL_NONCE_ONLY_CONFIG 69420
#define SPECIAL_NONCE_ONLY_NODES 69421 // ( ͡° ͜ʖ ͡°)
/**
* Provides our protobuf based API which phone/PC clients can use to talk to our device

View File

@ -1,3 +1,7 @@
/*
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
*/
#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)

View File

@ -1,3 +1,7 @@
/*
* Worth noting that both the AHT10 and AHT20 are supported without alteration.
*/
#include "configuration.h"
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && __has_include(<Adafruit_AHTX0.h>)