From 6e31ba30c72ac34305f04c6f9a87450e3a35ae1f Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 30 Dec 2020 12:34:22 +0800 Subject: [PATCH] move generated protobuf c code to own directory --- bin/regen-protos.sh | 2 +- src/error.h | 2 +- src/mesh/MeshRadio.h | 1 - src/mesh/MeshService.h | 1 - src/mesh/MeshTypes.h | 2 +- src/mesh/PhoneAPI.h | 1 - src/mesh/RadioInterface.h | 1 - src/mesh/Router.h | 1 - src/mesh/{ => generated}/apponly.pb.c | 0 src/mesh/{ => generated}/apponly.pb.h | 0 src/mesh/{ => generated}/deviceonly.pb.c | 0 src/mesh/{ => generated}/deviceonly.pb.h | 0 src/mesh/{ => generated}/mesh.pb.c | 0 src/mesh/{ => generated}/mesh.pb.h | 0 src/mesh/{ => generated}/portnums.pb.c | 0 src/mesh/{ => generated}/portnums.pb.h | 0 src/mesh/{ => generated}/remote_hardware.pb.c | 0 src/mesh/{ => generated}/remote_hardware.pb.h | 0 src/mesh/mesh-pb-constants.h | 4 ++-- src/plugins/RemoteHardwarePlugin.h | 2 +- 20 files changed, 6 insertions(+), 11 deletions(-) rename src/mesh/{ => generated}/apponly.pb.c (100%) rename src/mesh/{ => generated}/apponly.pb.h (100%) rename src/mesh/{ => generated}/deviceonly.pb.c (100%) rename src/mesh/{ => generated}/deviceonly.pb.h (100%) rename src/mesh/{ => generated}/mesh.pb.c (100%) rename src/mesh/{ => generated}/mesh.pb.h (100%) rename src/mesh/{ => generated}/portnums.pb.c (100%) rename src/mesh/{ => generated}/portnums.pb.h (100%) rename src/mesh/{ => generated}/remote_hardware.pb.c (100%) rename src/mesh/{ => generated}/remote_hardware.pb.h (100%) diff --git a/bin/regen-protos.sh b/bin/regen-protos.sh index ce82d3c36..a3335e535 100755 --- a/bin/regen-protos.sh +++ b/bin/regen-protos.sh @@ -8,7 +8,7 @@ echo "prebuilt binaries for your computer into nanopb-0.4.4" # the nanopb tool seems to require that the .options file be in the current directory! cd proto -../nanopb-0.4.4/generator-bin/protoc --nanopb_out=-v:../src/mesh -I=../proto *.proto +../nanopb-0.4.4/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../proto *.proto echo "Regenerating protobuf documentation - if you see an error message" echo "you can ignore it unless doing a new protobuf release to github." diff --git a/src/error.h b/src/error.h index e290c4036..12cb5a002 100644 --- a/src/error.h +++ b/src/error.h @@ -2,7 +2,7 @@ #include -#include "mesh/mesh.pb.h" // For CriticalErrorCode +#include "mesh/generated/mesh.pb.h" // For CriticalErrorCode /// Record an error that should be reported via analytics void recordCriticalError(CriticalErrorCode code = CriticalErrorCode_Unspecified, uint32_t address = 0); diff --git a/src/mesh/MeshRadio.h b/src/mesh/MeshRadio.h index be99032f2..02e775464 100644 --- a/src/mesh/MeshRadio.h +++ b/src/mesh/MeshRadio.h @@ -4,7 +4,6 @@ #include "MeshTypes.h" #include "PointerQueue.h" #include "configuration.h" -#include "mesh.pb.h" // Map from old region names to new region enums struct RegionInfo { diff --git a/src/mesh/MeshService.h b/src/mesh/MeshService.h index b7cfd2432..9e0048eb4 100644 --- a/src/mesh/MeshService.h +++ b/src/mesh/MeshService.h @@ -10,7 +10,6 @@ #include "MeshTypes.h" #include "Observer.h" #include "PointerQueue.h" -#include "mesh.pb.h" /** * Top level app for this service. keeps the mesh, the radio config and the queue of received packets. diff --git a/src/mesh/MeshTypes.h b/src/mesh/MeshTypes.h index 38f18c3a4..8fd098f43 100644 --- a/src/mesh/MeshTypes.h +++ b/src/mesh/MeshTypes.h @@ -3,7 +3,7 @@ // low level types #include "MemoryPool.h" -#include "mesh.pb.h" +#include "mesh/mesh-pb-constants.h" #include typedef uint32_t NodeNum; diff --git a/src/mesh/PhoneAPI.h b/src/mesh/PhoneAPI.h index b895adc7e..202f7fa2d 100644 --- a/src/mesh/PhoneAPI.h +++ b/src/mesh/PhoneAPI.h @@ -2,7 +2,6 @@ #include "Observer.h" #include "mesh-pb-constants.h" -#include "mesh.pb.h" #include // Make sure that we never let our packets grow too large for one BLE packet diff --git a/src/mesh/RadioInterface.h b/src/mesh/RadioInterface.h index b76d30353..0d8c7b9b7 100644 --- a/src/mesh/RadioInterface.h +++ b/src/mesh/RadioInterface.h @@ -6,7 +6,6 @@ #include "Observer.h" #include "PointerQueue.h" #include "airtime.h" -#include "mesh.pb.h" #define MAX_TX_QUEUE 16 // max number of packets which can be waiting for transmission diff --git a/src/mesh/Router.h b/src/mesh/Router.h index 4642a4daf..0035f2ac5 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -6,7 +6,6 @@ #include "PointerQueue.h" #include "RadioInterface.h" #include "concurrency/OSThread.h" -#include "mesh.pb.h" /** * A mesh aware router that supports multiple interfaces. diff --git a/src/mesh/apponly.pb.c b/src/mesh/generated/apponly.pb.c similarity index 100% rename from src/mesh/apponly.pb.c rename to src/mesh/generated/apponly.pb.c diff --git a/src/mesh/apponly.pb.h b/src/mesh/generated/apponly.pb.h similarity index 100% rename from src/mesh/apponly.pb.h rename to src/mesh/generated/apponly.pb.h diff --git a/src/mesh/deviceonly.pb.c b/src/mesh/generated/deviceonly.pb.c similarity index 100% rename from src/mesh/deviceonly.pb.c rename to src/mesh/generated/deviceonly.pb.c diff --git a/src/mesh/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h similarity index 100% rename from src/mesh/deviceonly.pb.h rename to src/mesh/generated/deviceonly.pb.h diff --git a/src/mesh/mesh.pb.c b/src/mesh/generated/mesh.pb.c similarity index 100% rename from src/mesh/mesh.pb.c rename to src/mesh/generated/mesh.pb.c diff --git a/src/mesh/mesh.pb.h b/src/mesh/generated/mesh.pb.h similarity index 100% rename from src/mesh/mesh.pb.h rename to src/mesh/generated/mesh.pb.h diff --git a/src/mesh/portnums.pb.c b/src/mesh/generated/portnums.pb.c similarity index 100% rename from src/mesh/portnums.pb.c rename to src/mesh/generated/portnums.pb.c diff --git a/src/mesh/portnums.pb.h b/src/mesh/generated/portnums.pb.h similarity index 100% rename from src/mesh/portnums.pb.h rename to src/mesh/generated/portnums.pb.h diff --git a/src/mesh/remote_hardware.pb.c b/src/mesh/generated/remote_hardware.pb.c similarity index 100% rename from src/mesh/remote_hardware.pb.c rename to src/mesh/generated/remote_hardware.pb.c diff --git a/src/mesh/remote_hardware.pb.h b/src/mesh/generated/remote_hardware.pb.h similarity index 100% rename from src/mesh/remote_hardware.pb.h rename to src/mesh/generated/remote_hardware.pb.h diff --git a/src/mesh/mesh-pb-constants.h b/src/mesh/mesh-pb-constants.h index b4d8ccf5a..fd3b2cedf 100644 --- a/src/mesh/mesh-pb-constants.h +++ b/src/mesh/mesh-pb-constants.h @@ -1,7 +1,7 @@ #pragma once -#include "mesh.pb.h" -#include "deviceonly.pb.h" +#include "mesh/generated/mesh.pb.h" +#include "mesh/generated/deviceonly.pb.h" // this file defines constants which come from mesh.options diff --git a/src/plugins/RemoteHardwarePlugin.h b/src/plugins/RemoteHardwarePlugin.h index fe9bf960c..5147a18e8 100644 --- a/src/plugins/RemoteHardwarePlugin.h +++ b/src/plugins/RemoteHardwarePlugin.h @@ -1,6 +1,6 @@ #pragma once #include "ProtobufPlugin.h" -#include "remote_hardware.pb.h" +#include "mesh/generated/remote_hardware.pb.h" #include "concurrency/OSThread.h" /**