Consistency fixes & repo cleanup

This commit is contained in:
Sacha Weatherstone 2022-05-12 20:45:30 +10:00
parent 14cbc439ab
commit 38913bb661
No known key found for this signature in database
GPG Key ID: 7AB2D7E206124B31
12 changed files with 13 additions and 106 deletions

View File

@ -1,11 +0,0 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/ubuntu/.devcontainer/base.Dockerfile
# [Choice] Ubuntu version: bionic, focal
ARG VARIANT="focal"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install python3-distutils python3-pip
RUN pip3 install platformio meshtastic adafruit-nrfutil
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protoc-3.15.8-linux-x86_64.zip -O /tmp/protoc.zip && cd /tmp && unzip protoc.zip && chmod a+x bin/protoc && cp bin/protoc /usr/local/bin

View File

@ -1,32 +0,0 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/ubuntu
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: focal, bionic
"args": { "VARIANT": "focal" }
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"platformio.platformio-ide",
"xaver.clang-format"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"postCreateCommand": "git submodule update --init"
}

View File

@ -29,5 +29,5 @@ jobs:
uses: peter-evans/create-pull-request@v3
with:
add-paths: |
proto
protobufs
src/mesh

7
.gitmodules vendored
View File

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

View File

@ -73,10 +73,5 @@
"cmake.configureOnOpen": true,
"protoc": {
"compile_on_save": false,
"compile_all_path": "/home/kevinh/development/meshtastic/meshtastic-esp32/proto",
"options": [
"--java_out=/tmp",
"-I=/home/kevinh/development/meshtastic/meshtastic-esp32/proto"
]
}
}

View File

@ -1,16 +0,0 @@
FROM ubuntu
MAINTAINER Kevin Hester <kevinh@geeksville.com>
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install wget python3 g++ zip python3-venv git vim
RUN wget https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -O get-platformio.py; chmod +x get-platformio.py
RUN python3 get-platformio.py
RUN git clone https://github.com/meshtastic/Meshtastic-device.git
RUN cd Meshtastic-device; git submodule update --init --recursive
# only build the simulator
RUN sed -i 's/^BOARDS_ESP32.*/BOARDS_ESP32=""/' Meshtastic-device/bin/build-all.sh
RUN sed -i 's/^BOARDS_NRF52.*/BOARDS_NRF52=""/' Meshtastic-device/bin/build-all.sh
RUN sed -i 's/echo "Building Filesystem.*/exit/' Meshtastic-device/bin/build-all.sh
RUN . ~/.platformio/penv/bin/activate; cd Meshtastic-device; ./bin/build-all.sh
CMD ["/Meshtastic-device/release/latest/bins/universal/meshtasticd_linux_amd64"]

View File

@ -1 +1 @@
cd proto && ..\nanopb-0.4.5\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\proto *.proto
cd protobufs && ..\nanopb-0.4.5\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto

View File

@ -7,8 +7,8 @@ echo "meshtastic-device root directory if the following step fails, you should d
echo "prebuilt binaries for your computer into nanopb-0.4.5"
# the nanopb tool seems to require that the .options file be in the current directory!
cd proto
../nanopb-0.4.5/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../proto *.proto
cd protobufs
../nanopb-0.4.5/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
#echo "Regenerating protobuf documentation - if you see an error message"
#echo "you can ignore it unless doing a new protobuf release to github."

1
design

@ -1 +0,0 @@
Subproject commit 73ba05ceef8beff81eb546a0b9e8ecad03a1216d

View File

View File

@ -146,7 +146,7 @@ bool NodeDB::resetRadioConfig()
void NodeDB::installDefaultConfig()
{
memset(&config, 0, sizeof(config));
config.payloadVariant.device.ntp_server[0] = '0.pool.ntp.org';
*config.payloadVariant.device.ntp_server = '0.pool.ntp.org';
}
void NodeDB::installDefaultModuleConfig()

View File

@ -171,14 +171,6 @@ void AdminModule::handleSetOwner(const User &o)
service.reloadOwner();
}
// void AdminModule::handleSetRadio(RadioConfig &r)
// {
// // writeSecret(r.preferences.wifi_password, radioConfig.preferences.wifi_password);
// radioConfig = r;
// service.reloadConfig();
// }
void AdminModule::handleSetConfig(const Config &c)
{
switch (c.which_payloadVariant) {
@ -270,29 +262,6 @@ void AdminModule::handleGetOwner(const MeshPacket &req)
}
}
// void AdminModule::handleGetRadio(const MeshPacket &req)
// {
// if (req.decoded.want_response) {
// // We create the reply here
// AdminMessage res = AdminMessage_init_default;
// res.get_radio_response = radioConfig;
// // NOTE: The phone app needs to know the ls_secs & phone_timeout value so it can properly expect sleep behavior.
// // So even if we internally use 0 to represent 'use default' we still need to send the value we are
// // using to the app (so that even old phone apps work with new device loads).
// // res.get_radio_response.preferences.ls_secs = getPref_ls_secs(); //TODO: Re-implement if necceasry
// // res.get_radio_response.preferences.phone_timeout_secs = getPref_phone_timeout_secs(); //TODO: Re-implement if
// necceasry
// // hideSecret(r.get_radio_response.preferences.wifi_ssid); // hmm - leave public for now, because only minimally
// private
// // and useful for users to know current provisioning)
// // hideSecret(res.get_radio_response.preferences.wifi_password);
// res.which_variant = AdminMessage_get_radio_response_tag;
// myReply = allocDataProtobuf(res);
// }
// }
void AdminModule::handleGetConfig(const MeshPacket &req, const uint32_t configType)
{
AdminMessage res = AdminMessage_init_default;
@ -302,22 +271,28 @@ void AdminModule::handleGetConfig(const MeshPacket &req, const uint32_t configTy
case AdminMessage_ConfigType_DEVICE_CONFIG:
DEBUG_MSG("Getting config: Device\n");
res.get_config_response.which_payloadVariant = Config_device_tag;
res.get_config_response.payloadVariant.device = config.payloadVariant.device;
break;
case AdminMessage_ConfigType_POSITION_CONFIG:
DEBUG_MSG("Getting config: Position\n");
res.get_config_response.which_payloadVariant = Config_position_tag;
res.get_config_response.payloadVariant.position = config.payloadVariant.position;
break;
case AdminMessage_ConfigType_POWER_CONFIG:
DEBUG_MSG("Getting config: Power\n");
res.get_config_response.which_payloadVariant = Config_power_tag;
res.get_config_response.payloadVariant.power = config.payloadVariant.power;
break;
case AdminMessage_ConfigType_WIFI_CONFIG:
DEBUG_MSG("Getting config: WiFi\n");
res.get_config_response.which_payloadVariant = Config_wifi_tag;
res.get_config_response.payloadVariant.wifi = config.payloadVariant.wifi;
writeSecret(res.get_config_response.payloadVariant.wifi.psk, config.payloadVariant.wifi.psk);
break;
case AdminMessage_ConfigType_DISPLAY_CONFIG:
DEBUG_MSG("Getting config: Display\n");
res.get_config_response.which_payloadVariant = Config_display_tag;
res.get_config_response.payloadVariant.display = config.payloadVariant.display;
break;
case AdminMessage_ConfigType_LORA_CONFIG:
DEBUG_MSG("Getting config: LoRa\n");