Merge branch 'master' into BMP388

This commit is contained in:
David 2024-09-02 16:48:38 +10:00 committed by GitHub
commit d93425fde1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 61 additions and 5 deletions

View File

@ -1,4 +1,4 @@
name: Test Simulator
name: End to end tests
on:
schedule:
@ -55,3 +55,37 @@ jobs:
name: PlatformIO Tests
path: testreport.xml
reporter: java-junit
hardware-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Upgrade python tools
shell: bash
run: |
python -m pip install --upgrade pip
pip install -U --no-build-isolation --no-cache-dir "setuptools<72"
pip install -U platformio adafruit-nrfutil --no-build-isolation
pip install -U poetry --no-build-isolation
pip install -U meshtastic --pre --no-build-isolation
- name: Upgrade platformio
shell: bash
run: |
pio upgrade
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install Dependencies
run: pnpm install
- name: Setup devices
run: pnpm run setup
- name: Execute end to end tests on connected hardware
run: pnpm run test

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "protobufs"]
path = protobufs
url = https://github.com/meshtastic/protobufs.git
[submodule "meshtestic"]
path = meshtestic
url = https://github.com/meshtastic/meshTestic

1
meshtestic Submodule

@ -0,0 +1 @@
Subproject commit 31ee3d90c8bef61e835c3271be2c7cda8c4a5cc2

@ -1 +1 @@
Subproject commit 28492e88e515aabf5c886dd23631518d6dee82d7
Subproject commit 5f7c91adb97187e0cb2140de7057344d93444bd1

View File

@ -44,11 +44,19 @@ void fixPriority(meshtastic_MeshPacket *p)
p->priority = (p->want_ack ? meshtastic_MeshPacket_Priority_RELIABLE : meshtastic_MeshPacket_Priority_DEFAULT);
if (p->which_payload_variant == meshtastic_MeshPacket_decoded_tag) {
// if acks/naks give very high priority
if (p->decoded.portnum == meshtastic_PortNum_ROUTING_APP)
if (p->decoded.portnum == meshtastic_PortNum_ROUTING_APP) {
p->priority = meshtastic_MeshPacket_Priority_ACK;
// if text give high priority
else if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP)
// if text or admin, give high priority
} else if (p->decoded.portnum == meshtastic_PortNum_TEXT_MESSAGE_APP ||
p->decoded.portnum == meshtastic_PortNum_ADMIN_APP) {
p->priority = meshtastic_MeshPacket_Priority_HIGH;
// if it is a response, give higher priority to let it arrive early and stop the request being relayed
} else if (p->decoded.request_id != 0) {
p->priority = meshtastic_MeshPacket_Priority_RESPONSE;
// Also if we want a response, give a bit higher priority
} else if (p->decoded.want_response) {
p->priority = meshtastic_MeshPacket_Priority_RELIABLE;
}
}
}
}

View File

@ -259,6 +259,9 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf)
fromRadioScratch.config.which_payload_variant = meshtastic_Config_security_tag;
fromRadioScratch.config.payload_variant.security = config.security;
break;
case meshtastic_Config_sessionkey_tag:
fromRadioScratch.config.which_payload_variant = meshtastic_Config_sessionkey_tag;
break;
default:
LOG_ERROR("Unknown config type %d\n", config_state);
}

View File

@ -165,6 +165,9 @@ meshtastic_QueueStatus Router::getQueueStatus()
ErrorCode Router::sendLocal(meshtastic_MeshPacket *p, RxSource src)
{
if (p->to == 0) {
LOG_ERROR("Packet received with to: of 0!\n");
}
// No need to deliver externally if the destination is the local node
if (p->to == nodeDB->getNodeNum()) {
printPacket("Enqueued local", p);

View File

@ -350,6 +350,9 @@ typedef enum _meshtastic_MeshPacket_Priority {
/* If priority is unset but the message is marked as want_ack,
assume it is important and use a slightly higher priority */
meshtastic_MeshPacket_Priority_RELIABLE = 70,
/* If priority is unset but the packet is a response to a request, we want it to get there relatively quickly.
Furthermore, responses stop relaying packets directed to a node early. */
meshtastic_MeshPacket_Priority_RESPONSE = 80,
/* Higher priority for specific message types (portnums) to distinguish between other reliable packets. */
meshtastic_MeshPacket_Priority_HIGH = 100,
/* Ack/naks are sent with very high priority to ensure that retransmission

View File

@ -107,6 +107,7 @@ void NeighborInfoModule::sendNeighborInfo(NodeNum dest, bool wantReplies)
// because we want to get neighbors for the next cycle
p->to = dest;
p->decoded.want_response = wantReplies;
p->priority = meshtastic_MeshPacket_Priority_BACKGROUND;
printNeighborInfo("SENDING", &neighborInfo);
service->sendToMesh(p, RX_SRC_LOCAL, true);
}