diff --git a/platformio/stima_v4/libraries/data_types/LICENSE b/platformio/stima_v4/cyphal/data_types/LICENSE similarity index 100% rename from platformio/stima_v4/libraries/data_types/LICENSE rename to platformio/stima_v4/cyphal/data_types/LICENSE diff --git a/platformio/stima_v4/libraries/data_types/README.md b/platformio/stima_v4/cyphal/data_types/README.md similarity index 100% rename from platformio/stima_v4/libraries/data_types/README.md rename to platformio/stima_v4/cyphal/data_types/README.md diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/BatteryCharge.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/BatteryCharge.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/BatteryCurrent.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/BatteryCurrent.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/Humidity.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/Humidity.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/InputVoltage.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/InputVoltage.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/Radiation.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/Radiation.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/Rain.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/Rain.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/RainLongRate.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/RainLongRate.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/RainShortRate.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/RainShortRate.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/Temperature.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/Temperature.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass1Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass1Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass2Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass2Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass3Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass3Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass4Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass4Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass5Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass5Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass6Speed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindClass6Speed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindDirection.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindDirection.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/measures/WindSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/measures/WindSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/metadata/Level.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/metadata/Level.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/metadata/Metadata.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/metadata/Metadata.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/metadata/Timerange.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/metadata/Timerange.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/Power.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/Power.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/Radiation.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/Radiation.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/Rain.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/Rain.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/TH.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/TH.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/VWC.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/VWC.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/module/Wind.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/module/Wind.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/Power.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/Power.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/Radiation.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/Radiation.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/Rain.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/Rain.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/RainRate.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/RainRate.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/TH.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/TH.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/VWC.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/VWC.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgVect.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgVect.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindGustDirection.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindGustDirection.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/Power.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/Power.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/Radiation.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/Radiation.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/Rain.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/Rain.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/TH.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/TH.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/VWC.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/VWC.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/module/Wind.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/module/Wind.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/service/setmode.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/service/setmode.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11001.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11001.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11002.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11002.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11041.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11041.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11043.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11043.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11209.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11209.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11210.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11210.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11211.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11211.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11212.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11212.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11213.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11213.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11214.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11214.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11215.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11215.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B11216.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B11216.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B12101.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B12101.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B13003.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B13003.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B13011.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B13011.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B13208.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B13208.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B13209.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B13209.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B13227.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B13227.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B14198.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B14198.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B25192.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B25192.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B25193.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B25193.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B25194.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B25194.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/rmap/tableb/B33199.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/rmap/tableb/B33199.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/Severity.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/diagnostic/Severity.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/405.GetInfo.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/405.GetInfo.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/405.GetInfo.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/405.GetInfo.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/406.List.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/406.List.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/406.List.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/406.List.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/407.Modify.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/407.Modify.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/407.Modify.1.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/407.Modify.1.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/408.Read.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/408.Read.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/408.Read.1.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/408.Read.1.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/409.Write.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/409.Write.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/409.Write.1.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/409.Write.1.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/Error.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/Error.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/Path.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/Path.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/file/Path.2.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/file/Path.2.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Error.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Error.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Frame.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Frame.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Frame.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Frame.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/RTR.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/can/RTR.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/DEPRECATED b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/DEPRECATED similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/DEPRECATED rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/DEPRECATED diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/430.GetInfo.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/430.GetInfo.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/Health.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/Health.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/ID.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/ID.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/IOStatistics.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/IOStatistics.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/Mode.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/Mode.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/Version.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/Version.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/7510.List.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/7510.List.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/ID.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/ID.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/ServiceID.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/ServiceID.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/SubjectID.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/SubjectID.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/Empty.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/Empty.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/String.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/String.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/Unstructured.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/Unstructured.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Bit.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Bit.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer8.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Integer8.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural8.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Natural8.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/array/Real64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/register/384.Access.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/register/384.Access.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/register/385.List.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/register/385.List.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/register/Name.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/register/Name.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/register/Value.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/register/Value.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/time/7168.Synchronization.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/time/7168.Synchronization.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/time/TAIInfo.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/time/TAIInfo.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl b/platformio/stima_v4/cyphal/data_types/uavcan/time/TimeSystem.0.1.dsdl similarity index 100% rename from platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl rename to platformio/stima_v4/cyphal/data_types/uavcan/time/TimeSystem.0.1.dsdl diff --git a/platformio/stima_v4/libraries/data_types/verify b/platformio/stima_v4/cyphal/data_types/verify similarity index 100% rename from platformio/stima_v4/libraries/data_types/verify rename to platformio/stima_v4/cyphal/data_types/verify diff --git a/platformio/stima_v4/libraries/nnvg_compile.py b/platformio/stima_v4/cyphal/nnvg_installed_compile.py similarity index 100% rename from platformio/stima_v4/libraries/nnvg_compile.py rename to platformio/stima_v4/cyphal/nnvg_installed_compile.py diff --git a/platformio/stima_v4/cyphal/nnvg_piovenv_compile.py b/platformio/stima_v4/cyphal/nnvg_piovenv_compile.py new file mode 100644 index 000000000..e3e3d3f30 --- /dev/null +++ b/platformio/stima_v4/cyphal/nnvg_piovenv_compile.py @@ -0,0 +1,24 @@ +Import("env") +import os + +if not os.path.isfile("../cyphal/include/done"): + + + # install yakut in platformio virtualenv and use generate_types shortcut + try: + from nunavut import generate_types + except ImportError: + env.Execute( + env.VerboseAction( + '$PYTHONEXE -m pip install "yakut"', + "Installing ESP-IDF's Python dependencies", + ) + ) + + from nunavut import generate_types + generate_types("c", "../cyphal/data_types/uavcan", "../cyphal/include", omit_serialization_support=False,language_options={"target_endianness":"little"}) + #generate_types("c", "../cyphal/data_types/reg", "../cyphal/include", omit_serialization_support=False, lookup_directories=["../cyphal/data_types/uavcan",],language_options={"target_endianness":"little"}) + generate_types("c", "../cyphal/data_types/rmap", "../cyphal/include", omit_serialization_support=False, lookup_directories=["../cyphal/data_types/uavcan",],language_options={"target_endianness":"little"}) + + with open('../cyphal/include/done','w') as donefile: + donefile.write("done") diff --git a/platformio/stima_v4/libraries/include/nunavut/support/serialization.h b/platformio/stima_v4/libraries/include/nunavut/support/serialization.h deleted file mode 100644 index 4a85b3153..000000000 --- a/platformio/stima_v4/libraries/include/nunavut/support/serialization.h +++ /dev/null @@ -1,572 +0,0 @@ -// UAVCAN common serialization support routines. +-+ +-+ -// This file is based on canard_dsdl.h, which is part of Libcanard. | | | | -// \ - / -// AUTOGENERATED, DO NOT EDIT. --- -// o -//--------------------------------------------------------------------------------------------------------------------- -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef NUNAVUT_SUPPORT_SERIALIZATION_H_INCLUDED -#define NUNAVUT_SUPPORT_SERIALIZATION_H_INCLUDED - -#ifdef __cplusplus -# if (__cplusplus < 201100L) -# error "Unsupported language: ISO C11, C++11, or a newer version of either is required." -# endif -extern "C" -{ -#else -# if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) -# error "Unsupported language: ISO C11 or a newer version is required." -# endif -#endif - -#include - -#include -#include // For isfinite(). -#include -#include -#include // For static_assert (C11) and assert() if NUNAVUT_ASSERT is used. - -static_assert(sizeof(size_t) >= sizeof(size_t), - "The bit-length type used by Nunavut, size_t, " - "is smaller than this platform's size_t type. " - "Nunavut serialization relies on size_t to size_t conversions " - "that do not lose data. You will need to regenerate Nunavut serialization support with a larger " - "unsigned_bit_length type specified."); - -#define NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS 434322821 -#define NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT 0 -#define NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS 0 -#define NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY 0 -#define NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT 2368206204 - -/// Nunavut returns 0 for success and < 0 for any failure. It is always adequate to check that error_value < 0 -/// to detect errors or error_value == 0 for success. -/// -/// Nunavut serialization will never define more than 127 errors and the reserved error numbers are [-1,-127] -/// (-128 is not used). Error code 1 is currently also not used to avoid conflicts with 3rd-party software. -/// -/// Return values > 0 for Nunavut serialization are undefined. -#define NUNAVUT_SUCCESS 0 -// API usage errors: -#define NUNAVUT_ERROR_INVALID_ARGUMENT 2 -#define NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL 3 -// Invalid representation (caused by bad input data, not API misuse): -#define NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH 10 -#define NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG 11 -#define NUNAVUT_ERROR_REPRESENTATION_BAD_DELIMITER_HEADER 12 - -/// Detect whether the target platform is compatible with IEEE 754. -#define NUNAVUT_PLATFORM_IEEE754_FLOAT \ - ((FLT_RADIX == 2) && (FLT_MANT_DIG == 24) && (FLT_MIN_EXP == -125) && (FLT_MAX_EXP == 128)) -#define NUNAVUT_PLATFORM_IEEE754_DOUBLE \ - ((FLT_RADIX == 2) && (DBL_MANT_DIG == 53) && (DBL_MIN_EXP == -1021) && (DBL_MAX_EXP == 1024)) - -#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__) -# error "This code has been generated for little-endian platforms only. " \ - "To generate portable endianness-invariant code, set the Nunavut option target_endianness='any' " \ - "and regenerate the code. This change will have some performance impact for little-endian machines." -#endif - -// ---------------------------------------------------- HELPERS ---------------------------------------------------- - -/// Returns the smallest value. -static inline size_t nunavutChooseMin(const size_t a, const size_t b) -{ - return (a < b) ? a : b; -} - -/// Calculate the number of bits to safely copy from/to a serialized buffer. -/// Mind the units! By convention, buffer size is specified in bytes, but fragment length and offset are in bits. -/// -/// buffer buffer -/// origin end -/// [------------------------- buffer_size_bytes ------------------------] -/// [--------------- fragment_offset_bits ---------------][--- fragment_length_bits ---] -/// [-- out bits --] -/// -static inline size_t nunavutSaturateBufferFragmentBitLength( - const size_t buffer_size_bytes, const size_t fragment_offset_bits, const size_t fragment_length_bits) -{ - const size_t size_bits = (size_t)buffer_size_bytes * 8U; - const size_t tail_bits = size_bits - nunavutChooseMin(size_bits, fragment_offset_bits); - return nunavutChooseMin(fragment_length_bits, tail_bits); -} - -// ---------------------------------------------------- BIT ARRAY ---------------------------------------------------- - -/// Copy the specified number of bits from the source buffer into the destination buffer in accordance with the -/// DSDL bit-level serialization specification. The offsets may be arbitrary (may exceed 8 bits). -/// If both offsets are byte-aligned, the function invokes memmove() and possibly adjusts the last byte separately. -/// If the source and the destination overlap AND the offsets are not byte-aligned, the behavior is undefined. -/// If either source or destination pointers are NULL, the behavior is undefined. -/// Arguments: -/// dst Destination buffer. Shall be at least ceil(length_bits/8) bytes large. -/// dst_offset_bits Offset in bits from the destination pointer. May exceed 8. -/// length_bits The number of bits to copy. Both source and destination shall be large enough. -/// src Source buffer. Shall be at least ceil(length_bits/8) bytes large. -/// src_offset_bits Offset in bits from the source pointer. May exceed 8. -static inline void nunavutCopyBits(void* const dst, - const size_t dst_offset_bits, - const size_t length_bits, - const void* const src, - const size_t src_offset_bits) -{ - - - - if ((0U == (src_offset_bits % 8U)) && (0U == (dst_offset_bits % 8U))) // Aligned copy, optimized, most common case. - { - const size_t length_bytes = (size_t)(length_bits / 8U); - // Intentional violation of MISRA: Pointer arithmetics. This is done to remove the API constraint that - // offsets be under 8 bits. Fewer constraints reduce the chance of API misuse. - const uint8_t* const psrc = (src_offset_bits / 8U) + (const uint8_t*) src; // NOSONAR NOLINT - uint8_t* const pdst = (dst_offset_bits / 8U) + (uint8_t*) dst; // NOSONAR NOLINT - (void) memmove(pdst, psrc, length_bytes); - const uint8_t length_mod = (uint8_t)(length_bits % 8U); - if (0U != length_mod) // If the length is unaligned, the last byte requires special treatment. - { - // Intentional violation of MISRA: Pointer arithmetics. It is unavoidable in this context. - const uint8_t* const last_src = psrc + length_bytes; // NOLINT NOSONAR - uint8_t* const last_dst = pdst + length_bytes; // NOLINT NOSONAR - - const uint8_t mask = (uint8_t)((1U << length_mod) - 1U); - *last_dst = (*last_dst & (uint8_t)~mask) | (*last_src & mask); - } - } - else - { - // The algorithm was originally designed by Ben Dyer for Libuavcan v0: - // https://github.com/OpenCyphal/libuavcan/blob/legacy-v0/libuavcan/src/marshal/uc_bit_array_copy.cpp - // This version is modified for v1 where the bit order is the opposite. - const uint8_t* const psrc = (const uint8_t*) src; - uint8_t* const pdst = (uint8_t*) dst; - size_t src_off = src_offset_bits; - size_t dst_off = dst_offset_bits; - const size_t last_bit = src_off + length_bits; - - - while (last_bit > src_off) - { - const uint8_t src_mod = (uint8_t)(src_off % 8U); - const uint8_t dst_mod = (uint8_t)(dst_off % 8U); - const uint8_t max_mod = (src_mod > dst_mod) ? src_mod : dst_mod; - const uint8_t size = (uint8_t) nunavutChooseMin(8U - max_mod, last_bit - src_off); - - - // Suppress a false warning from Clang-Tidy & Sonar that size is being over-shifted. It's not. - const uint8_t mask = (uint8_t)((((1U << size) - 1U) << dst_mod) & 0xFFU); // NOLINT NOSONAR - - // Intentional violation of MISRA: indexing on a pointer. - // This simplifies the implementation greatly and avoids pointer arithmetics. - const uint8_t in = (uint8_t)((uint8_t)(psrc[src_off / 8U] >> src_mod) << dst_mod) & 0xFFU; // NOSONAR - // Intentional violation of MISRA: indexing on a pointer. - // This simplifies the implementation greatly and avoids pointer arithmetics. - const uint8_t a = pdst[dst_off / 8U] & ((uint8_t) ~mask); // NOSONAR - const uint8_t b = in & mask; - // Intentional violation of MISRA: indexing on a pointer. - // This simplifies the implementation greatly and avoids pointer arithmetics. - pdst[dst_off / 8U] = a | b; // NOSONAR - src_off += size; - dst_off += size; - } - - } -} - -/// This function is intended for deserialization of contiguous sequences of zero-cost primitives. -/// It extracts (len_bits) bits that are offset by (off_bits) from the origin of (buf) whose size is (buf_size_bytes). -/// If the requested (len_bits+off_bits) overruns the buffer, the missing bits are implicitly zero-extended. -/// If (len_bits % 8 != 0), the output buffer is right-zero-padded up to the next byte boundary. -/// If (off_bits % 8 == 0), the operation is delegated to memmove(); otherwise, a much slower unaligned bit copy -/// algorithm is employed. See @ref nunavutCopyBits() for further details. -static inline void nunavutGetBits(void* const output, - const void* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const size_t len_bits) -{ - - - const size_t sat_bits = nunavutSaturateBufferFragmentBitLength(buf_size_bytes, off_bits, len_bits); - // Apply implicit zero extension. Normally, this is a no-op unless (len_bits > sat_bits) or (len_bits % 8 != 0). - // The former case ensures that if we're copying <8 bits, the MSB in the destination will be zeroed out. - (void) memset(((uint8_t*)output) + (sat_bits / 8U), 0, ((len_bits + 7U) / 8U) - (sat_bits / 8U)); - nunavutCopyBits(output, 0U, sat_bits, buf, off_bits); -} - -// ---------------------------------------------------- INTEGER ---------------------------------------------------- - -/// Serialize a DSDL field value at the specified bit offset from the beginning of the destination buffer. -/// The behavior is undefined if the input pointer is NULL. The time complexity is linear of the bit length. -/// One-bit-wide signed integers are processed without raising an error but the result is unspecified. -/// -/// Arguments: -/// buf Destination buffer where the result will be stored. -/// buf_size_bytes Size of the above, in bytes. -/// off_bits Offset, in bits, from the beginning of the buffer. May exceed one byte. -/// value The value itself (in case of integers it is promoted to 64-bit for unification). -/// len_bits Length of the serialized representation, in bits. Zero has no effect. Values >64 bit saturated. - -static inline int8_t nunavutSetBit( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const bool value) -{ - - if ((buf_size_bytes * 8) <= off_bits) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - const uint8_t val = value ? 1U : 0U; - nunavutCopyBits(buf, off_bits, 1U, &val, 0U); - return NUNAVUT_SUCCESS; -} - -static inline int8_t nunavutSetUxx( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint64_t value, - const uint8_t len_bits) -{ - static_assert(64U == (sizeof(uint64_t) * 8U), "Unexpected size of uint64_t"); - - if ((buf_size_bytes * 8) < (off_bits + len_bits)) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - const size_t saturated_len_bits = nunavutChooseMin(len_bits, 64U); - nunavutCopyBits(buf, off_bits, saturated_len_bits, (const uint8_t*) &value, 0U); - return NUNAVUT_SUCCESS; -} - -static inline int8_t nunavutSetIxx( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const int64_t value, - const uint8_t len_bits) -{ - // The naive sign conversion is safe and portable according to the C standard: - // 6.3.1.3.3: if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more - // than the maximum value that can be represented in the new type until the value is in the range of the new type. - return nunavutSetUxx(buf, buf_size_bytes, off_bits, (uint64_t) value, len_bits); -} - -/// Deserialize a DSDL field value located at the specified bit offset from the beginning of the source buffer. -/// If the deserialized value extends beyond the end of the buffer, the missing bits are taken as zero, as required -/// by the DSDL specification (see Implicit Zero Extension Rule, IZER). -/// -/// If len_bits is greater than the return type, extra bits will be truncated per standard narrowing conversion rules. -/// If len_bits is shorter than the return type, missing bits will be zero per standard integer promotion rules. -/// Essentially, for integers, it would be enough to have 64-bit versions only; narrower variants exist only to avoid -/// narrowing type conversions of the result and for some performance gains. -/// -/// The behavior is undefined if the input pointer is NULL. The time complexity is linear of the bit length. -/// One-bit-wide signed integers are processed without raising an error but the result is unspecified. -/// -/// Arguments: -/// buf Source buffer where the serialized representation will be read from. -/// buf_size_bytes The size of the source buffer, in bytes. Reads past this limit will return zero bits. -/// off_bits Offset, in bits, from the beginning of the buffer. May exceed one byte. -/// len_bits Length of the serialized representation, in bits. Zero returns 0. Out-of-range values saturated. - -static inline uint8_t nunavutGetU8(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits); - -static inline bool nunavutGetBit(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits) -{ - return 1U == nunavutGetU8(buf, buf_size_bytes, off_bits, 1U); -} - -static inline uint8_t nunavutGetU8(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - - const size_t bits = nunavutSaturateBufferFragmentBitLength(buf_size_bytes, off_bits, nunavutChooseMin(len_bits, 8U)); - - uint8_t val = 0; - nunavutCopyBits(&val, 0U, bits, buf, off_bits); - return val; -} - -static inline uint16_t nunavutGetU16(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - - const size_t bits = nunavutSaturateBufferFragmentBitLength(buf_size_bytes, off_bits, nunavutChooseMin(len_bits, 16U)); - - uint16_t val = 0U; - nunavutCopyBits(&val, 0U, bits, buf, off_bits); - return val; -} - -static inline uint32_t nunavutGetU32(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - - const size_t bits = nunavutSaturateBufferFragmentBitLength(buf_size_bytes, off_bits, nunavutChooseMin(len_bits, 32U)); - - uint32_t val = 0U; - nunavutCopyBits(&val, 0U, bits, buf, off_bits); - return val; -} - -static inline uint64_t nunavutGetU64(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - - const size_t bits = nunavutSaturateBufferFragmentBitLength(buf_size_bytes, off_bits, nunavutChooseMin(len_bits, 64U)); - - uint64_t val = 0U; - nunavutCopyBits(&val, 0U, bits, buf, off_bits); - return val; -} - -static inline int8_t nunavutGetI8(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - const uint8_t sat = (uint8_t) nunavutChooseMin(len_bits, 8U); - uint8_t val = nunavutGetU8(buf, buf_size_bytes, off_bits, sat); - const bool neg = (sat > 0U) && ((val & (1ULL << (sat - 1U))) != 0U); - val = ((sat < 8U) && neg) ? (uint8_t)(val | ~((1U << sat) - 1U)) : val; // Sign extension - return neg ? (int8_t)((-(int8_t)(uint8_t) ~val) - 1) : (int8_t) val; -} - -static inline int16_t nunavutGetI16(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - const uint8_t sat = (uint8_t) nunavutChooseMin(len_bits, 16U); - uint16_t val = nunavutGetU16(buf, buf_size_bytes, off_bits, sat); - const bool neg = (sat > 0U) && ((val & (1ULL << (sat - 1U))) != 0U); - val = ((sat < 16U) && neg) ? (uint16_t)(val | ~((1U << sat) - 1U)) : val; // Sign extension - return neg ? (int16_t)((-(int16_t)(uint16_t) ~val) - 1) : (int16_t) val; -} - -static inline int32_t nunavutGetI32(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - const uint8_t sat = (uint8_t) nunavutChooseMin(len_bits, 32U); - uint32_t val = nunavutGetU32(buf, buf_size_bytes, off_bits, sat); - const bool neg = (sat > 0U) && ((val & (1ULL << (sat - 1U))) != 0U); - val = ((sat < 32U) && neg) ? (uint32_t)(val | ~((1UL << sat) - 1U)) : val; // Sign extension - return neg ? (int32_t)((-(int32_t) ~val) - 1) : (int32_t) val; -} - -static inline int64_t nunavutGetI64(const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const uint8_t len_bits) -{ - const uint8_t sat = (uint8_t) nunavutChooseMin(len_bits, 64U); - uint64_t val = nunavutGetU64(buf, buf_size_bytes, off_bits, sat); - const bool neg = (sat > 0U) && ((val & (1ULL << (sat - 1U))) != 0U); - val = ((sat < 64U) && neg) ? (uint64_t)(val | ~((1ULL << sat) - 1U)) : val; // Sign extension - return neg ? (int64_t)((-(int64_t) ~val) - 1) : (int64_t) val; -} - -// ---------------------------------------------------- FLOAT16 ---------------------------------------------------- - -static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, - "The target platform does not support IEEE754 floating point operations."); -static_assert(32U == (sizeof(float) * 8U), "Unsupported floating point model"); - -/// Converts a single-precision float into the binary representation of the value as a half-precision IEEE754 value. -static inline uint16_t nunavutFloat16Pack(const float value) -{ - typedef union // NOSONAR - { - uint32_t bits; - float real; - } Float32Bits; - - // The no-lint statements suppress the warning about the use of union. This is required for low-level bit access. - const uint32_t round_mask = ~(uint32_t) 0x0FFFU; - Float32Bits f32inf; // NOSONAR - Float32Bits f16inf; // NOSONAR - Float32Bits magic; // NOSONAR - Float32Bits in; // NOSONAR - f32inf.bits = ((uint32_t) 255U) << 23U; - f16inf.bits = ((uint32_t) 31U) << 23U; - magic.bits = ((uint32_t) 15U) << 23U; - in.real = value; - const uint32_t sign = in.bits & (((uint32_t) 1U) << 31U); - in.bits ^= sign; - uint16_t out = 0; - if (in.bits >= f32inf.bits) - { - if ((in.bits & 0x7FFFFFUL) != 0) - { - out = 0x7E00U; - } - else - { - out = (in.bits > f32inf.bits) ? (uint16_t) 0x7FFFU : (uint16_t) 0x7C00U; - } - } - else - { - in.bits &= round_mask; - in.real *= magic.real; - in.bits -= round_mask; - if (in.bits > f16inf.bits) - { - in.bits = f16inf.bits; - } - out = (uint16_t)(in.bits >> 13U); - } - out |= (uint16_t)(sign >> 16U); - return out; -} - -static inline float nunavutFloat16Unpack(const uint16_t value) -{ - typedef union // NOSONAR - { - uint32_t bits; - float real; - } Float32Bits; - - // The no-lint statements suppress the warning about the use of union. This is required for low-level bit access. - Float32Bits magic; // NOSONAR - Float32Bits inf_nan; // NOSONAR - Float32Bits out; // NOSONAR - magic.bits = ((uint32_t) 0xEFU) << 23U; - inf_nan.bits = ((uint32_t) 0x8FU) << 23U; - out.bits = ((uint32_t)(value & 0x7FFFU)) << 13U; - out.real *= magic.real; - if (out.real >= inf_nan.real) - { - out.bits |= ((uint32_t) 0xFFU) << 23U; - } - out.bits |= ((uint32_t)(value & 0x8000U)) << 16U; - return out.real; -} - -static inline int8_t nunavutSetF16( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const float value) -{ - return nunavutSetUxx(buf, buf_size_bytes, off_bits, nunavutFloat16Pack(value), 16U); -} - -static inline float nunavutGetF16( - const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits) -{ - return nunavutFloat16Unpack(nunavutGetU16(buf, buf_size_bytes, off_bits, 16U)); -} - -// ---------------------------------------------------- FLOAT32 ---------------------------------------------------- - -static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, - "The target platform does not support IEEE754 floating point operations."); -static_assert(32U == (sizeof(float) * 8U), "Unsupported floating point model"); - -static inline int8_t nunavutSetF32( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const float value) -{ - // Intentional violation of MISRA: use union to perform fast conversion from an IEEE 754-compatible native - // representation into a serializable integer. The assumptions about the target platform properties are made - // clear. In the future we may add a more generic conversion that is platform-invariant. - union // NOSONAR - { - float fl; - uint32_t in; - } const tmp = {value}; // NOSONAR - return nunavutSetUxx(buf, buf_size_bytes, off_bits, tmp.in, sizeof(tmp) * 8U); -} - -static inline float nunavutGetF32( - const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits) -{ - // Intentional violation of MISRA: use union to perform fast conversion to an IEEE 754-compatible native - // representation into a serializable integer. The assumptions about the target platform properties are made - // clear. In the future we may add a more generic conversion that is platform-invariant. - union // NOSONAR - { - uint32_t in; - float fl; - } const tmp = {nunavutGetU32(buf, buf_size_bytes, off_bits, 32U)}; - return tmp.fl; -} - -// ---------------------------------------------------- FLOAT64 ---------------------------------------------------- - -static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, - "The target platform does not support IEEE754 double-precision floating point operations."); -static_assert(64U == (sizeof(double) * 8U), "Unsupported floating point model"); - -static inline int8_t nunavutSetF64( - uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits, - const double value) -{ - // Intentional violation of MISRA: use union to perform fast conversion from an IEEE 754-compatible native - // representation into a serializable integer. The assumptions about the target platform properties are made - // clear. In the future we may add a more generic conversion that is platform-invariant. - union // NOSONAR - { - double fl; - uint64_t in; - } const tmp = {value}; // NOSONAR - return nunavutSetUxx(buf, buf_size_bytes, off_bits, tmp.in, sizeof(tmp) * 8U); -} - -static inline double nunavutGetF64( - const uint8_t* const buf, - const size_t buf_size_bytes, - const size_t off_bits) -{ - // Intentional violation of MISRA: use union to perform fast conversion to an IEEE 754-compatible native - // representation into a serializable integer. The assumptions about the target platform properties are made - // clear. In the future we may add a more generic conversion that is platform-invariant. - union // NOSONAR - { - uint64_t in; - double fl; - } const tmp = {nunavutGetU64(buf, buf_size_bytes, off_bits, 64U)}; - return tmp.fl; -} - -#ifdef __cplusplus -} -#endif - -#endif // NUNAVUT_SUPPORT_SERIALIZATION_H_INCLUDED diff --git a/platformio/stima_v4/libraries/include/rmap/_module/Power_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/Power_1_0.h deleted file mode 100644 index 2e9105062..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/Power_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.273119 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.Power -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_POWER_1_0_INCLUDED_ -#define RMAP_MODULE_POWER_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_Power_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_Power_1_0_FULL_NAME_ "rmap.module.Power" -#define rmap_module_Power_1_0_FULL_NAME_AND_VERSION_ "rmap.module.Power.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_Power_1_0_EXTENT_BYTES_ 21UL -#define rmap_module_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 21UL -static_assert(rmap_module_Power_1_0_EXTENT_BYTES_ >= rmap_module_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.Power.1.0 MPP - rmap_sensors_Power_1_0 MPP; -} rmap_module_Power_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Power_1_0_serialize_( - const rmap_module_Power_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 168UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.Power.1.0 MPP - size_t _size_bytes0_ = 21UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_Power_1_0_serialize_( - &obj->MPP, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Power_1_0_deserialize_( - rmap_module_Power_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.Power.1.0 MPP - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_sensors_Power_1_0_deserialize_( - &out_obj->MPP, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_Power_1_0_initialize_(rmap_module_Power_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_Power_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_POWER_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/_module/Radiation_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/Radiation_1_0.h deleted file mode 100644 index 0cdb24b46..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/Radiation_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.430311 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.Radiation -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_RADIATION_1_0_INCLUDED_ -#define RMAP_MODULE_RADIATION_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_Radiation_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_Radiation_1_0_FULL_NAME_ "rmap.module.Radiation" -#define rmap_module_Radiation_1_0_FULL_NAME_AND_VERSION_ "rmap.module.Radiation.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_Radiation_1_0_EXTENT_BYTES_ 16UL -#define rmap_module_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_module_Radiation_1_0_EXTENT_BYTES_ >= rmap_module_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.Radiation.1.0 DSA - rmap_sensors_Radiation_1_0 DSA; -} rmap_module_Radiation_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Radiation_1_0_serialize_( - const rmap_module_Radiation_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.Radiation.1.0 DSA - size_t _size_bytes0_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_Radiation_1_0_serialize_( - &obj->DSA, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Radiation_1_0_deserialize_( - rmap_module_Radiation_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.Radiation.1.0 DSA - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_sensors_Radiation_1_0_deserialize_( - &out_obj->DSA, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_Radiation_1_0_initialize_(rmap_module_Radiation_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_Radiation_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_RADIATION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/_module/Rain_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/Rain_1_0.h deleted file mode 100644 index 30a376605..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/Rain_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.430311 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.Rain -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_RAIN_1_0_INCLUDED_ -#define RMAP_MODULE_RAIN_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_Rain_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_Rain_1_0_FULL_NAME_ "rmap.module.Rain" -#define rmap_module_Rain_1_0_FULL_NAME_AND_VERSION_ "rmap.module.Rain.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_Rain_1_0_EXTENT_BYTES_ 35UL -#define rmap_module_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 35UL -static_assert(rmap_module_Rain_1_0_EXTENT_BYTES_ >= rmap_module_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.Rain.1.0 TBR - rmap_sensors_Rain_1_0 TBR; - - /// rmap.sensors.RainRate.1.0 TPR - rmap_sensors_RainRate_1_0 TPR; -} rmap_module_Rain_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Rain_1_0_serialize_( - const rmap_module_Rain_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 280UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.Rain.1.0 TBR - size_t _size_bytes0_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_Rain_1_0_serialize_( - &obj->TBR, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.sensors.RainRate.1.0 TPR - size_t _size_bytes1_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_sensors_RainRate_1_0_serialize_( - &obj->TPR, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Rain_1_0_deserialize_( - rmap_module_Rain_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.Rain.1.0 TBR - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_sensors_Rain_1_0_deserialize_( - &out_obj->TBR, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.RainRate.1.0 TPR - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_sensors_RainRate_1_0_deserialize_( - &out_obj->TPR, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_Rain_1_0_initialize_(rmap_module_Rain_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_Rain_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_RAIN_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/_module/TH_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/TH_1_0.h deleted file mode 100644 index 1f1642991..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/TH_1_0.h +++ /dev/null @@ -1,407 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.430311 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.TH -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_TH_1_0_INCLUDED_ -#define RMAP_MODULE_TH_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_TH_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_TH_1_0_FULL_NAME_ "rmap.module.TH" -#define rmap_module_TH_1_0_FULL_NAME_AND_VERSION_ "rmap.module.TH.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_TH_1_0_EXTENT_BYTES_ 90UL -#define rmap_module_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 90UL -static_assert(rmap_module_TH_1_0_EXTENT_BYTES_ >= rmap_module_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.TH.1.0 STH - rmap_sensors_TH_1_0 STH; - - /// rmap.sensors.TH.1.0 ITH - rmap_sensors_TH_1_0 ITH; - - /// rmap.sensors.TH.1.0 NTH - rmap_sensors_TH_1_0 NTH; - - /// rmap.sensors.TH.1.0 MTH - rmap_sensors_TH_1_0 MTH; - - /// rmap.sensors.TH.1.0 XTH - rmap_sensors_TH_1_0 XTH; -} rmap_module_TH_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_TH_1_0_serialize_( - const rmap_module_TH_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 720UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.TH.1.0 STH - size_t _size_bytes0_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_TH_1_0_serialize_( - &obj->STH, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.sensors.TH.1.0 ITH - size_t _size_bytes1_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_sensors_TH_1_0_serialize_( - &obj->ITH, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.TH.1.0 NTH - size_t _size_bytes2_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_sensors_TH_1_0_serialize_( - &obj->NTH, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.TH.1.0 MTH - size_t _size_bytes3_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err6_ = rmap_sensors_TH_1_0_serialize_( - &obj->MTH, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - - { // rmap.sensors.TH.1.0 XTH - size_t _size_bytes4_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_sensors_TH_1_0_serialize_( - &obj->XTH, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_TH_1_0_deserialize_( - rmap_module_TH_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.TH.1.0 STH - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->STH, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 ITH - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err11_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->ITH, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 NTH - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err12_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->NTH, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 MTH - { - size_t _size_bytes8_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err13_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->MTH, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err13_ < 0) - { - return _err13_; - } - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 XTH - { - size_t _size_bytes9_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err14_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->XTH, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_TH_1_0_initialize_(rmap_module_TH_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_TH_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_TH_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/_module/VWC_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/VWC_1_0.h deleted file mode 100644 index 556409f1d..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/VWC_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.446258 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.VWC -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_VWC_1_0_INCLUDED_ -#define RMAP_MODULE_VWC_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_VWC_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_VWC_1_0_FULL_NAME_ "rmap.module.VWC" -#define rmap_module_VWC_1_0_FULL_NAME_AND_VERSION_ "rmap.module.VWC.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_VWC_1_0_EXTENT_BYTES_ 16UL -#define rmap_module_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_module_VWC_1_0_EXTENT_BYTES_ >= rmap_module_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.VWC.1.0 VWC - rmap_sensors_VWC_1_0 VWC; -} rmap_module_VWC_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_VWC_1_0_serialize_( - const rmap_module_VWC_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.VWC.1.0 VWC - size_t _size_bytes0_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_VWC_1_0_serialize_( - &obj->VWC, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_VWC_1_0_deserialize_( - rmap_module_VWC_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.VWC.1.0 VWC - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_sensors_VWC_1_0_deserialize_( - &out_obj->VWC, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_VWC_1_0_initialize_(rmap_module_VWC_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_VWC_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_VWC_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/_module/Wind_1_0.h b/platformio/stima_v4/libraries/include/rmap/_module/Wind_1_0.h deleted file mode 100644 index 356b22059..000000000 --- a/platformio/stima_v4/libraries/include/rmap/_module/Wind_1_0.h +++ /dev/null @@ -1,454 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.446258 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.module.Wind -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MODULE_WIND_1_0_INCLUDED_ -#define RMAP_MODULE_WIND_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_module_Wind_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_module_Wind_1_0_FULL_NAME_ "rmap.module.Wind" -#define rmap_module_Wind_1_0_FULL_NAME_AND_VERSION_ "rmap.module.Wind.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_module_Wind_1_0_EXTENT_BYTES_ 117UL -#define rmap_module_Wind_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 117UL -static_assert(rmap_module_Wind_1_0_EXTENT_BYTES_ >= rmap_module_Wind_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.sensors.WindAvgVect10.1.0 DWA - rmap_sensors_WindAvgVect10_1_0 DWA; - - /// rmap.sensors.WindAvgVect.1.0 DWB - rmap_sensors_WindAvgVect_1_0 DWB; - - /// rmap.sensors.WindGustSpeed.1.0 DWC - rmap_sensors_WindGustSpeed_1_0 DWC; - - /// rmap.sensors.WindAvgSpeed.1.0 DWD - rmap_sensors_WindAvgSpeed_1_0 DWD; - - /// rmap.sensors.WindClassSpeed.1.0 DWE - rmap_sensors_WindClassSpeed_1_0 DWE; - - /// rmap.sensors.WindGustDirection.1.0 DWF - rmap_sensors_WindGustDirection_1_0 DWF; -} rmap_module_Wind_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_module_Wind_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Wind_1_0_serialize_( - const rmap_module_Wind_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 936UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.sensors.WindAvgVect10.1.0 DWA - size_t _size_bytes0_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_sensors_WindAvgVect10_1_0_serialize_( - &obj->DWA, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.sensors.WindAvgVect.1.0 DWB - size_t _size_bytes1_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_sensors_WindAvgVect_1_0_serialize_( - &obj->DWB, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.WindGustSpeed.1.0 DWC - size_t _size_bytes2_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_sensors_WindGustSpeed_1_0_serialize_( - &obj->DWC, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.WindAvgSpeed.1.0 DWD - size_t _size_bytes3_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err6_ = rmap_sensors_WindAvgSpeed_1_0_serialize_( - &obj->DWD, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - - { // rmap.sensors.WindClassSpeed.1.0 DWE - size_t _size_bytes4_ = 25UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_sensors_WindClassSpeed_1_0_serialize_( - &obj->DWE, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad4_; - } - - { // rmap.sensors.WindGustDirection.1.0 DWF - size_t _size_bytes5_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err10_ = rmap_sensors_WindGustDirection_1_0_serialize_( - &obj->DWF, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err10_ < 0) - { - return _err10_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad5_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err11_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad5_); // Optimize? - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _pad5_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_module_Wind_1_0_deserialize_( - rmap_module_Wind_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.sensors.WindAvgVect10.1.0 DWA - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err12_ = rmap_sensors_WindAvgVect10_1_0_deserialize_( - &out_obj->DWA, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindAvgVect.1.0 DWB - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err13_ = rmap_sensors_WindAvgVect_1_0_deserialize_( - &out_obj->DWB, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err13_ < 0) - { - return _err13_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindGustSpeed.1.0 DWC - { - size_t _size_bytes8_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err14_ = rmap_sensors_WindGustSpeed_1_0_deserialize_( - &out_obj->DWC, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindAvgSpeed.1.0 DWD - { - size_t _size_bytes9_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err15_ = rmap_sensors_WindAvgSpeed_1_0_deserialize_( - &out_obj->DWD, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err15_ < 0) - { - return _err15_; - } - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindClassSpeed.1.0 DWE - { - size_t _size_bytes10_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err16_ = rmap_sensors_WindClassSpeed_1_0_deserialize_( - &out_obj->DWE, &buffer[offset_bits / 8U], &_size_bytes10_); - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _size_bytes10_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindGustDirection.1.0 DWF - { - size_t _size_bytes11_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err17_ = rmap_sensors_WindGustDirection_1_0_deserialize_( - &out_obj->DWF, &buffer[offset_bits / 8U], &_size_bytes11_); - if (_err17_ < 0) - { - return _err17_; - } - offset_bits += _size_bytes11_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_module_Wind_1_0_initialize_(rmap_module_Wind_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_module_Wind_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MODULE_WIND_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/BatteryCharge_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/BatteryCharge_1_0.h deleted file mode 100644 index 6e9007beb..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/BatteryCharge_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.524217 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.BatteryCharge -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_BATTERY_CHARGE_1_0_INCLUDED_ -#define RMAP_MEASURES_BATTERY_CHARGE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCharge.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_BatteryCharge_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_BatteryCharge_1_0_FULL_NAME_ "rmap.measures.BatteryCharge" -#define rmap_measures_BatteryCharge_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.BatteryCharge.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_BatteryCharge_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_BatteryCharge_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_BatteryCharge_1_0_EXTENT_BYTES_ >= rmap_measures_BatteryCharge_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B25192.1.0 val - rmap_tableb_B25192_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_BatteryCharge_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_BatteryCharge_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_BatteryCharge_1_0_serialize_( - const rmap_measures_BatteryCharge_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B25192.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B25192_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_BatteryCharge_1_0_deserialize_( - rmap_measures_BatteryCharge_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B25192.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B25192_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_BatteryCharge_1_0_initialize_(rmap_measures_BatteryCharge_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_BatteryCharge_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_BATTERY_CHARGE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/BatteryCurrent_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/BatteryCurrent_1_0.h deleted file mode 100644 index 3fc6e9a6e..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/BatteryCurrent_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.524217 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.BatteryCurrent -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_BATTERY_CURRENT_1_0_INCLUDED_ -#define RMAP_MEASURES_BATTERY_CURRENT_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/BatteryCurrent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_BatteryCurrent_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_BatteryCurrent_1_0_FULL_NAME_ "rmap.measures.BatteryCurrent" -#define rmap_measures_BatteryCurrent_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.BatteryCurrent.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_BatteryCurrent_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_BatteryCurrent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_BatteryCurrent_1_0_EXTENT_BYTES_ >= rmap_measures_BatteryCurrent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B25193.1.0 val - rmap_tableb_B25193_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_BatteryCurrent_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_BatteryCurrent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_BatteryCurrent_1_0_serialize_( - const rmap_measures_BatteryCurrent_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B25193.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B25193_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_BatteryCurrent_1_0_deserialize_( - rmap_measures_BatteryCurrent_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B25193.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B25193_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_BatteryCurrent_1_0_initialize_(rmap_measures_BatteryCurrent_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_BatteryCurrent_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_BATTERY_CURRENT_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/Humidity_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/Humidity_1_0.h deleted file mode 100644 index 93b527219..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/Humidity_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.524217 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.Humidity -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_HUMIDITY_1_0_INCLUDED_ -#define RMAP_MEASURES_HUMIDITY_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Humidity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_Humidity_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_Humidity_1_0_FULL_NAME_ "rmap.measures.Humidity" -#define rmap_measures_Humidity_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.Humidity.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_Humidity_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_Humidity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_Humidity_1_0_EXTENT_BYTES_ >= rmap_measures_Humidity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B13003.1.0 val - rmap_tableb_B13003_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_Humidity_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_Humidity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Humidity_1_0_serialize_( - const rmap_measures_Humidity_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B13003.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B13003_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Humidity_1_0_deserialize_( - rmap_measures_Humidity_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B13003.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B13003_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_Humidity_1_0_initialize_(rmap_measures_Humidity_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_Humidity_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_HUMIDITY_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/InputVoltage_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/InputVoltage_1_0.h deleted file mode 100644 index 676e5c8e2..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/InputVoltage_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.539832 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.InputVoltage -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_INPUT_VOLTAGE_1_0_INCLUDED_ -#define RMAP_MEASURES_INPUT_VOLTAGE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/InputVoltage.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_InputVoltage_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_InputVoltage_1_0_FULL_NAME_ "rmap.measures.InputVoltage" -#define rmap_measures_InputVoltage_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.InputVoltage.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_InputVoltage_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_InputVoltage_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_InputVoltage_1_0_EXTENT_BYTES_ >= rmap_measures_InputVoltage_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B25194.1.0 val - rmap_tableb_B25194_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_InputVoltage_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_InputVoltage_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_InputVoltage_1_0_serialize_( - const rmap_measures_InputVoltage_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B25194.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B25194_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_InputVoltage_1_0_deserialize_( - rmap_measures_InputVoltage_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B25194.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B25194_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_InputVoltage_1_0_initialize_(rmap_measures_InputVoltage_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_InputVoltage_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_INPUT_VOLTAGE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/Radiation_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/Radiation_1_0.h deleted file mode 100644 index c0a44e2c4..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/Radiation_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.539832 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.Radiation -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_RADIATION_1_0_INCLUDED_ -#define RMAP_MEASURES_RADIATION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_Radiation_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_Radiation_1_0_FULL_NAME_ "rmap.measures.Radiation" -#define rmap_measures_Radiation_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.Radiation.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_Radiation_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_Radiation_1_0_EXTENT_BYTES_ >= rmap_measures_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B14198.1.0 val - rmap_tableb_B14198_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_Radiation_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Radiation_1_0_serialize_( - const rmap_measures_Radiation_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B14198.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B14198_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Radiation_1_0_deserialize_( - rmap_measures_Radiation_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B14198.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B14198_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_Radiation_1_0_initialize_(rmap_measures_Radiation_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_Radiation_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_RADIATION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/RainLongRate_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/RainLongRate_1_0.h deleted file mode 100644 index 842a83fda..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/RainLongRate_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.539832 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.RainLongRate -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_RAIN_LONG_RATE_1_0_INCLUDED_ -#define RMAP_MEASURES_RAIN_LONG_RATE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainLongRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_RainLongRate_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_RainLongRate_1_0_FULL_NAME_ "rmap.measures.RainLongRate" -#define rmap_measures_RainLongRate_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.RainLongRate.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_RainLongRate_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_RainLongRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_RainLongRate_1_0_EXTENT_BYTES_ >= rmap_measures_RainLongRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B13209.1.0 val - rmap_tableb_B13209_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_RainLongRate_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_RainLongRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_RainLongRate_1_0_serialize_( - const rmap_measures_RainLongRate_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B13209.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B13209_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_RainLongRate_1_0_deserialize_( - rmap_measures_RainLongRate_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B13209.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B13209_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_RainLongRate_1_0_initialize_(rmap_measures_RainLongRate_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_RainLongRate_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_RAIN_LONG_RATE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/RainShortRate_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/RainShortRate_1_0.h deleted file mode 100644 index f9bff3370..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/RainShortRate_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.555458 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.RainShortRate -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_RAIN_SHORT_RATE_1_0_INCLUDED_ -#define RMAP_MEASURES_RAIN_SHORT_RATE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/RainShortRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_RainShortRate_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_RainShortRate_1_0_FULL_NAME_ "rmap.measures.RainShortRate" -#define rmap_measures_RainShortRate_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.RainShortRate.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_RainShortRate_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_RainShortRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_RainShortRate_1_0_EXTENT_BYTES_ >= rmap_measures_RainShortRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B13208.1.0 val - rmap_tableb_B13208_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_RainShortRate_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_RainShortRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_RainShortRate_1_0_serialize_( - const rmap_measures_RainShortRate_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B13208.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B13208_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_RainShortRate_1_0_deserialize_( - rmap_measures_RainShortRate_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B13208.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B13208_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_RainShortRate_1_0_initialize_(rmap_measures_RainShortRate_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_RainShortRate_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_RAIN_SHORT_RATE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/Rain_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/Rain_1_0.h deleted file mode 100644 index db5ae7d1c..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/Rain_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.539832 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.Rain -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_RAIN_1_0_INCLUDED_ -#define RMAP_MEASURES_RAIN_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_Rain_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_Rain_1_0_FULL_NAME_ "rmap.measures.Rain" -#define rmap_measures_Rain_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.Rain.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_Rain_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_Rain_1_0_EXTENT_BYTES_ >= rmap_measures_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B13011.1.0 val - rmap_tableb_B13011_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_Rain_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Rain_1_0_serialize_( - const rmap_measures_Rain_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B13011.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B13011_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Rain_1_0_deserialize_( - rmap_measures_Rain_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B13011.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B13011_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_Rain_1_0_initialize_(rmap_measures_Rain_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_Rain_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_RAIN_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/Temperature_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/Temperature_1_0.h deleted file mode 100644 index 1b5c65fa7..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/Temperature_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.555458 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.Temperature -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_TEMPERATURE_1_0_INCLUDED_ -#define RMAP_MEASURES_TEMPERATURE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/Temperature.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_Temperature_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_Temperature_1_0_FULL_NAME_ "rmap.measures.Temperature" -#define rmap_measures_Temperature_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.Temperature.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_Temperature_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_Temperature_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_Temperature_1_0_EXTENT_BYTES_ >= rmap_measures_Temperature_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B12101.1.0 val - rmap_tableb_B12101_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_Temperature_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_Temperature_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Temperature_1_0_serialize_( - const rmap_measures_Temperature_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B12101.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B12101_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_Temperature_1_0_deserialize_( - rmap_measures_Temperature_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B12101.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B12101_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_Temperature_1_0_initialize_(rmap_measures_Temperature_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_Temperature_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_TEMPERATURE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/VolumetricWaterContent_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/VolumetricWaterContent_1_0.h deleted file mode 100644 index a251ad20e..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/VolumetricWaterContent_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.555458 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.VolumetricWaterContent -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_VOLUMETRIC_WATER_CONTENT_1_0_INCLUDED_ -#define RMAP_MEASURES_VOLUMETRIC_WATER_CONTENT_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/VolumetricWaterContent.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_VolumetricWaterContent_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_VolumetricWaterContent_1_0_FULL_NAME_ "rmap.measures.VolumetricWaterContent" -#define rmap_measures_VolumetricWaterContent_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.VolumetricWaterContent.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_VolumetricWaterContent_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_VolumetricWaterContent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_VolumetricWaterContent_1_0_EXTENT_BYTES_ >= rmap_measures_VolumetricWaterContent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B13227.1.0 val - rmap_tableb_B13227_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_VolumetricWaterContent_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_VolumetricWaterContent_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_VolumetricWaterContent_1_0_serialize_( - const rmap_measures_VolumetricWaterContent_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B13227.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B13227_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_VolumetricWaterContent_1_0_deserialize_( - rmap_measures_VolumetricWaterContent_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B13227.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B13227_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_VolumetricWaterContent_1_0_initialize_(rmap_measures_VolumetricWaterContent_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_VolumetricWaterContent_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_VOLUMETRIC_WATER_CONTENT_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass1Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass1Speed_1_0.h deleted file mode 100644 index ba597736c..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass1Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.571091 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass1Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS1SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS1SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass1Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass1Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass1Speed_1_0_FULL_NAME_ "rmap.measures.WindClass1Speed" -#define rmap_measures_WindClass1Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass1Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass1Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass1Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass1Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass1Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11211.1.0 val - rmap_tableb_B11211_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass1Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass1Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass1Speed_1_0_serialize_( - const rmap_measures_WindClass1Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11211.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11211_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass1Speed_1_0_deserialize_( - rmap_measures_WindClass1Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11211.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11211_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass1Speed_1_0_initialize_(rmap_measures_WindClass1Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass1Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS1SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass2Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass2Speed_1_0.h deleted file mode 100644 index 1246d9744..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass2Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.571091 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass2Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS2SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS2SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass2Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass2Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass2Speed_1_0_FULL_NAME_ "rmap.measures.WindClass2Speed" -#define rmap_measures_WindClass2Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass2Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass2Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass2Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass2Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass2Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11212.1.0 val - rmap_tableb_B11212_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass2Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass2Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass2Speed_1_0_serialize_( - const rmap_measures_WindClass2Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11212.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11212_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass2Speed_1_0_deserialize_( - rmap_measures_WindClass2Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11212.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11212_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass2Speed_1_0_initialize_(rmap_measures_WindClass2Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass2Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS2SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass3Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass3Speed_1_0.h deleted file mode 100644 index 31e4648bb..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass3Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.571091 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass3Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS3SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS3SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass3Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass3Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass3Speed_1_0_FULL_NAME_ "rmap.measures.WindClass3Speed" -#define rmap_measures_WindClass3Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass3Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass3Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass3Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass3Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass3Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11213.1.0 val - rmap_tableb_B11213_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass3Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass3Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass3Speed_1_0_serialize_( - const rmap_measures_WindClass3Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11213.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11213_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass3Speed_1_0_deserialize_( - rmap_measures_WindClass3Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11213.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11213_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass3Speed_1_0_initialize_(rmap_measures_WindClass3Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass3Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS3SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass4Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass4Speed_1_0.h deleted file mode 100644 index cf83165c3..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass4Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.571091 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass4Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS4SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS4SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass4Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass4Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass4Speed_1_0_FULL_NAME_ "rmap.measures.WindClass4Speed" -#define rmap_measures_WindClass4Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass4Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass4Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass4Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass4Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass4Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11214.1.0 val - rmap_tableb_B11214_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass4Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass4Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass4Speed_1_0_serialize_( - const rmap_measures_WindClass4Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11214.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11214_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass4Speed_1_0_deserialize_( - rmap_measures_WindClass4Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11214.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11214_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass4Speed_1_0_initialize_(rmap_measures_WindClass4Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass4Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS4SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass5Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass5Speed_1_0.h deleted file mode 100644 index 07ffbba67..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass5Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.586703 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass5Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS5SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS5SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass5Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass5Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass5Speed_1_0_FULL_NAME_ "rmap.measures.WindClass5Speed" -#define rmap_measures_WindClass5Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass5Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass5Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass5Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass5Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass5Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11215.1.0 val - rmap_tableb_B11215_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass5Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass5Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass5Speed_1_0_serialize_( - const rmap_measures_WindClass5Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11215.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11215_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass5Speed_1_0_deserialize_( - rmap_measures_WindClass5Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11215.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11215_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass5Speed_1_0_initialize_(rmap_measures_WindClass5Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass5Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS5SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindClass6Speed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindClass6Speed_1_0.h deleted file mode 100644 index f61d48645..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindClass6Speed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.586703 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindClass6Speed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_CLASS6SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_CLASS6SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindClass6Speed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindClass6Speed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindClass6Speed_1_0_FULL_NAME_ "rmap.measures.WindClass6Speed" -#define rmap_measures_WindClass6Speed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindClass6Speed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindClass6Speed_1_0_EXTENT_BYTES_ 2UL -#define rmap_measures_WindClass6Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_measures_WindClass6Speed_1_0_EXTENT_BYTES_ >= rmap_measures_WindClass6Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11216.1.0 val - rmap_tableb_B11216_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindClass6Speed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindClass6Speed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass6Speed_1_0_serialize_( - const rmap_measures_WindClass6Speed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11216.1.0 val - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11216_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindClass6Speed_1_0_deserialize_( - rmap_measures_WindClass6Speed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11216.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11216_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindClass6Speed_1_0_initialize_(rmap_measures_WindClass6Speed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindClass6Speed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_CLASS6SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindDirection_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindDirection_1_0.h deleted file mode 100644 index e7fd6e5be..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindDirection_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.586703 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindDirection -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_DIRECTION_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_DIRECTION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindDirection_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindDirection_1_0_FULL_NAME_ "rmap.measures.WindDirection" -#define rmap_measures_WindDirection_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindDirection.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindDirection_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindDirection_1_0_EXTENT_BYTES_ >= rmap_measures_WindDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11001.1.0 val - rmap_tableb_B11001_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindDirection_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindDirection_1_0_serialize_( - const rmap_measures_WindDirection_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11001.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11001_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindDirection_1_0_deserialize_( - rmap_measures_WindDirection_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11001.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11001_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindDirection_1_0_initialize_(rmap_measures_WindDirection_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindDirection_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_DIRECTION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustDirection_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustDirection_1_0.h deleted file mode 100644 index c5097eac5..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustDirection_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.602429 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindLongGustDirection -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_LONG_GUST_DIRECTION_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_LONG_GUST_DIRECTION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindLongGustDirection_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindLongGustDirection_1_0_FULL_NAME_ "rmap.measures.WindLongGustDirection" -#define rmap_measures_WindLongGustDirection_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindLongGustDirection.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindLongGustDirection_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindLongGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindLongGustDirection_1_0_EXTENT_BYTES_ >= rmap_measures_WindLongGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11210.1.0 val - rmap_tableb_B11210_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindLongGustDirection_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindLongGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindLongGustDirection_1_0_serialize_( - const rmap_measures_WindLongGustDirection_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11210.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11210_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindLongGustDirection_1_0_deserialize_( - rmap_measures_WindLongGustDirection_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11210.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11210_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindLongGustDirection_1_0_initialize_(rmap_measures_WindLongGustDirection_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindLongGustDirection_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_LONG_GUST_DIRECTION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustSpeed_1_0.h deleted file mode 100644 index ffeef379a..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindLongGustSpeed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.602429 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindLongGustSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_LONG_GUST_SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_LONG_GUST_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindLongGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindLongGustSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindLongGustSpeed_1_0_FULL_NAME_ "rmap.measures.WindLongGustSpeed" -#define rmap_measures_WindLongGustSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindLongGustSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindLongGustSpeed_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindLongGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindLongGustSpeed_1_0_EXTENT_BYTES_ >= rmap_measures_WindLongGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11209.1.0 val - rmap_tableb_B11209_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindLongGustSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindLongGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindLongGustSpeed_1_0_serialize_( - const rmap_measures_WindLongGustSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11209.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11209_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindLongGustSpeed_1_0_deserialize_( - rmap_measures_WindLongGustSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11209.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11209_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindLongGustSpeed_1_0_initialize_(rmap_measures_WindLongGustSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindLongGustSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_LONG_GUST_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustDirection_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustDirection_1_0.h deleted file mode 100644 index 3db0de5e9..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustDirection_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.602429 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindPeakGustDirection -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_PEAK_GUST_DIRECTION_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_PEAK_GUST_DIRECTION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindPeakGustDirection_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindPeakGustDirection_1_0_FULL_NAME_ "rmap.measures.WindPeakGustDirection" -#define rmap_measures_WindPeakGustDirection_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindPeakGustDirection.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindPeakGustDirection_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindPeakGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindPeakGustDirection_1_0_EXTENT_BYTES_ >= rmap_measures_WindPeakGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11043.1.0 val - rmap_tableb_B11043_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindPeakGustDirection_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindPeakGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindPeakGustDirection_1_0_serialize_( - const rmap_measures_WindPeakGustDirection_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11043.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11043_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindPeakGustDirection_1_0_deserialize_( - rmap_measures_WindPeakGustDirection_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11043.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11043_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindPeakGustDirection_1_0_initialize_(rmap_measures_WindPeakGustDirection_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindPeakGustDirection_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_PEAK_GUST_DIRECTION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustSpeed_1_0.h deleted file mode 100644 index 41eefd272..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindPeakGustSpeed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.602429 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindPeakGustSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_PEAK_GUST_SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_PEAK_GUST_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindPeakGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindPeakGustSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindPeakGustSpeed_1_0_FULL_NAME_ "rmap.measures.WindPeakGustSpeed" -#define rmap_measures_WindPeakGustSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindPeakGustSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindPeakGustSpeed_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindPeakGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindPeakGustSpeed_1_0_EXTENT_BYTES_ >= rmap_measures_WindPeakGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11041.1.0 val - rmap_tableb_B11041_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindPeakGustSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindPeakGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindPeakGustSpeed_1_0_serialize_( - const rmap_measures_WindPeakGustSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11041.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11041_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindPeakGustSpeed_1_0_deserialize_( - rmap_measures_WindPeakGustSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11041.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11041_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindPeakGustSpeed_1_0_initialize_(rmap_measures_WindPeakGustSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindPeakGustSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_PEAK_GUST_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/measures/WindSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/measures/WindSpeed_1_0.h deleted file mode 100644 index 178b9e3af..000000000 --- a/platformio/stima_v4/libraries/include/rmap/measures/WindSpeed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.617955 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.measures.WindSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_MEASURES_WIND_SPEED_1_0_INCLUDED_ -#define RMAP_MEASURES_WIND_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/measures/WindSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_measures_WindSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_measures_WindSpeed_1_0_FULL_NAME_ "rmap.measures.WindSpeed" -#define rmap_measures_WindSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.measures.WindSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_measures_WindSpeed_1_0_EXTENT_BYTES_ 3UL -#define rmap_measures_WindSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(rmap_measures_WindSpeed_1_0_EXTENT_BYTES_ >= rmap_measures_WindSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.tableb.B11002.1.0 val - rmap_tableb_B11002_1_0 val; - - /// rmap.tableb.B33199.1.0 confidence - rmap_tableb_B33199_1_0 confidence; -} rmap_measures_WindSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_measures_WindSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindSpeed_1_0_serialize_( - const rmap_measures_WindSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.tableb.B11002.1.0 val - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_tableb_B11002_1_0_serialize_( - &obj->val, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.tableb.B33199.1.0 confidence - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_tableb_B33199_1_0_serialize_( - &obj->confidence, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_measures_WindSpeed_1_0_deserialize_( - rmap_measures_WindSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.tableb.B11002.1.0 val - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_tableb_B11002_1_0_deserialize_( - &out_obj->val, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.tableb.B33199.1.0 confidence - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_tableb_B33199_1_0_deserialize_( - &out_obj->confidence, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_measures_WindSpeed_1_0_initialize_(rmap_measures_WindSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_measures_WindSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_MEASURES_WIND_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/metadata/Level_1_0.h b/platformio/stima_v4/libraries/include/rmap/metadata/Level_1_0.h deleted file mode 100644 index b9663bc8d..000000000 --- a/platformio/stima_v4/libraries/include/rmap/metadata/Level_1_0.h +++ /dev/null @@ -1,365 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.617955 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.metadata.Level -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_METADATA_LEVEL_1_0_INCLUDED_ -#define RMAP_METADATA_LEVEL_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Level.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_metadata_Level_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_metadata_Level_1_0_FULL_NAME_ "rmap.metadata.Level" -#define rmap_metadata_Level_1_0_FULL_NAME_AND_VERSION_ "rmap.metadata.Level.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_metadata_Level_1_0_EXTENT_BYTES_ 8UL -#define rmap_metadata_Level_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(rmap_metadata_Level_1_0_EXTENT_BYTES_ >= rmap_metadata_Level_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.primitive.scalar.Natural16.1.0 LevelType1 - uavcan_primitive_scalar_Natural16_1_0 LevelType1; - - /// uavcan.primitive.scalar.Natural16.1.0 L1 - uavcan_primitive_scalar_Natural16_1_0 L1; - - /// uavcan.primitive.scalar.Natural16.1.0 LevelType2 - uavcan_primitive_scalar_Natural16_1_0 LevelType2; - - /// uavcan.primitive.scalar.Natural16.1.0 L2 - uavcan_primitive_scalar_Natural16_1_0 L2; -} rmap_metadata_Level_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_metadata_Level_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Level_1_0_serialize_( - const rmap_metadata_Level_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.primitive.scalar.Natural16.1.0 LevelType1 - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_primitive_scalar_Natural16_1_0_serialize_( - &obj->LevelType1, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.primitive.scalar.Natural16.1.0 L1 - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_primitive_scalar_Natural16_1_0_serialize_( - &obj->L1, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.primitive.scalar.Natural16.1.0 LevelType2 - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_primitive_scalar_Natural16_1_0_serialize_( - &obj->LevelType2, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // uavcan.primitive.scalar.Natural16.1.0 L2 - size_t _size_bytes3_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err6_ = uavcan_primitive_scalar_Natural16_1_0_serialize_( - &obj->L2, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Level_1_0_deserialize_( - rmap_metadata_Level_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.primitive.scalar.Natural16.1.0 LevelType1 - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_primitive_scalar_Natural16_1_0_deserialize_( - &out_obj->LevelType1, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.scalar.Natural16.1.0 L1 - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err9_ = uavcan_primitive_scalar_Natural16_1_0_deserialize_( - &out_obj->L1, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.scalar.Natural16.1.0 LevelType2 - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = uavcan_primitive_scalar_Natural16_1_0_deserialize_( - &out_obj->LevelType2, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.scalar.Natural16.1.0 L2 - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err11_ = uavcan_primitive_scalar_Natural16_1_0_deserialize_( - &out_obj->L2, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_metadata_Level_1_0_initialize_(rmap_metadata_Level_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_metadata_Level_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_METADATA_LEVEL_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/metadata/Metadata_1_0.h b/platformio/stima_v4/libraries/include/rmap/metadata/Metadata_1_0.h deleted file mode 100644 index 3977d46dc..000000000 --- a/platformio/stima_v4/libraries/include/rmap/metadata/Metadata_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.617955 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.metadata.Metadata -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_METADATA_METADATA_1_0_INCLUDED_ -#define RMAP_METADATA_METADATA_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Metadata.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_metadata_Metadata_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_metadata_Metadata_1_0_FULL_NAME_ "rmap.metadata.Metadata" -#define rmap_metadata_Metadata_1_0_FULL_NAME_AND_VERSION_ "rmap.metadata.Metadata.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_metadata_Metadata_1_0_EXTENT_BYTES_ 13UL -#define rmap_metadata_Metadata_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 13UL -static_assert(rmap_metadata_Metadata_1_0_EXTENT_BYTES_ >= rmap_metadata_Metadata_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Timerange.1.0 timerange - rmap_metadata_Timerange_1_0 timerange; - - /// rmap.metadata.Level.1.0 level - rmap_metadata_Level_1_0 level; -} rmap_metadata_Metadata_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_metadata_Metadata_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Metadata_1_0_serialize_( - const rmap_metadata_Metadata_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 104UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Timerange.1.0 timerange - size_t _size_bytes0_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Timerange_1_0_serialize_( - &obj->timerange, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.metadata.Level.1.0 level - size_t _size_bytes1_ = 8UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_metadata_Level_1_0_serialize_( - &obj->level, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Metadata_1_0_deserialize_( - rmap_metadata_Metadata_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Timerange.1.0 timerange - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_metadata_Timerange_1_0_deserialize_( - &out_obj->timerange, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.metadata.Level.1.0 level - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_metadata_Level_1_0_deserialize_( - &out_obj->level, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_metadata_Metadata_1_0_initialize_(rmap_metadata_Metadata_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_metadata_Metadata_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_METADATA_METADATA_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/metadata/Timerange_1_0.h b/platformio/stima_v4/libraries/include/rmap/metadata/Timerange_1_0.h deleted file mode 100644 index 7c06808d3..000000000 --- a/platformio/stima_v4/libraries/include/rmap/metadata/Timerange_1_0.h +++ /dev/null @@ -1,302 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.634031 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.metadata.Timerange -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_METADATA_TIMERANGE_1_0_INCLUDED_ -#define RMAP_METADATA_TIMERANGE_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/metadata/Timerange.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_metadata_Timerange_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_metadata_Timerange_1_0_FULL_NAME_ "rmap.metadata.Timerange" -#define rmap_metadata_Timerange_1_0_FULL_NAME_AND_VERSION_ "rmap.metadata.Timerange.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_metadata_Timerange_1_0_EXTENT_BYTES_ 5UL -#define rmap_metadata_Timerange_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 5UL -static_assert(rmap_metadata_Timerange_1_0_EXTENT_BYTES_ >= rmap_metadata_Timerange_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.primitive.scalar.Natural8.1.0 Pindicator - uavcan_primitive_scalar_Natural8_1_0 Pindicator; - - /// uavcan.primitive.scalar.Natural16.1.0 P1 - uavcan_primitive_scalar_Natural16_1_0 P1; - - /// saturated uint16 P2 - uint16_t P2; -} rmap_metadata_Timerange_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_metadata_Timerange_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Timerange_1_0_serialize_( - const rmap_metadata_Timerange_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 40UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.primitive.scalar.Natural8.1.0 Pindicator - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_primitive_scalar_Natural8_1_0_serialize_( - &obj->Pindicator, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.primitive.scalar.Natural16.1.0 P1 - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_primitive_scalar_Natural16_1_0_serialize_( - &obj->P1, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint16 P2 - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->P2, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_metadata_Timerange_1_0_deserialize_( - rmap_metadata_Timerange_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.primitive.scalar.Natural8.1.0 Pindicator - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_primitive_scalar_Natural8_1_0_deserialize_( - &out_obj->Pindicator, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.scalar.Natural16.1.0 P1 - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_primitive_scalar_Natural16_1_0_deserialize_( - &out_obj->P1, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint16 P2 - out_obj->P2 = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_metadata_Timerange_1_0_initialize_(rmap_metadata_Timerange_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_metadata_Timerange_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_METADATA_TIMERANGE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/Power_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/Power_1_0.h deleted file mode 100644 index 85218c5f9..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/Power_1_0.h +++ /dev/null @@ -1,368 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.461588 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.Power -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_POWER_1_0_INCLUDED_ -#define RMAP_SENSORS_POWER_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_Power_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_Power_1_0_FULL_NAME_ "rmap.sensors.Power" -#define rmap_sensors_Power_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.Power.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_Power_1_0_EXTENT_BYTES_ 21UL -#define rmap_sensors_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 21UL -static_assert(rmap_sensors_Power_1_0_EXTENT_BYTES_ >= rmap_sensors_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.BatteryCharge.1.0 battery_charge - rmap_measures_BatteryCharge_1_0 battery_charge; - - /// rmap.measures.BatteryCurrent.1.0 battery_current - rmap_measures_BatteryCurrent_1_0 battery_current; - - /// rmap.measures.InputVoltage.1.0 input_voltage - rmap_measures_InputVoltage_1_0 input_voltage; -} rmap_sensors_Power_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_Power_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Power_1_0_serialize_( - const rmap_sensors_Power_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 168UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.BatteryCharge.1.0 battery_charge - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_BatteryCharge_1_0_serialize_( - &obj->battery_charge, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.BatteryCurrent.1.0 battery_current - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_BatteryCurrent_1_0_serialize_( - &obj->battery_current, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // rmap.measures.InputVoltage.1.0 input_voltage - size_t _size_bytes3_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err6_ = rmap_measures_InputVoltage_1_0_serialize_( - &obj->input_voltage, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Power_1_0_deserialize_( - rmap_sensors_Power_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.BatteryCharge.1.0 battery_charge - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err9_ = rmap_measures_BatteryCharge_1_0_deserialize_( - &out_obj->battery_charge, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.BatteryCurrent.1.0 battery_current - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = rmap_measures_BatteryCurrent_1_0_deserialize_( - &out_obj->battery_current, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.InputVoltage.1.0 input_voltage - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err11_ = rmap_measures_InputVoltage_1_0_deserialize_( - &out_obj->input_voltage, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_Power_1_0_initialize_(rmap_sensors_Power_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_Power_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_POWER_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/Radiation_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/Radiation_1_0.h deleted file mode 100644 index af0b53446..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/Radiation_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.461588 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.Radiation -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_RADIATION_1_0_INCLUDED_ -#define RMAP_SENSORS_RADIATION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_Radiation_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_Radiation_1_0_FULL_NAME_ "rmap.sensors.Radiation" -#define rmap_sensors_Radiation_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.Radiation.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_Radiation_1_0_EXTENT_BYTES_ 16UL -#define rmap_sensors_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_sensors_Radiation_1_0_EXTENT_BYTES_ >= rmap_sensors_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.Radiation.1.0 radiation - rmap_measures_Radiation_1_0 radiation; -} rmap_sensors_Radiation_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_Radiation_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Radiation_1_0_serialize_( - const rmap_sensors_Radiation_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.Radiation.1.0 radiation - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_Radiation_1_0_serialize_( - &obj->radiation, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Radiation_1_0_deserialize_( - rmap_sensors_Radiation_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.Radiation.1.0 radiation - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_measures_Radiation_1_0_deserialize_( - &out_obj->radiation, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_Radiation_1_0_initialize_(rmap_sensors_Radiation_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_Radiation_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_RADIATION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/RainRate_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/RainRate_1_0.h deleted file mode 100644 index c5cdc524b..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/RainRate_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.477012 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.RainRate -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_RAIN_RATE_1_0_INCLUDED_ -#define RMAP_SENSORS_RAIN_RATE_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/RainRate.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_RainRate_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_RainRate_1_0_FULL_NAME_ "rmap.sensors.RainRate" -#define rmap_sensors_RainRate_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.RainRate.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_RainRate_1_0_EXTENT_BYTES_ 19UL -#define rmap_sensors_RainRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(rmap_sensors_RainRate_1_0_EXTENT_BYTES_ >= rmap_sensors_RainRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.RainShortRate.1.0 shortRate - rmap_measures_RainShortRate_1_0 shortRate; - - /// rmap.measures.RainLongRate.1.0 longRate - rmap_measures_RainLongRate_1_0 longRate; -} rmap_sensors_RainRate_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_RainRate_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_RainRate_1_0_serialize_( - const rmap_sensors_RainRate_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.RainShortRate.1.0 shortRate - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_RainShortRate_1_0_serialize_( - &obj->shortRate, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.RainLongRate.1.0 longRate - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_RainLongRate_1_0_serialize_( - &obj->longRate, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_RainRate_1_0_deserialize_( - rmap_sensors_RainRate_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.RainShortRate.1.0 shortRate - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_RainShortRate_1_0_deserialize_( - &out_obj->shortRate, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.RainLongRate.1.0 longRate - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_RainLongRate_1_0_deserialize_( - &out_obj->longRate, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_RainRate_1_0_initialize_(rmap_sensors_RainRate_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_RainRate_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_RAIN_RATE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/Rain_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/Rain_1_0.h deleted file mode 100644 index f595bfe32..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/Rain_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.461588 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.Rain -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_RAIN_1_0_INCLUDED_ -#define RMAP_SENSORS_RAIN_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_Rain_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_Rain_1_0_FULL_NAME_ "rmap.sensors.Rain" -#define rmap_sensors_Rain_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.Rain.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_Rain_1_0_EXTENT_BYTES_ 16UL -#define rmap_sensors_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_sensors_Rain_1_0_EXTENT_BYTES_ >= rmap_sensors_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.Rain.1.0 rain - rmap_measures_Rain_1_0 rain; -} rmap_sensors_Rain_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_Rain_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Rain_1_0_serialize_( - const rmap_sensors_Rain_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.Rain.1.0 rain - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_Rain_1_0_serialize_( - &obj->rain, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_Rain_1_0_deserialize_( - rmap_sensors_Rain_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.Rain.1.0 rain - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_measures_Rain_1_0_deserialize_( - &out_obj->rain, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_Rain_1_0_initialize_(rmap_sensors_Rain_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_Rain_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_RAIN_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/TH_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/TH_1_0.h deleted file mode 100644 index cf39cae2e..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/TH_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.477012 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.TH -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_TH_1_0_INCLUDED_ -#define RMAP_SENSORS_TH_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_TH_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_TH_1_0_FULL_NAME_ "rmap.sensors.TH" -#define rmap_sensors_TH_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.TH.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_TH_1_0_EXTENT_BYTES_ 18UL -#define rmap_sensors_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 18UL -static_assert(rmap_sensors_TH_1_0_EXTENT_BYTES_ >= rmap_sensors_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.Temperature.1.0 temperature - rmap_measures_Temperature_1_0 temperature; - - /// rmap.measures.Humidity.1.0 humidity - rmap_measures_Humidity_1_0 humidity; -} rmap_sensors_TH_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_TH_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_TH_1_0_serialize_( - const rmap_sensors_TH_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 144UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.Temperature.1.0 temperature - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_Temperature_1_0_serialize_( - &obj->temperature, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.Humidity.1.0 humidity - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_Humidity_1_0_serialize_( - &obj->humidity, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_TH_1_0_deserialize_( - rmap_sensors_TH_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.Temperature.1.0 temperature - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_Temperature_1_0_deserialize_( - &out_obj->temperature, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.Humidity.1.0 humidity - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_Humidity_1_0_deserialize_( - &out_obj->humidity, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_TH_1_0_initialize_(rmap_sensors_TH_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_TH_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_TH_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/VWC_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/VWC_1_0.h deleted file mode 100644 index 132b750f5..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/VWC_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.477012 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.VWC -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_VWC_1_0_INCLUDED_ -#define RMAP_SENSORS_VWC_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_VWC_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_VWC_1_0_FULL_NAME_ "rmap.sensors.VWC" -#define rmap_sensors_VWC_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.VWC.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_VWC_1_0_EXTENT_BYTES_ 16UL -#define rmap_sensors_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_sensors_VWC_1_0_EXTENT_BYTES_ >= rmap_sensors_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.VolumetricWaterContent.1.0 vwc - rmap_measures_VolumetricWaterContent_1_0 vwc; -} rmap_sensors_VWC_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_VWC_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_VWC_1_0_serialize_( - const rmap_sensors_VWC_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.VolumetricWaterContent.1.0 vwc - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_VolumetricWaterContent_1_0_serialize_( - &obj->vwc, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_VWC_1_0_deserialize_( - rmap_sensors_VWC_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.VolumetricWaterContent.1.0 vwc - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_measures_VolumetricWaterContent_1_0_deserialize_( - &out_obj->vwc, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_VWC_1_0_initialize_(rmap_sensors_VWC_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_VWC_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_VWC_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgSpeed_1_0.h deleted file mode 100644 index 8ad56bfe1..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgSpeed_1_0.h +++ /dev/null @@ -1,282 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.492887 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindAvgSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_AVG_SPEED_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_AVG_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindAvgSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindAvgSpeed_1_0_FULL_NAME_ "rmap.sensors.WindAvgSpeed" -#define rmap_sensors_WindAvgSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindAvgSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindAvgSpeed_1_0_EXTENT_BYTES_ 16UL -#define rmap_sensors_WindAvgSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(rmap_sensors_WindAvgSpeed_1_0_EXTENT_BYTES_ >= rmap_sensors_WindAvgSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindSpeed.1.0 speed - rmap_measures_WindSpeed_1_0 speed; -} rmap_sensors_WindAvgSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindAvgSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgSpeed_1_0_serialize_( - const rmap_sensors_WindAvgSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindSpeed.1.0 speed - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindSpeed_1_0_serialize_( - &obj->speed, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgSpeed_1_0_deserialize_( - rmap_sensors_WindAvgSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindSpeed.1.0 speed - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = rmap_measures_WindSpeed_1_0_deserialize_( - &out_obj->speed, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindAvgSpeed_1_0_initialize_(rmap_sensors_WindAvgSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindAvgSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_AVG_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect10_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect10_1_0.h deleted file mode 100644 index 470f4e0d0..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect10_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.492887 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindAvgVect10 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_AVG_VECT10_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_AVG_VECT10_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect10.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindAvgVect10_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindAvgVect10_1_0_FULL_NAME_ "rmap.sensors.WindAvgVect10" -#define rmap_sensors_WindAvgVect10_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindAvgVect10.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindAvgVect10_1_0_EXTENT_BYTES_ 19UL -#define rmap_sensors_WindAvgVect10_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(rmap_sensors_WindAvgVect10_1_0_EXTENT_BYTES_ >= rmap_sensors_WindAvgVect10_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindSpeed.1.0 speed - rmap_measures_WindSpeed_1_0 speed; - - /// rmap.measures.WindDirection.1.0 direction - rmap_measures_WindDirection_1_0 direction; -} rmap_sensors_WindAvgVect10_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindAvgVect10_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgVect10_1_0_serialize_( - const rmap_sensors_WindAvgVect10_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindSpeed.1.0 speed - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindSpeed_1_0_serialize_( - &obj->speed, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.WindDirection.1.0 direction - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_WindDirection_1_0_serialize_( - &obj->direction, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgVect10_1_0_deserialize_( - rmap_sensors_WindAvgVect10_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindSpeed.1.0 speed - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_WindSpeed_1_0_deserialize_( - &out_obj->speed, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindDirection.1.0 direction - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_WindDirection_1_0_deserialize_( - &out_obj->direction, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindAvgVect10_1_0_initialize_(rmap_sensors_WindAvgVect10_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindAvgVect10_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_AVG_VECT10_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect_1_0.h deleted file mode 100644 index 223a78f70..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindAvgVect_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.492887 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindAvgVect -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_AVG_VECT_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_AVG_VECT_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindAvgVect.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindAvgVect_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindAvgVect_1_0_FULL_NAME_ "rmap.sensors.WindAvgVect" -#define rmap_sensors_WindAvgVect_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindAvgVect.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindAvgVect_1_0_EXTENT_BYTES_ 19UL -#define rmap_sensors_WindAvgVect_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(rmap_sensors_WindAvgVect_1_0_EXTENT_BYTES_ >= rmap_sensors_WindAvgVect_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindSpeed.1.0 speed - rmap_measures_WindSpeed_1_0 speed; - - /// rmap.measures.WindDirection.1.0 direction - rmap_measures_WindDirection_1_0 direction; -} rmap_sensors_WindAvgVect_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindAvgVect_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgVect_1_0_serialize_( - const rmap_sensors_WindAvgVect_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindSpeed.1.0 speed - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindSpeed_1_0_serialize_( - &obj->speed, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.WindDirection.1.0 direction - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_WindDirection_1_0_serialize_( - &obj->direction, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindAvgVect_1_0_deserialize_( - rmap_sensors_WindAvgVect_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindSpeed.1.0 speed - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_WindSpeed_1_0_deserialize_( - &out_obj->speed, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindDirection.1.0 direction - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_WindDirection_1_0_deserialize_( - &out_obj->direction, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindAvgVect_1_0_initialize_(rmap_sensors_WindAvgVect_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindAvgVect_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_AVG_VECT_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindClassSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindClassSpeed_1_0.h deleted file mode 100644 index 63302b0da..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindClassSpeed_1_0.h +++ /dev/null @@ -1,497 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.508589 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindClassSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_CLASS_SPEED_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_CLASS_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindClassSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindClassSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindClassSpeed_1_0_FULL_NAME_ "rmap.sensors.WindClassSpeed" -#define rmap_sensors_WindClassSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindClassSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindClassSpeed_1_0_EXTENT_BYTES_ 25UL -#define rmap_sensors_WindClassSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 25UL -static_assert(rmap_sensors_WindClassSpeed_1_0_EXTENT_BYTES_ >= rmap_sensors_WindClassSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindClass1Speed.1.0 class1 - rmap_measures_WindClass1Speed_1_0 class1; - - /// rmap.measures.WindClass2Speed.1.0 class2 - rmap_measures_WindClass2Speed_1_0 class2; - - /// rmap.measures.WindClass3Speed.1.0 class3 - rmap_measures_WindClass3Speed_1_0 class3; - - /// rmap.measures.WindClass4Speed.1.0 class4 - rmap_measures_WindClass4Speed_1_0 class4; - - /// rmap.measures.WindClass5Speed.1.0 class5 - rmap_measures_WindClass5Speed_1_0 class5; - - /// rmap.measures.WindClass6Speed.1.0 class6 - rmap_measures_WindClass6Speed_1_0 class6; -} rmap_sensors_WindClassSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindClassSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindClassSpeed_1_0_serialize_( - const rmap_sensors_WindClassSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 200UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindClass1Speed.1.0 class1 - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindClass1Speed_1_0_serialize_( - &obj->class1, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.WindClass2Speed.1.0 class2 - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_WindClass2Speed_1_0_serialize_( - &obj->class2, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // rmap.measures.WindClass3Speed.1.0 class3 - size_t _size_bytes3_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err6_ = rmap_measures_WindClass3Speed_1_0_serialize_( - &obj->class3, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - - { // rmap.measures.WindClass4Speed.1.0 class4 - size_t _size_bytes4_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_measures_WindClass4Speed_1_0_serialize_( - &obj->class4, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad4_; - } - - { // rmap.measures.WindClass5Speed.1.0 class5 - size_t _size_bytes5_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err10_ = rmap_measures_WindClass5Speed_1_0_serialize_( - &obj->class5, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err10_ < 0) - { - return _err10_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad5_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err11_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad5_); // Optimize? - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _pad5_; - } - - { // rmap.measures.WindClass6Speed.1.0 class6 - size_t _size_bytes6_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err12_ = rmap_measures_WindClass6Speed_1_0_serialize_( - &obj->class6, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err12_ < 0) - { - return _err12_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad6_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err13_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad6_); // Optimize? - if (_err13_ < 0) - { - return _err13_; - } - offset_bits += _pad6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindClassSpeed_1_0_deserialize_( - rmap_sensors_WindClassSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err14_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass1Speed.1.0 class1 - { - size_t _size_bytes8_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err15_ = rmap_measures_WindClass1Speed_1_0_deserialize_( - &out_obj->class1, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err15_ < 0) - { - return _err15_; - } - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass2Speed.1.0 class2 - { - size_t _size_bytes9_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err16_ = rmap_measures_WindClass2Speed_1_0_deserialize_( - &out_obj->class2, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass3Speed.1.0 class3 - { - size_t _size_bytes10_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err17_ = rmap_measures_WindClass3Speed_1_0_deserialize_( - &out_obj->class3, &buffer[offset_bits / 8U], &_size_bytes10_); - if (_err17_ < 0) - { - return _err17_; - } - offset_bits += _size_bytes10_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass4Speed.1.0 class4 - { - size_t _size_bytes11_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err18_ = rmap_measures_WindClass4Speed_1_0_deserialize_( - &out_obj->class4, &buffer[offset_bits / 8U], &_size_bytes11_); - if (_err18_ < 0) - { - return _err18_; - } - offset_bits += _size_bytes11_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass5Speed.1.0 class5 - { - size_t _size_bytes12_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err19_ = rmap_measures_WindClass5Speed_1_0_deserialize_( - &out_obj->class5, &buffer[offset_bits / 8U], &_size_bytes12_); - if (_err19_ < 0) - { - return _err19_; - } - offset_bits += _size_bytes12_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindClass6Speed.1.0 class6 - { - size_t _size_bytes13_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err20_ = rmap_measures_WindClass6Speed_1_0_deserialize_( - &out_obj->class6, &buffer[offset_bits / 8U], &_size_bytes13_); - if (_err20_ < 0) - { - return _err20_; - } - offset_bits += _size_bytes13_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindClassSpeed_1_0_initialize_(rmap_sensors_WindClassSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindClassSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_CLASS_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindGustDirection_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindGustDirection_1_0.h deleted file mode 100644 index b93c3d819..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindGustDirection_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.508589 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindGustDirection -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_GUST_DIRECTION_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_GUST_DIRECTION_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustDirection.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindGustDirection_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindGustDirection_1_0_FULL_NAME_ "rmap.sensors.WindGustDirection" -#define rmap_sensors_WindGustDirection_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindGustDirection.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindGustDirection_1_0_EXTENT_BYTES_ 19UL -#define rmap_sensors_WindGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(rmap_sensors_WindGustDirection_1_0_EXTENT_BYTES_ >= rmap_sensors_WindGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindPeakGustDirection.1.0 peak - rmap_measures_WindPeakGustDirection_1_0 peak; - - /// rmap.measures.WindLongGustDirection.1.0 long - rmap_measures_WindLongGustDirection_1_0 _long; -} rmap_sensors_WindGustDirection_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindGustDirection_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindGustDirection_1_0_serialize_( - const rmap_sensors_WindGustDirection_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindPeakGustDirection.1.0 peak - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindPeakGustDirection_1_0_serialize_( - &obj->peak, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.WindLongGustDirection.1.0 long - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_WindLongGustDirection_1_0_serialize_( - &obj->_long, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindGustDirection_1_0_deserialize_( - rmap_sensors_WindGustDirection_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindPeakGustDirection.1.0 peak - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_WindPeakGustDirection_1_0_deserialize_( - &out_obj->peak, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindLongGustDirection.1.0 long - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_WindLongGustDirection_1_0_deserialize_( - &out_obj->_long, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindGustDirection_1_0_initialize_(rmap_sensors_WindGustDirection_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindGustDirection_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_GUST_DIRECTION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/sensors/WindGustSpeed_1_0.h b/platformio/stima_v4/libraries/include/rmap/sensors/WindGustSpeed_1_0.h deleted file mode 100644 index c2e145118..000000000 --- a/platformio/stima_v4/libraries/include/rmap/sensors/WindGustSpeed_1_0.h +++ /dev/null @@ -1,325 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.508589 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.sensors.WindGustSpeed -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SENSORS_WIND_GUST_SPEED_1_0_INCLUDED_ -#define RMAP_SENSORS_WIND_GUST_SPEED_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/sensors/WindGustSpeed.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_sensors_WindGustSpeed_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_sensors_WindGustSpeed_1_0_FULL_NAME_ "rmap.sensors.WindGustSpeed" -#define rmap_sensors_WindGustSpeed_1_0_FULL_NAME_AND_VERSION_ "rmap.sensors.WindGustSpeed.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_sensors_WindGustSpeed_1_0_EXTENT_BYTES_ 19UL -#define rmap_sensors_WindGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(rmap_sensors_WindGustSpeed_1_0_EXTENT_BYTES_ >= rmap_sensors_WindGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.metadata.Metadata.1.0 metadata - rmap_metadata_Metadata_1_0 metadata; - - /// rmap.measures.WindPeakGustSpeed.1.0 peak - rmap_measures_WindPeakGustSpeed_1_0 peak; - - /// rmap.measures.WindLongGustSpeed.1.0 long - rmap_measures_WindLongGustSpeed_1_0 _long; -} rmap_sensors_WindGustSpeed_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_sensors_WindGustSpeed_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindGustSpeed_1_0_serialize_( - const rmap_sensors_WindGustSpeed_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.metadata.Metadata.1.0 metadata - size_t _size_bytes0_ = 13UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_metadata_Metadata_1_0_serialize_( - &obj->metadata, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // rmap.measures.WindPeakGustSpeed.1.0 peak - size_t _size_bytes1_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err2_ = rmap_measures_WindPeakGustSpeed_1_0_serialize_( - &obj->peak, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // rmap.measures.WindLongGustSpeed.1.0 long - size_t _size_bytes2_ = 3UL; // Nested object (max) size, in bytes. - int8_t _err4_ = rmap_measures_WindLongGustSpeed_1_0_serialize_( - &obj->_long, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_sensors_WindGustSpeed_1_0_deserialize_( - rmap_sensors_WindGustSpeed_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.metadata.Metadata.1.0 metadata - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = rmap_metadata_Metadata_1_0_deserialize_( - &out_obj->metadata, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindPeakGustSpeed.1.0 peak - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = rmap_measures_WindPeakGustSpeed_1_0_deserialize_( - &out_obj->peak, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.measures.WindLongGustSpeed.1.0 long - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_measures_WindLongGustSpeed_1_0_deserialize_( - &out_obj->_long, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_sensors_WindGustSpeed_1_0_initialize_(rmap_sensors_WindGustSpeed_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_sensors_WindGustSpeed_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SENSORS_WIND_GUST_SPEED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/Power_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/Power_1_0.h deleted file mode 100644 index ef8af95ba..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/Power_1_0.h +++ /dev/null @@ -1,681 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.634031 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.Power -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_POWER_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_POWER_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Power.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_Power_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_Power_1_0_FULL_NAME_ "rmap.service.module.Power" -#define rmap_service_module_Power_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Power.1.0" - -#define rmap_service_module_Power_Request_1_0_FULL_NAME_ "rmap.service.module.Power.Request" -#define rmap_service_module_Power_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Power.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Power_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_Power_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_Power_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_Power_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_Power_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Power_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Power_Request_1_0_serialize_( - const rmap_service_module_Power_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Power_Request_1_0_deserialize_( - rmap_service_module_Power_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Power_Request_1_0_initialize_(rmap_service_module_Power_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Power_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_Power_Response_1_0_FULL_NAME_ "rmap.service.module.Power.Response" -#define rmap_service_module_Power_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Power.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Power_Response_1_0_EXTENT_BYTES_ 26UL -#define rmap_service_module_Power_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 26UL -static_assert(rmap_service_module_Power_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_Power_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_ltc_unit_error - bool is_ltc_unit_error; - - /// saturated bool is_power_full - bool is_power_full; - - /// saturated bool is_power_warning - bool is_power_warning; - - /// saturated bool is_power_critical - bool is_power_critical; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.Power.1.0 MPP - rmap_sensors_Power_1_0 MPP; -} rmap_service_module_Power_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Power_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Power_Response_1_0_serialize_( - const rmap_service_module_Power_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 208UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_ltc_unit_error - if (obj->is_ltc_unit_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_power_full - if (obj->is_power_full) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_power_warning - if (obj->is_power_warning) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_power_critical - if (obj->is_power_critical) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->rbt_event); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->wdt_event); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.Power.1.0 MPP - size_t _size_bytes2_ = 21UL; // Nested object (max) size, in bytes. - int8_t _err6_ = rmap_sensors_Power_1_0_serialize_( - &obj->MPP, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Power_Response_1_0_deserialize_( - rmap_service_module_Power_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_ltc_unit_error - if (offset_bits < capacity_bits) - { - out_obj->is_ltc_unit_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_ltc_unit_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_power_full - if (offset_bits < capacity_bits) - { - out_obj->is_power_full = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_power_full = false; - } - offset_bits += 1U; - - - - - // saturated bool is_power_warning - if (offset_bits < capacity_bits) - { - out_obj->is_power_warning = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_power_warning = false; - } - offset_bits += 1U; - - - - - // saturated bool is_power_critical - if (offset_bits < capacity_bits) - { - out_obj->is_power_critical = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_power_critical = false; - } - offset_bits += 1U; - - - - - // saturated uint8 rbt_event - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->rbt_event = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->rbt_event = 0U; - } - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->wdt_event = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->wdt_event = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.Power.1.0 MPP - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = rmap_sensors_Power_1_0_deserialize_( - &out_obj->MPP, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Power_Response_1_0_initialize_(rmap_service_module_Power_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Power_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_POWER_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/Radiation_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/Radiation_1_0.h deleted file mode 100644 index afffef35c..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/Radiation_1_0.h +++ /dev/null @@ -1,611 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.649662 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.Radiation -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_RADIATION_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_RADIATION_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Radiation.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_Radiation_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_Radiation_1_0_FULL_NAME_ "rmap.service.module.Radiation" -#define rmap_service_module_Radiation_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Radiation.1.0" - -#define rmap_service_module_Radiation_Request_1_0_FULL_NAME_ "rmap.service.module.Radiation.Request" -#define rmap_service_module_Radiation_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Radiation.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Radiation_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_Radiation_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_Radiation_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_Radiation_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_Radiation_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Radiation_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Radiation_Request_1_0_serialize_( - const rmap_service_module_Radiation_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Radiation_Request_1_0_deserialize_( - rmap_service_module_Radiation_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Radiation_Request_1_0_initialize_(rmap_service_module_Radiation_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Radiation_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_Radiation_Response_1_0_FULL_NAME_ "rmap.service.module.Radiation.Response" -#define rmap_service_module_Radiation_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Radiation.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Radiation_Response_1_0_EXTENT_BYTES_ 21UL -#define rmap_service_module_Radiation_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 21UL -static_assert(rmap_service_module_Radiation_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_Radiation_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_adc_unit_error - bool is_adc_unit_error; - - /// saturated bool is_adc_unit_overflow - bool is_adc_unit_overflow; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.Radiation.1.0 DSA - rmap_sensors_Radiation_1_0 DSA; -} rmap_service_module_Radiation_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Radiation_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Radiation_Response_1_0_serialize_( - const rmap_service_module_Radiation_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 168UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_adc_unit_error - if (obj->is_adc_unit_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_adc_unit_overflow - if (obj->is_adc_unit_overflow) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->rbt_event, 8U); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->wdt_event, 8U); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.Radiation.1.0 DSA - size_t _size_bytes2_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_sensors_Radiation_1_0_serialize_( - &obj->DSA, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Radiation_Response_1_0_deserialize_( - rmap_service_module_Radiation_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_adc_unit_error - if (offset_bits < capacity_bits) - { - out_obj->is_adc_unit_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_adc_unit_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_adc_unit_overflow - if (offset_bits < capacity_bits) - { - out_obj->is_adc_unit_overflow = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_adc_unit_overflow = false; - } - offset_bits += 1U; - - - - - // saturated uint8 rbt_event - out_obj->rbt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - out_obj->wdt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.Radiation.1.0 DSA - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = rmap_sensors_Radiation_1_0_deserialize_( - &out_obj->DSA, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Radiation_Response_1_0_initialize_(rmap_service_module_Radiation_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Radiation_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_RADIATION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/Rain_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/Rain_1_0.h deleted file mode 100644 index b9062e76d..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/Rain_1_0.h +++ /dev/null @@ -1,775 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.665750 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.Rain -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_RAIN_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_RAIN_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Rain.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_Rain_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_Rain_1_0_FULL_NAME_ "rmap.service.module.Rain" -#define rmap_service_module_Rain_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Rain.1.0" - -#define rmap_service_module_Rain_Request_1_0_FULL_NAME_ "rmap.service.module.Rain.Request" -#define rmap_service_module_Rain_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Rain.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Rain_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_Rain_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_Rain_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_Rain_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_Rain_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Rain_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Rain_Request_1_0_serialize_( - const rmap_service_module_Rain_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Rain_Request_1_0_deserialize_( - rmap_service_module_Rain_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Rain_Request_1_0_initialize_(rmap_service_module_Rain_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Rain_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_Rain_Response_1_0_FULL_NAME_ "rmap.service.module.Rain.Response" -#define rmap_service_module_Rain_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Rain.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Rain_Response_1_0_EXTENT_BYTES_ 41UL -#define rmap_service_module_Rain_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 41UL -static_assert(rmap_service_module_Rain_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_Rain_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_accelerometer_error - bool is_accelerometer_error; - - /// saturated bool is_bubble_level_error - bool is_bubble_level_error; - - /// saturated bool is_clogged_up - bool is_clogged_up; - - /// saturated bool is_main_error - bool is_main_error; - - /// saturated bool is_redundant_error - bool is_redundant_error; - - /// saturated bool is_tipping_error - bool is_tipping_error; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.Rain.1.0 TBR - rmap_sensors_Rain_1_0 TBR; - - /// rmap.sensors.RainRate.1.0 TPR - rmap_sensors_RainRate_1_0 TPR; -} rmap_service_module_Rain_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Rain_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Rain_Response_1_0_serialize_( - const rmap_service_module_Rain_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 328UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_accelerometer_error - if (obj->is_accelerometer_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_bubble_level_error - if (obj->is_bubble_level_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_clogged_up - if (obj->is_clogged_up) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_main_error - if (obj->is_main_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_redundant_error - buffer[offset_bits / 8U] = obj->is_redundant_error ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool is_tipping_error - if (obj->is_tipping_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->rbt_event, 8U); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->wdt_event, 8U); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.Rain.1.0 TBR - size_t _size_bytes2_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_sensors_Rain_1_0_serialize_( - &obj->TBR, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.RainRate.1.0 TPR - size_t _size_bytes3_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err10_ = rmap_sensors_RainRate_1_0_serialize_( - &obj->TPR, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err10_ < 0) - { - return _err10_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err11_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Rain_Response_1_0_deserialize_( - rmap_service_module_Rain_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_accelerometer_error - if (offset_bits < capacity_bits) - { - out_obj->is_accelerometer_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_accelerometer_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_bubble_level_error - if (offset_bits < capacity_bits) - { - out_obj->is_bubble_level_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_bubble_level_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_clogged_up - if (offset_bits < capacity_bits) - { - out_obj->is_clogged_up = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_clogged_up = false; - } - offset_bits += 1U; - - - - - // saturated bool is_main_error - if (offset_bits < capacity_bits) - { - out_obj->is_main_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_main_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_redundant_error - if (offset_bits < capacity_bits) - { - out_obj->is_redundant_error = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->is_redundant_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_tipping_error - if (offset_bits < capacity_bits) - { - out_obj->is_tipping_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_tipping_error = false; - } - offset_bits += 1U; - - - - - // saturated uint8 rbt_event - out_obj->rbt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - out_obj->wdt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.Rain.1.0 TBR - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err12_ = rmap_sensors_Rain_1_0_deserialize_( - &out_obj->TBR, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.RainRate.1.0 TPR - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err13_ = rmap_sensors_RainRate_1_0_deserialize_( - &out_obj->TPR, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err13_ < 0) - { - return _err13_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Rain_Response_1_0_initialize_(rmap_service_module_Rain_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Rain_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_RAIN_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/TH_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/TH_1_0.h deleted file mode 100644 index eaf390b9f..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/TH_1_0.h +++ /dev/null @@ -1,764 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.665750 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.TH -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_TH_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_TH_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/TH.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_TH_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_TH_1_0_FULL_NAME_ "rmap.service.module.TH" -#define rmap_service_module_TH_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.TH.1.0" - -#define rmap_service_module_TH_Request_1_0_FULL_NAME_ "rmap.service.module.TH.Request" -#define rmap_service_module_TH_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.TH.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_TH_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_TH_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_TH_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_TH_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_TH_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_TH_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_TH_Request_1_0_serialize_( - const rmap_service_module_TH_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_TH_Request_1_0_deserialize_( - rmap_service_module_TH_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_TH_Request_1_0_initialize_(rmap_service_module_TH_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_TH_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_TH_Response_1_0_FULL_NAME_ "rmap.service.module.TH.Response" -#define rmap_service_module_TH_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.TH.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_TH_Response_1_0_EXTENT_BYTES_ 78UL -#define rmap_service_module_TH_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 78UL -static_assert(rmap_service_module_TH_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_TH_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_main_error - bool is_main_error; - - /// saturated bool is_redundant_error - bool is_redundant_error; - - /// saturated uint7 perc_i2c_error - uint8_t perc_i2c_error; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.TH.1.0 ITH - rmap_sensors_TH_1_0 ITH; - - /// rmap.sensors.TH.1.0 NTH - rmap_sensors_TH_1_0 NTH; - - /// rmap.sensors.TH.1.0 MTH - rmap_sensors_TH_1_0 MTH; - - /// rmap.sensors.TH.1.0 XTH - rmap_sensors_TH_1_0 XTH; -} rmap_service_module_TH_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_TH_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_TH_Response_1_0_serialize_( - const rmap_service_module_TH_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 624UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_main_error - if (obj->is_main_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_redundant_error - if (obj->is_redundant_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated uint7 perc_i2c_error - uint8_t _sat1_ = obj->perc_i2c_error; - if (_sat1_ > 127U) - { - _sat1_ = 127U; - } - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, _sat1_, 7U); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += 7U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->rbt_event, 8U); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->wdt_event, 8U); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err8_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.TH.1.0 ITH - size_t _size_bytes2_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err9_ = rmap_sensors_TH_1_0_serialize_( - &obj->ITH, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err9_ < 0) - { - return _err9_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err10_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.TH.1.0 NTH - size_t _size_bytes3_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err11_ = rmap_sensors_TH_1_0_serialize_( - &obj->NTH, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err11_ < 0) - { - return _err11_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err12_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _pad3_; - } - - { // rmap.sensors.TH.1.0 MTH - size_t _size_bytes4_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err13_ = rmap_sensors_TH_1_0_serialize_( - &obj->MTH, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err13_ < 0) - { - return _err13_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err14_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _pad4_; - } - - { // rmap.sensors.TH.1.0 XTH - size_t _size_bytes5_ = 18UL; // Nested object (max) size, in bytes. - int8_t _err15_ = rmap_sensors_TH_1_0_serialize_( - &obj->XTH, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err15_ < 0) - { - return _err15_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad5_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err16_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad5_); // Optimize? - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _pad5_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_TH_Response_1_0_deserialize_( - rmap_service_module_TH_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_main_error - if (offset_bits < capacity_bits) - { - out_obj->is_main_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_main_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_redundant_error - if (offset_bits < capacity_bits) - { - out_obj->is_redundant_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_redundant_error = false; - } - offset_bits += 1U; - - - - - // saturated uint7 perc_i2c_error - out_obj->perc_i2c_error = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 7); - offset_bits += 7U; - - - - - // saturated uint8 rbt_event - out_obj->rbt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - out_obj->wdt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 ITH - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err17_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->ITH, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err17_ < 0) - { - return _err17_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 NTH - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err18_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->NTH, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err18_ < 0) - { - return _err18_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 MTH - { - size_t _size_bytes8_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err19_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->MTH, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err19_ < 0) - { - return _err19_; - } - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.TH.1.0 XTH - { - size_t _size_bytes9_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err20_ = rmap_sensors_TH_1_0_deserialize_( - &out_obj->XTH, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err20_ < 0) - { - return _err20_; - } - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_TH_Response_1_0_initialize_(rmap_service_module_TH_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_TH_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_TH_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/VWC_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/VWC_1_0.h deleted file mode 100644 index 61880afec..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/VWC_1_0.h +++ /dev/null @@ -1,695 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.681553 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.VWC -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_VWC_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_VWC_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/VWC.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_VWC_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_VWC_1_0_FULL_NAME_ "rmap.service.module.VWC" -#define rmap_service_module_VWC_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.VWC.1.0" - -#define rmap_service_module_VWC_Request_1_0_FULL_NAME_ "rmap.service.module.VWC.Request" -#define rmap_service_module_VWC_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.VWC.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_VWC_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_VWC_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_VWC_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_VWC_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_VWC_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_VWC_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_VWC_Request_1_0_serialize_( - const rmap_service_module_VWC_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_VWC_Request_1_0_deserialize_( - rmap_service_module_VWC_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_VWC_Request_1_0_initialize_(rmap_service_module_VWC_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_VWC_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_VWC_Response_1_0_FULL_NAME_ "rmap.service.module.VWC.Response" -#define rmap_service_module_VWC_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.VWC.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_VWC_Response_1_0_EXTENT_BYTES_ 53UL -#define rmap_service_module_VWC_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 53UL -static_assert(rmap_service_module_VWC_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_VWC_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_adc_unit_error - bool is_adc_unit_error; - - /// saturated bool is_adc_unit_overflow - bool is_adc_unit_overflow; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.VWC.1.0 VWC1 - rmap_sensors_VWC_1_0 VWC1; - - /// rmap.sensors.VWC.1.0 VWC2 - rmap_sensors_VWC_1_0 VWC2; - - /// rmap.sensors.VWC.1.0 VWC3 - rmap_sensors_VWC_1_0 VWC3; -} rmap_service_module_VWC_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_VWC_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_VWC_Response_1_0_serialize_( - const rmap_service_module_VWC_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 424UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_adc_unit_error - if (obj->is_adc_unit_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_adc_unit_overflow - if (obj->is_adc_unit_overflow) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->rbt_event, 8U); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->wdt_event, 8U); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.VWC.1.0 VWC1 - size_t _size_bytes2_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err8_ = rmap_sensors_VWC_1_0_serialize_( - &obj->VWC1, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.VWC.1.0 VWC2 - size_t _size_bytes3_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err10_ = rmap_sensors_VWC_1_0_serialize_( - &obj->VWC2, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err10_ < 0) - { - return _err10_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err11_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _pad3_; - } - - { // rmap.sensors.VWC.1.0 VWC3 - size_t _size_bytes4_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err12_ = rmap_sensors_VWC_1_0_serialize_( - &obj->VWC3, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err12_ < 0) - { - return _err12_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err13_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err13_ < 0) - { - return _err13_; - } - offset_bits += _pad4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_VWC_Response_1_0_deserialize_( - rmap_service_module_VWC_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_adc_unit_error - if (offset_bits < capacity_bits) - { - out_obj->is_adc_unit_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_adc_unit_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_adc_unit_overflow - if (offset_bits < capacity_bits) - { - out_obj->is_adc_unit_overflow = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_adc_unit_overflow = false; - } - offset_bits += 1U; - - - - - // saturated uint8 rbt_event - out_obj->rbt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - out_obj->wdt_event = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.VWC.1.0 VWC1 - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err14_ = rmap_sensors_VWC_1_0_deserialize_( - &out_obj->VWC1, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.VWC.1.0 VWC2 - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err15_ = rmap_sensors_VWC_1_0_deserialize_( - &out_obj->VWC2, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err15_ < 0) - { - return _err15_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.VWC.1.0 VWC3 - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err16_ = rmap_sensors_VWC_1_0_deserialize_( - &out_obj->VWC3, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_VWC_Response_1_0_initialize_(rmap_service_module_VWC_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_VWC_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_VWC_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/_module/Wind_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/_module/Wind_1_0.h deleted file mode 100644 index f2bbb3264..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/_module/Wind_1_0.h +++ /dev/null @@ -1,948 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.697021 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.module.Wind -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_MODULE_WIND_1_0_INCLUDED_ -#define RMAP_SERVICE_MODULE_WIND_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/module/Wind.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_module_Wind_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_module_Wind_1_0_FULL_NAME_ "rmap.service.module.Wind" -#define rmap_service_module_Wind_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Wind.1.0" - -#define rmap_service_module_Wind_Request_1_0_FULL_NAME_ "rmap.service.module.Wind.Request" -#define rmap_service_module_Wind_Request_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Wind.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Wind_Request_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_module_Wind_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_module_Wind_Request_1_0_EXTENT_BYTES_ >= rmap_service_module_Wind_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// rmap.service.setmode.1.0 parameter - rmap_service_setmode_1_0 parameter; -} rmap_service_module_Wind_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Wind_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Wind_Request_1_0_serialize_( - const rmap_service_module_Wind_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // rmap.service.setmode.1.0 parameter - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = rmap_service_setmode_1_0_serialize_( - &obj->parameter, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Wind_Request_1_0_deserialize_( - rmap_service_module_Wind_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // rmap.service.setmode.1.0 parameter - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = rmap_service_setmode_1_0_deserialize_( - &out_obj->parameter, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Wind_Request_1_0_initialize_(rmap_service_module_Wind_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Wind_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define rmap_service_module_Wind_Response_1_0_FULL_NAME_ "rmap.service.module.Wind.Response" -#define rmap_service_module_Wind_Response_1_0_FULL_NAME_AND_VERSION_ "rmap.service.module.Wind.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_module_Wind_Response_1_0_EXTENT_BYTES_ 123UL -#define rmap_service_module_Wind_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 123UL -static_assert(rmap_service_module_Wind_Response_1_0_EXTENT_BYTES_ >= rmap_service_module_Wind_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint4 state - uint8_t state; - - /// saturated uint8 version - uint8_t version; - - /// saturated uint8 revision - uint8_t revision; - - /// saturated bool is_windsonic_unit_error - bool is_windsonic_unit_error; - - /// saturated bool is_windsonic_hardware_error - bool is_windsonic_hardware_error; - - /// saturated bool is_windsonic_responding_error - bool is_windsonic_responding_error; - - /// saturated bool is_windsonic_axis_error - bool is_windsonic_axis_error; - - /// saturated bool is_windsonic_crc_error - bool is_windsonic_crc_error; - - /// saturated uint7 perc_rs232_error - uint8_t perc_rs232_error; - - /// saturated uint8 rbt_event - uint8_t rbt_event; - - /// saturated uint8 wdt_event - uint8_t wdt_event; - - /// rmap.sensors.WindAvgVect10.1.0 DWA - rmap_sensors_WindAvgVect10_1_0 DWA; - - /// rmap.sensors.WindAvgVect.1.0 DWB - rmap_sensors_WindAvgVect_1_0 DWB; - - /// rmap.sensors.WindGustSpeed.1.0 DWC - rmap_sensors_WindGustSpeed_1_0 DWC; - - /// rmap.sensors.WindAvgSpeed.1.0 DWD - rmap_sensors_WindAvgSpeed_1_0 DWD; - - /// rmap.sensors.WindClassSpeed.1.0 DWE - rmap_sensors_WindClassSpeed_1_0 DWE; - - /// rmap.sensors.WindGustDirection.1.0 DWF - rmap_sensors_WindGustDirection_1_0 DWF; -} rmap_service_module_Wind_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_module_Wind_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Wind_Response_1_0_serialize_( - const rmap_service_module_Wind_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 984UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint4 state - uint8_t _sat0_ = obj->state; - if (_sat0_ > 15U) - { - _sat0_ = 15U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - - - { // saturated uint8 version - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->version, 8U); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += 8U; - } - - - - - { // saturated uint8 revision - // Saturation code not emitted -- native representation matches the serialized representation. - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, obj->revision, 8U); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 8U; - } - - - - - { // saturated bool is_windsonic_unit_error - if (obj->is_windsonic_unit_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_windsonic_hardware_error - if (obj->is_windsonic_hardware_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_windsonic_responding_error - if (obj->is_windsonic_responding_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_windsonic_axis_error - if (obj->is_windsonic_axis_error) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_windsonic_crc_error - buffer[offset_bits / 8U] = obj->is_windsonic_crc_error ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated uint7 perc_rs232_error - uint8_t _sat1_ = obj->perc_rs232_error; - if (_sat1_ > 127U) - { - _sat1_ = 127U; - } - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, _sat1_, 7U); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += 7U; - } - - - - - { // saturated uint8 rbt_event - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->rbt_event); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - - - { // saturated uint8 wdt_event - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->wdt_event); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _pad1_; - } - - { // rmap.sensors.WindAvgVect10.1.0 DWA - size_t _size_bytes2_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err7_ = rmap_sensors_WindAvgVect10_1_0_serialize_( - &obj->DWA, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err7_ < 0) - { - return _err7_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err8_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _pad2_; - } - - { // rmap.sensors.WindAvgVect.1.0 DWB - size_t _size_bytes3_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err9_ = rmap_sensors_WindAvgVect_1_0_serialize_( - &obj->DWB, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err9_ < 0) - { - return _err9_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err10_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _pad3_; - } - - { // rmap.sensors.WindGustSpeed.1.0 DWC - size_t _size_bytes4_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err11_ = rmap_sensors_WindGustSpeed_1_0_serialize_( - &obj->DWC, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err11_ < 0) - { - return _err11_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad4_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err12_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad4_); // Optimize? - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _pad4_; - } - - { // rmap.sensors.WindAvgSpeed.1.0 DWD - size_t _size_bytes5_ = 16UL; // Nested object (max) size, in bytes. - int8_t _err13_ = rmap_sensors_WindAvgSpeed_1_0_serialize_( - &obj->DWD, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err13_ < 0) - { - return _err13_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad5_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err14_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad5_); // Optimize? - if (_err14_ < 0) - { - return _err14_; - } - offset_bits += _pad5_; - } - - { // rmap.sensors.WindClassSpeed.1.0 DWE - size_t _size_bytes6_ = 25UL; // Nested object (max) size, in bytes. - int8_t _err15_ = rmap_sensors_WindClassSpeed_1_0_serialize_( - &obj->DWE, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err15_ < 0) - { - return _err15_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad6_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err16_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad6_); // Optimize? - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _pad6_; - } - - { // rmap.sensors.WindGustDirection.1.0 DWF - size_t _size_bytes7_ = 19UL; // Nested object (max) size, in bytes. - int8_t _err17_ = rmap_sensors_WindGustDirection_1_0_serialize_( - &obj->DWF, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err17_ < 0) - { - return _err17_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad7_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err18_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad7_); // Optimize? - if (_err18_ < 0) - { - return _err18_; - } - offset_bits += _pad7_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_module_Wind_Response_1_0_deserialize_( - rmap_service_module_Wind_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint4 state - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->state = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->state = 0U; - } - offset_bits += 4U; - - - - - // saturated uint8 version - out_obj->version = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated uint8 revision - out_obj->revision = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - - - // saturated bool is_windsonic_unit_error - if (offset_bits < capacity_bits) - { - out_obj->is_windsonic_unit_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_windsonic_unit_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_windsonic_hardware_error - if (offset_bits < capacity_bits) - { - out_obj->is_windsonic_hardware_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_windsonic_hardware_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_windsonic_responding_error - if (offset_bits < capacity_bits) - { - out_obj->is_windsonic_responding_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_windsonic_responding_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_windsonic_axis_error - if (offset_bits < capacity_bits) - { - out_obj->is_windsonic_axis_error = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_windsonic_axis_error = false; - } - offset_bits += 1U; - - - - - // saturated bool is_windsonic_crc_error - if (offset_bits < capacity_bits) - { - out_obj->is_windsonic_crc_error = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->is_windsonic_crc_error = false; - } - offset_bits += 1U; - - - - - // saturated uint7 perc_rs232_error - out_obj->perc_rs232_error = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 7); - offset_bits += 7U; - - - - - // saturated uint8 rbt_event - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->rbt_event = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->rbt_event = 0U; - } - offset_bits += 8U; - - - - - // saturated uint8 wdt_event - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->wdt_event = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->wdt_event = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindAvgVect10.1.0 DWA - { - size_t _size_bytes8_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err19_ = rmap_sensors_WindAvgVect10_1_0_deserialize_( - &out_obj->DWA, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err19_ < 0) - { - return _err19_; - } - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindAvgVect.1.0 DWB - { - size_t _size_bytes9_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err20_ = rmap_sensors_WindAvgVect_1_0_deserialize_( - &out_obj->DWB, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err20_ < 0) - { - return _err20_; - } - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindGustSpeed.1.0 DWC - { - size_t _size_bytes10_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err21_ = rmap_sensors_WindGustSpeed_1_0_deserialize_( - &out_obj->DWC, &buffer[offset_bits / 8U], &_size_bytes10_); - if (_err21_ < 0) - { - return _err21_; - } - offset_bits += _size_bytes10_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindAvgSpeed.1.0 DWD - { - size_t _size_bytes11_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err22_ = rmap_sensors_WindAvgSpeed_1_0_deserialize_( - &out_obj->DWD, &buffer[offset_bits / 8U], &_size_bytes11_); - if (_err22_ < 0) - { - return _err22_; - } - offset_bits += _size_bytes11_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindClassSpeed.1.0 DWE - { - size_t _size_bytes12_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err23_ = rmap_sensors_WindClassSpeed_1_0_deserialize_( - &out_obj->DWE, &buffer[offset_bits / 8U], &_size_bytes12_); - if (_err23_ < 0) - { - return _err23_; - } - offset_bits += _size_bytes12_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // rmap.sensors.WindGustDirection.1.0 DWF - { - size_t _size_bytes13_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err24_ = rmap_sensors_WindGustDirection_1_0_deserialize_( - &out_obj->DWF, &buffer[offset_bits / 8U], &_size_bytes13_); - if (_err24_ < 0) - { - return _err24_; - } - offset_bits += _size_bytes13_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_module_Wind_Response_1_0_initialize_(rmap_service_module_Wind_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_module_Wind_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_MODULE_WIND_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/service/setmode_1_0.h b/platformio/stima_v4/libraries/include/rmap/service/setmode_1_0.h deleted file mode 100644 index d66aa78e9..000000000 --- a/platformio/stima_v4/libraries/include/rmap/service/setmode_1_0.h +++ /dev/null @@ -1,346 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.634031 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.service.setmode -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_SERVICE_SETMODE_1_0_INCLUDED_ -#define RMAP_SERVICE_SETMODE_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/service/setmode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_service_setmode_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_service_setmode_1_0_FULL_NAME_ "rmap.service.setmode" -#define rmap_service_setmode_1_0_FULL_NAME_AND_VERSION_ "rmap.service.setmode.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_service_setmode_1_0_EXTENT_BYTES_ 4UL -#define rmap_service_setmode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(rmap_service_setmode_1_0_EXTENT_BYTES_ >= rmap_service_setmode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint3 get_istant = 0 -#define rmap_service_setmode_1_0_get_istant (0U) -/// saturated uint3 get_current = 1 -#define rmap_service_setmode_1_0_get_current (1U) -/// saturated uint3 get_last = 2 -#define rmap_service_setmode_1_0_get_last (2U) -/// saturated uint3 start_acq = 3 -#define rmap_service_setmode_1_0_start_acq (3U) -/// saturated uint3 stop_acq = 4 -#define rmap_service_setmode_1_0_stop_acq (4U) -/// saturated uint3 loop_acq = 5 -#define rmap_service_setmode_1_0_loop_acq (5U) -/// saturated uint3 continuos_acq = 6 -#define rmap_service_setmode_1_0_continuos_acq (6U) -/// saturated uint3 test_acq = 7 -#define rmap_service_setmode_1_0_test_acq (7U) -/// saturated uint3 CH01 = 0 -#define rmap_service_setmode_1_0_CH01 (0U) -/// saturated uint3 CH02 = 1 -#define rmap_service_setmode_1_0_CH02 (1U) -/// saturated uint3 CH03 = 2 -#define rmap_service_setmode_1_0_CH03 (2U) -/// saturated uint3 CH04 = 3 -#define rmap_service_setmode_1_0_CH04 (3U) -/// saturated uint3 CH05 = 4 -#define rmap_service_setmode_1_0_CH05 (4U) -/// saturated uint3 CH06 = 5 -#define rmap_service_setmode_1_0_CH06 (5U) -/// saturated uint3 CH07 = 6 -#define rmap_service_setmode_1_0_CH07 (6U) -/// saturated uint3 CH08 = 7 -#define rmap_service_setmode_1_0_CH08 (7U) -/// saturated uint10 MAX_OBS = 900 -#define rmap_service_setmode_1_0_MAX_OBS (900U) -/// saturated uint16 MAX_RUN = 43200 -#define rmap_service_setmode_1_0_MAX_RUN (43200U) - -typedef struct -{ - /// saturated uint3 command - uint8_t command; - - /// saturated uint3 chanel - uint8_t chanel; - - /// saturated uint10 obs_sectime - uint16_t obs_sectime; - - /// saturated uint16 run_sectime - uint16_t run_sectime; -} rmap_service_setmode_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_service_setmode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_setmode_1_0_serialize_( - const rmap_service_setmode_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint3 command - uint8_t _sat0_ = obj->command; - if (_sat0_ > 7U) - { - _sat0_ = 7U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 3U; - } - - - - - { // saturated uint3 chanel - uint8_t _sat1_ = obj->chanel; - if (_sat1_ > 7U) - { - _sat1_ = 7U; - } - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, _sat1_, 3U); - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 3U; - } - - - - - { // saturated uint10 obs_sectime - uint16_t _sat2_ = obj->obs_sectime; - if (_sat2_ > 1023U) - { - _sat2_ = 1023U; - } - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, _sat2_, 10U); - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += 10U; - } - - - - - { // saturated uint16 run_sectime - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->run_sectime, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_service_setmode_1_0_deserialize_( - rmap_service_setmode_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint3 command - if ((offset_bits + 3U) <= capacity_bits) - { - out_obj->command = buffer[offset_bits / 8U] & 7U; - } - else - { - out_obj->command = 0U; - } - offset_bits += 3U; - - - - - // saturated uint3 chanel - out_obj->chanel = nunavutGetU8(&buffer[0], capacity_bytes, offset_bits, 3); - offset_bits += 3U; - - - - - // saturated uint10 obs_sectime - out_obj->obs_sectime = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - - - // saturated uint16 run_sectime - out_obj->run_sectime = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_service_setmode_1_0_initialize_(rmap_service_setmode_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_service_setmode_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_SERVICE_SETMODE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11001_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11001_1_0.h deleted file mode 100644 index 50cca8b95..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11001_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.697021 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11001 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11001_1_0_INCLUDED_ -#define RMAP_TABLEB_B11001_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11001.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11001_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11001_1_0_FULL_NAME_ "rmap.tableb.B11001" -#define rmap_tableb_B11001_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11001.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11001_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11001_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11001_1_0_EXTENT_BYTES_ >= rmap_tableb_B11001_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint9 MAX = 360 -#define rmap_tableb_B11001_1_0_MAX (360U) - -typedef struct -{ - /// saturated uint9 value - uint16_t value; -} rmap_tableb_B11001_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11001_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11001_1_0_serialize_( - const rmap_tableb_B11001_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint9 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 511U) - { - _sat0_ = 511U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 9U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11001_1_0_deserialize_( - rmap_tableb_B11001_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint9 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 9); - offset_bits += 9U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11001_1_0_initialize_(rmap_tableb_B11001_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11001_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11001_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11002_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11002_1_0.h deleted file mode 100644 index 2b85614d3..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11002_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.712805 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11002 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11002_1_0_INCLUDED_ -#define RMAP_TABLEB_B11002_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11002.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11002_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11002_1_0_FULL_NAME_ "rmap.tableb.B11002" -#define rmap_tableb_B11002_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11002.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11002_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11002_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11002_1_0_EXTENT_BYTES_ >= rmap_tableb_B11002_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint10 MAX = 1000 -#define rmap_tableb_B11002_1_0_MAX (1000U) - -typedef struct -{ - /// saturated uint10 value - uint16_t value; -} rmap_tableb_B11002_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11002_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11002_1_0_serialize_( - const rmap_tableb_B11002_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint10 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 1023U) - { - _sat0_ = 1023U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 10U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11002_1_0_deserialize_( - rmap_tableb_B11002_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint10 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11002_1_0_initialize_(rmap_tableb_B11002_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11002_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11002_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11041_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11041_1_0.h deleted file mode 100644 index f607c9f78..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11041_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.712805 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11041 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11041_1_0_INCLUDED_ -#define RMAP_TABLEB_B11041_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11041.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11041_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11041_1_0_FULL_NAME_ "rmap.tableb.B11041" -#define rmap_tableb_B11041_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11041.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11041_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11041_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11041_1_0_EXTENT_BYTES_ >= rmap_tableb_B11041_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint10 MAX = 1000 -#define rmap_tableb_B11041_1_0_MAX (1000U) - -typedef struct -{ - /// saturated uint10 value - uint16_t value; -} rmap_tableb_B11041_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11041_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11041_1_0_serialize_( - const rmap_tableb_B11041_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint10 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 1023U) - { - _sat0_ = 1023U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 10U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11041_1_0_deserialize_( - rmap_tableb_B11041_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint10 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11041_1_0_initialize_(rmap_tableb_B11041_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11041_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11041_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11043_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11043_1_0.h deleted file mode 100644 index dd92ecdfa..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11043_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.712805 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11043 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11043_1_0_INCLUDED_ -#define RMAP_TABLEB_B11043_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11043.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11043_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11043_1_0_FULL_NAME_ "rmap.tableb.B11043" -#define rmap_tableb_B11043_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11043.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11043_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11043_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11043_1_0_EXTENT_BYTES_ >= rmap_tableb_B11043_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint9 MAX = 360 -#define rmap_tableb_B11043_1_0_MAX (360U) - -typedef struct -{ - /// saturated uint9 value - uint16_t value; -} rmap_tableb_B11043_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11043_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11043_1_0_serialize_( - const rmap_tableb_B11043_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint9 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 511U) - { - _sat0_ = 511U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 9U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11043_1_0_deserialize_( - rmap_tableb_B11043_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint9 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 9); - offset_bits += 9U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11043_1_0_initialize_(rmap_tableb_B11043_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11043_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11043_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11209_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11209_1_0.h deleted file mode 100644 index 85fbc7b2a..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11209_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.712805 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11209 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11209_1_0_INCLUDED_ -#define RMAP_TABLEB_B11209_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11209_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11209_1_0_FULL_NAME_ "rmap.tableb.B11209" -#define rmap_tableb_B11209_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11209.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11209_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11209_1_0_EXTENT_BYTES_ >= rmap_tableb_B11209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint10 MAX = 1000 -#define rmap_tableb_B11209_1_0_MAX (1000U) - -typedef struct -{ - /// saturated uint10 value - uint16_t value; -} rmap_tableb_B11209_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11209_1_0_serialize_( - const rmap_tableb_B11209_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint10 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 1023U) - { - _sat0_ = 1023U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 10U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11209_1_0_deserialize_( - rmap_tableb_B11209_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint10 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11209_1_0_initialize_(rmap_tableb_B11209_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11209_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11209_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11210_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11210_1_0.h deleted file mode 100644 index 74cdeaf66..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11210_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.728269 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11210 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11210_1_0_INCLUDED_ -#define RMAP_TABLEB_B11210_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11210.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11210_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11210_1_0_FULL_NAME_ "rmap.tableb.B11210" -#define rmap_tableb_B11210_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11210.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11210_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B11210_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B11210_1_0_EXTENT_BYTES_ >= rmap_tableb_B11210_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint9 MAX = 360 -#define rmap_tableb_B11210_1_0_MAX (360U) - -typedef struct -{ - /// saturated uint9 value - uint16_t value; -} rmap_tableb_B11210_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11210_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11210_1_0_serialize_( - const rmap_tableb_B11210_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint9 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 511U) - { - _sat0_ = 511U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 9U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11210_1_0_deserialize_( - rmap_tableb_B11210_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint9 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 9); - offset_bits += 9U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11210_1_0_initialize_(rmap_tableb_B11210_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11210_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11210_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11211_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11211_1_0.h deleted file mode 100644 index ba60107d8..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11211_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.728269 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11211 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11211_1_0_INCLUDED_ -#define RMAP_TABLEB_B11211_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11211.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11211_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11211_1_0_FULL_NAME_ "rmap.tableb.B11211" -#define rmap_tableb_B11211_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11211.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11211_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11211_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11211_1_0_EXTENT_BYTES_ >= rmap_tableb_B11211_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11211_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11211_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11211_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11211_1_0_serialize_( - const rmap_tableb_B11211_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11211_1_0_deserialize_( - rmap_tableb_B11211_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11211_1_0_initialize_(rmap_tableb_B11211_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11211_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11211_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11212_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11212_1_0.h deleted file mode 100644 index 3513657e4..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11212_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.728269 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11212 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11212_1_0_INCLUDED_ -#define RMAP_TABLEB_B11212_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11212.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11212_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11212_1_0_FULL_NAME_ "rmap.tableb.B11212" -#define rmap_tableb_B11212_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11212.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11212_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11212_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11212_1_0_EXTENT_BYTES_ >= rmap_tableb_B11212_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11212_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11212_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11212_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11212_1_0_serialize_( - const rmap_tableb_B11212_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11212_1_0_deserialize_( - rmap_tableb_B11212_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11212_1_0_initialize_(rmap_tableb_B11212_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11212_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11212_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11213_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11213_1_0.h deleted file mode 100644 index abd32dc86..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11213_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.728269 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11213 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11213_1_0_INCLUDED_ -#define RMAP_TABLEB_B11213_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11213.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11213_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11213_1_0_FULL_NAME_ "rmap.tableb.B11213" -#define rmap_tableb_B11213_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11213.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11213_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11213_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11213_1_0_EXTENT_BYTES_ >= rmap_tableb_B11213_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11213_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11213_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11213_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11213_1_0_serialize_( - const rmap_tableb_B11213_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11213_1_0_deserialize_( - rmap_tableb_B11213_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11213_1_0_initialize_(rmap_tableb_B11213_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11213_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11213_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11214_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11214_1_0.h deleted file mode 100644 index 8a6dc420a..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11214_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.744106 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11214 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11214_1_0_INCLUDED_ -#define RMAP_TABLEB_B11214_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11214.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11214_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11214_1_0_FULL_NAME_ "rmap.tableb.B11214" -#define rmap_tableb_B11214_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11214.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11214_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11214_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11214_1_0_EXTENT_BYTES_ >= rmap_tableb_B11214_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11214_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11214_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11214_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11214_1_0_serialize_( - const rmap_tableb_B11214_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11214_1_0_deserialize_( - rmap_tableb_B11214_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11214_1_0_initialize_(rmap_tableb_B11214_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11214_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11214_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11215_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11215_1_0.h deleted file mode 100644 index d259788ec..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11215_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.744106 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11215 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11215_1_0_INCLUDED_ -#define RMAP_TABLEB_B11215_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11215.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11215_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11215_1_0_FULL_NAME_ "rmap.tableb.B11215" -#define rmap_tableb_B11215_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11215.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11215_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11215_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11215_1_0_EXTENT_BYTES_ >= rmap_tableb_B11215_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11215_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11215_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11215_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11215_1_0_serialize_( - const rmap_tableb_B11215_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11215_1_0_deserialize_( - rmap_tableb_B11215_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11215_1_0_initialize_(rmap_tableb_B11215_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11215_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11215_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B11216_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B11216_1_0.h deleted file mode 100644 index 56e30e822..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B11216_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.744106 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B11216 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B11216_1_0_INCLUDED_ -#define RMAP_TABLEB_B11216_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B11216.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B11216_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B11216_1_0_FULL_NAME_ "rmap.tableb.B11216" -#define rmap_tableb_B11216_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B11216.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B11216_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B11216_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B11216_1_0_EXTENT_BYTES_ >= rmap_tableb_B11216_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B11216_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B11216_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B11216_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11216_1_0_serialize_( - const rmap_tableb_B11216_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B11216_1_0_deserialize_( - rmap_tableb_B11216_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B11216_1_0_initialize_(rmap_tableb_B11216_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B11216_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B11216_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B12101_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B12101_1_0.h deleted file mode 100644 index 48350f89c..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B12101_1_0.h +++ /dev/null @@ -1,228 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.744106 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B12101 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B12101_1_0_INCLUDED_ -#define RMAP_TABLEB_B12101_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B12101.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B12101_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B12101_1_0_FULL_NAME_ "rmap.tableb.B12101" -#define rmap_tableb_B12101_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B12101.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B12101_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B12101_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B12101_1_0_EXTENT_BYTES_ >= rmap_tableb_B12101_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 MAX = 52315 -#define rmap_tableb_B12101_1_0_MAX (52315U) - -typedef struct -{ - /// saturated uint16 value - uint16_t value; -} rmap_tableb_B12101_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B12101_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B12101_1_0_serialize_( - const rmap_tableb_B12101_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B12101_1_0_deserialize_( - rmap_tableb_B12101_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B12101_1_0_initialize_(rmap_tableb_B12101_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B12101_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B12101_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B13003_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B13003_1_0.h deleted file mode 100644 index 90ae00ae3..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B13003_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.759556 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B13003 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B13003_1_0_INCLUDED_ -#define RMAP_TABLEB_B13003_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13003.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B13003_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B13003_1_0_FULL_NAME_ "rmap.tableb.B13003" -#define rmap_tableb_B13003_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B13003.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B13003_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B13003_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B13003_1_0_EXTENT_BYTES_ >= rmap_tableb_B13003_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B13003_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B13003_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B13003_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13003_1_0_serialize_( - const rmap_tableb_B13003_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13003_1_0_deserialize_( - rmap_tableb_B13003_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B13003_1_0_initialize_(rmap_tableb_B13003_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B13003_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B13003_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B13011_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B13011_1_0.h deleted file mode 100644 index 74d8efb44..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B13011_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.759556 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B13011 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B13011_1_0_INCLUDED_ -#define RMAP_TABLEB_B13011_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13011.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B13011_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B13011_1_0_FULL_NAME_ "rmap.tableb.B13011" -#define rmap_tableb_B13011_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B13011.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B13011_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B13011_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B13011_1_0_EXTENT_BYTES_ >= rmap_tableb_B13011_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint12 MAX = 4000 -#define rmap_tableb_B13011_1_0_MAX (4000U) - -typedef struct -{ - /// saturated uint12 value - uint16_t value; -} rmap_tableb_B13011_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B13011_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13011_1_0_serialize_( - const rmap_tableb_B13011_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint12 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 4095U) - { - _sat0_ = 4095U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 12U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13011_1_0_deserialize_( - rmap_tableb_B13011_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint12 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 12); - offset_bits += 12U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B13011_1_0_initialize_(rmap_tableb_B13011_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B13011_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B13011_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B13208_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B13208_1_0.h deleted file mode 100644 index 23aa711c6..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B13208_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.759556 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B13208 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B13208_1_0_INCLUDED_ -#define RMAP_TABLEB_B13208_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13208.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B13208_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B13208_1_0_FULL_NAME_ "rmap.tableb.B13208" -#define rmap_tableb_B13208_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B13208.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B13208_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B13208_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B13208_1_0_EXTENT_BYTES_ >= rmap_tableb_B13208_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint14 MAX = 16333 -#define rmap_tableb_B13208_1_0_MAX (16333U) - -typedef struct -{ - /// saturated uint14 value - uint16_t value; -} rmap_tableb_B13208_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B13208_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13208_1_0_serialize_( - const rmap_tableb_B13208_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint14 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 16383U) - { - _sat0_ = 16383U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 14U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13208_1_0_deserialize_( - rmap_tableb_B13208_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint14 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 14); - offset_bits += 14U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B13208_1_0_initialize_(rmap_tableb_B13208_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B13208_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B13208_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B13209_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B13209_1_0.h deleted file mode 100644 index 37aac429a..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B13209_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.759556 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B13209 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B13209_1_0_INCLUDED_ -#define RMAP_TABLEB_B13209_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13209.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B13209_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B13209_1_0_FULL_NAME_ "rmap.tableb.B13209" -#define rmap_tableb_B13209_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B13209.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B13209_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B13209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B13209_1_0_EXTENT_BYTES_ >= rmap_tableb_B13209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint14 MAX = 16333 -#define rmap_tableb_B13209_1_0_MAX (16333U) - -typedef struct -{ - /// saturated uint14 value - uint16_t value; -} rmap_tableb_B13209_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B13209_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13209_1_0_serialize_( - const rmap_tableb_B13209_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint14 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 16383U) - { - _sat0_ = 16383U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 14U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13209_1_0_deserialize_( - rmap_tableb_B13209_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint14 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 14); - offset_bits += 14U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B13209_1_0_initialize_(rmap_tableb_B13209_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B13209_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B13209_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B13227_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B13227_1_0.h deleted file mode 100644 index 866c955ba..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B13227_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.775194 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B13227 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B13227_1_0_INCLUDED_ -#define RMAP_TABLEB_B13227_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B13227.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B13227_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B13227_1_0_FULL_NAME_ "rmap.tableb.B13227" -#define rmap_tableb_B13227_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B13227.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B13227_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B13227_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B13227_1_0_EXTENT_BYTES_ >= rmap_tableb_B13227_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint10 MAX = 1000 -#define rmap_tableb_B13227_1_0_MAX (1000U) - -typedef struct -{ - /// saturated uint10 value - uint16_t value; -} rmap_tableb_B13227_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B13227_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13227_1_0_serialize_( - const rmap_tableb_B13227_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint10 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 1023U) - { - _sat0_ = 1023U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 10U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B13227_1_0_deserialize_( - rmap_tableb_B13227_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint10 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B13227_1_0_initialize_(rmap_tableb_B13227_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B13227_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B13227_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B14198_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B14198_1_0.h deleted file mode 100644 index fa6ac4de3..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B14198_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.775194 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B14198 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B14198_1_0_INCLUDED_ -#define RMAP_TABLEB_B14198_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B14198.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B14198_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B14198_1_0_FULL_NAME_ "rmap.tableb.B14198" -#define rmap_tableb_B14198_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B14198.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B14198_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B14198_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B14198_1_0_EXTENT_BYTES_ >= rmap_tableb_B14198_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint12 MAX = 4000 -#define rmap_tableb_B14198_1_0_MAX (4000U) - -typedef struct -{ - /// saturated uint12 value - uint16_t value; -} rmap_tableb_B14198_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B14198_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B14198_1_0_serialize_( - const rmap_tableb_B14198_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint12 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 4095U) - { - _sat0_ = 4095U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 12U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B14198_1_0_deserialize_( - rmap_tableb_B14198_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint12 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 12); - offset_bits += 12U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B14198_1_0_initialize_(rmap_tableb_B14198_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B14198_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B14198_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B25192_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B25192_1_0.h deleted file mode 100644 index 161a80d3e..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B25192_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.775194 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B25192 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B25192_1_0_INCLUDED_ -#define RMAP_TABLEB_B25192_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25192.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B25192_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B25192_1_0_FULL_NAME_ "rmap.tableb.B25192" -#define rmap_tableb_B25192_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B25192.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B25192_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B25192_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B25192_1_0_EXTENT_BYTES_ >= rmap_tableb_B25192_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B25192_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B25192_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B25192_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25192_1_0_serialize_( - const rmap_tableb_B25192_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25192_1_0_deserialize_( - rmap_tableb_B25192_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B25192_1_0_initialize_(rmap_tableb_B25192_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B25192_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B25192_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B25193_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B25193_1_0.h deleted file mode 100644 index aa98b324d..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B25193_1_0.h +++ /dev/null @@ -1,230 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.775194 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B25193 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B25193_1_0_INCLUDED_ -#define RMAP_TABLEB_B25193_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25193.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B25193_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B25193_1_0_FULL_NAME_ "rmap.tableb.B25193" -#define rmap_tableb_B25193_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B25193.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B25193_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B25193_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B25193_1_0_EXTENT_BYTES_ >= rmap_tableb_B25193_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated int16 MIN = -30000 -#define rmap_tableb_B25193_1_0_MIN (-30000) -/// saturated int16 MAX = 30000 -#define rmap_tableb_B25193_1_0_MAX (30000) - -typedef struct -{ - /// saturated int16 value - int16_t value; -} rmap_tableb_B25193_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B25193_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25193_1_0_serialize_( - const rmap_tableb_B25193_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25193_1_0_deserialize_( - rmap_tableb_B25193_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int16 value - out_obj->value = nunavutGetI16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B25193_1_0_initialize_(rmap_tableb_B25193_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B25193_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B25193_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B25194_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B25194_1_0.h deleted file mode 100644 index 9b1fa651d..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B25194_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.791030 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B25194 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B25194_1_0_INCLUDED_ -#define RMAP_TABLEB_B25194_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B25194.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B25194_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B25194_1_0_FULL_NAME_ "rmap.tableb.B25194" -#define rmap_tableb_B25194_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B25194.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B25194_1_0_EXTENT_BYTES_ 2UL -#define rmap_tableb_B25194_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(rmap_tableb_B25194_1_0_EXTENT_BYTES_ >= rmap_tableb_B25194_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint12 MAX = 4000 -#define rmap_tableb_B25194_1_0_MAX (4000U) - -typedef struct -{ - /// saturated uint12 value - uint16_t value; -} rmap_tableb_B25194_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B25194_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25194_1_0_serialize_( - const rmap_tableb_B25194_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint12 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 4095U) - { - _sat0_ = 4095U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 12U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B25194_1_0_deserialize_( - rmap_tableb_B25194_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint12 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 12); - offset_bits += 12U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B25194_1_0_initialize_(rmap_tableb_B25194_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B25194_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B25194_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/rmap/tableb/B33199_1_0.h b/platformio/stima_v4/libraries/include/rmap/tableb/B33199_1_0.h deleted file mode 100644 index 92f2960a8..000000000 --- a/platformio/stima_v4/libraries/include/rmap/tableb/B33199_1_0.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl -// Generated at: 2023-07-11 16:47:51.791030 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: rmap.tableb.B33199 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef RMAP_TABLEB_B33199_1_0_INCLUDED_ -#define RMAP_TABLEB_B33199_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/rmap/tableb/B33199.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define rmap_tableb_B33199_1_0_HAS_FIXED_PORT_ID_ false - -#define rmap_tableb_B33199_1_0_FULL_NAME_ "rmap.tableb.B33199" -#define rmap_tableb_B33199_1_0_FULL_NAME_AND_VERSION_ "rmap.tableb.B33199.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define rmap_tableb_B33199_1_0_EXTENT_BYTES_ 1UL -#define rmap_tableb_B33199_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(rmap_tableb_B33199_1_0_EXTENT_BYTES_ >= rmap_tableb_B33199_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint7 MAX = 100 -#define rmap_tableb_B33199_1_0_MAX (100U) - -typedef struct -{ - /// saturated uint7 value - uint8_t value; -} rmap_tableb_B33199_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see rmap_tableb_B33199_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B33199_1_0_serialize_( - const rmap_tableb_B33199_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint7 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 127U) - { - _sat0_ = 127U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 7U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t rmap_tableb_B33199_1_0_deserialize_( - rmap_tableb_B33199_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint7 value - if ((offset_bits + 7U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 127U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 7U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void rmap_tableb_B33199_1_0_initialize_(rmap_tableb_B33199_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = rmap_tableb_B33199_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // RMAP_TABLEB_B33199_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/_register/Access_1_0.h b/platformio/stima_v4/libraries/include/uavcan/_register/Access_1_0.h deleted file mode 100644 index 087ad0cfa..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/_register/Access_1_0.h +++ /dev/null @@ -1,577 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.516271 UTC -// Is deprecated: no -// Fixed port-ID: 384 -// Full name: uavcan.register.Access -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_REGISTER_ACCESS_1_0_INCLUDED_ -#define UAVCAN_REGISTER_ACCESS_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/384.Access.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_register_Access_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_register_Access_1_0_FIXED_PORT_ID_ 384U - -#define uavcan_register_Access_1_0_FULL_NAME_ "uavcan.register.Access" -#define uavcan_register_Access_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.Access.1.0" - -#define uavcan_register_Access_Request_1_0_FULL_NAME_ "uavcan.register.Access.Request" -#define uavcan_register_Access_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.Access.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_Access_Request_1_0_EXTENT_BYTES_ 515UL -#define uavcan_register_Access_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 515UL -static_assert(uavcan_register_Access_Request_1_0_EXTENT_BYTES_ >= uavcan_register_Access_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.register.Name.1.0 name - uavcan_register_Name_1_0 name; - - /// uavcan.register.Value.1.0 value - uavcan_register_Value_1_0 value; -} uavcan_register_Access_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_Access_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Access_Request_1_0_serialize_( - const uavcan_register_Access_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 4120UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.register.Name.1.0 name - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_register_Name_1_0_serialize_( - &obj->name, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.register.Value.1.0 value - size_t _size_bytes1_ = 259UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_register_Value_1_0_serialize_( - &obj->value, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Access_Request_1_0_deserialize_( - uavcan_register_Access_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.register.Name.1.0 name - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_register_Name_1_0_deserialize_( - &out_obj->name, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.register.Value.1.0 value - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_register_Value_1_0_deserialize_( - &out_obj->value, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_Access_Request_1_0_initialize_(uavcan_register_Access_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_Access_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_register_Access_Response_1_0_FULL_NAME_ "uavcan.register.Access.Response" -#define uavcan_register_Access_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.Access.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_Access_Response_1_0_EXTENT_BYTES_ 267UL -#define uavcan_register_Access_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 267UL -static_assert(uavcan_register_Access_Response_1_0_EXTENT_BYTES_ >= uavcan_register_Access_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated bool mutable - bool _mutable; - - /// saturated bool persistent - bool persistent; - - /// uavcan.register.Value.1.0 value - uavcan_register_Value_1_0 value; -} uavcan_register_Access_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_Access_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Access_Response_1_0_serialize_( - const uavcan_register_Access_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2136UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes4_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err6_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated bool mutable - buffer[offset_bits / 8U] = obj->_mutable ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool persistent - if (obj->persistent) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void6 - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 6U); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += 6UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err8_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _pad2_; - } - - { // uavcan.register.Value.1.0 value - size_t _size_bytes5_ = 259UL; // Nested object (max) size, in bytes. - int8_t _err9_ = uavcan_register_Value_1_0_serialize_( - &obj->value, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err10_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Access_Response_1_0_deserialize_( - uavcan_register_Access_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err11_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err11_ < 0) - { - return _err11_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated bool mutable - if (offset_bits < capacity_bits) - { - out_obj->_mutable = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->_mutable = false; - } - offset_bits += 1U; - - - - - // saturated bool persistent - if (offset_bits < capacity_bits) - { - out_obj->persistent = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->persistent = false; - } - offset_bits += 1U; - - - - - // void6 - offset_bits += 6; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.register.Value.1.0 value - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err12_ = uavcan_register_Value_1_0_deserialize_( - &out_obj->value, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err12_ < 0) - { - return _err12_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_Access_Response_1_0_initialize_(uavcan_register_Access_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_Access_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_REGISTER_ACCESS_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/_register/List_1_0.h b/platformio/stima_v4/libraries/include/uavcan/_register/List_1_0.h deleted file mode 100644 index 7afcf5e30..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/_register/List_1_0.h +++ /dev/null @@ -1,401 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.516271 UTC -// Is deprecated: no -// Fixed port-ID: 385 -// Full name: uavcan.register.List -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_REGISTER_LIST_1_0_INCLUDED_ -#define UAVCAN_REGISTER_LIST_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/385.List.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_register_List_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_register_List_1_0_FIXED_PORT_ID_ 385U - -#define uavcan_register_List_1_0_FULL_NAME_ "uavcan.register.List" -#define uavcan_register_List_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.List.1.0" - -#define uavcan_register_List_Request_1_0_FULL_NAME_ "uavcan.register.List.Request" -#define uavcan_register_List_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.List.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_List_Request_1_0_EXTENT_BYTES_ 2UL -#define uavcan_register_List_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_register_List_Request_1_0_EXTENT_BYTES_ >= uavcan_register_List_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint16 index - uint16_t index; -} uavcan_register_List_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_List_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_List_Request_1_0_serialize_( - const uavcan_register_List_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 index - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->index, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_List_Request_1_0_deserialize_( - uavcan_register_List_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 index - out_obj->index = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_List_Request_1_0_initialize_(uavcan_register_List_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_List_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_register_List_Response_1_0_FULL_NAME_ "uavcan.register.List.Response" -#define uavcan_register_List_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.List.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_List_Response_1_0_EXTENT_BYTES_ 256UL -#define uavcan_register_List_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 256UL -static_assert(uavcan_register_List_Response_1_0_EXTENT_BYTES_ >= uavcan_register_List_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.register.Name.1.0 name - uavcan_register_Name_1_0 name; -} uavcan_register_List_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_List_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_List_Response_1_0_serialize_( - const uavcan_register_List_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2048UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.register.Name.1.0 name - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_register_Name_1_0_serialize_( - &obj->name, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_List_Response_1_0_deserialize_( - uavcan_register_List_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.register.Name.1.0 name - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_register_Name_1_0_deserialize_( - &out_obj->name, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_List_Response_1_0_initialize_(uavcan_register_List_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_List_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_REGISTER_LIST_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/_register/Name_1_0.h b/platformio/stima_v4/libraries/include/uavcan/_register/Name_1_0.h deleted file mode 100644 index 6d2605f75..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/_register/Name_1_0.h +++ /dev/null @@ -1,255 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.531948 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.register.Name -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_REGISTER_NAME_1_0_INCLUDED_ -#define UAVCAN_REGISTER_NAME_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Name.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_register_Name_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_register_Name_1_0_FULL_NAME_ "uavcan.register.Name" -#define uavcan_register_Name_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.Name.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_Name_1_0_EXTENT_BYTES_ 256UL -#define uavcan_register_Name_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 256UL -static_assert(uavcan_register_Name_1_0_EXTENT_BYTES_ >= uavcan_register_Name_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=255] name -#define uavcan_register_Name_1_0_name_ARRAY_CAPACITY_ 255U -#define uavcan_register_Name_1_0_name_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=255] name - struct /// Array address equivalence guarantee: &elements[0] == &name - { - uint8_t elements[uavcan_register_Name_1_0_name_ARRAY_CAPACITY_]; - size_t count; - } name; -} uavcan_register_Name_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_Name_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Name_1_0_serialize_( - const uavcan_register_Name_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2048UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=255] name - if (obj->name.count > 255) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->name.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->name.count * 8U, &obj->name.elements[0], 0U); - offset_bits += obj->name.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Name_1_0_deserialize_( - uavcan_register_Name_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=255] name - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->name.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->name.count = 0U; - } - offset_bits += 8U; - if (out_obj->name.count > 255U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->name.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->name.count * 8U); - offset_bits += out_obj->name.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_Name_1_0_initialize_(uavcan_register_Name_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_Name_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_REGISTER_NAME_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/_register/Value_1_0.h b/platformio/stima_v4/libraries/include/uavcan/_register/Value_1_0.h deleted file mode 100644 index 59bd44a59..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/_register/Value_1_0.h +++ /dev/null @@ -1,897 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.531948 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.register.Value -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_REGISTER_VALUE_1_0_INCLUDED_ -#define UAVCAN_REGISTER_VALUE_1_0_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/register/Value.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_register_Value_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_register_Value_1_0_FULL_NAME_ "uavcan.register.Value" -#define uavcan_register_Value_1_0_FULL_NAME_AND_VERSION_ "uavcan.register.Value.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_register_Value_1_0_EXTENT_BYTES_ 259UL -#define uavcan_register_Value_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 259UL -static_assert(uavcan_register_Value_1_0_EXTENT_BYTES_ >= uavcan_register_Value_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_register_Value_1_0_UNION_OPTION_COUNT_ 15U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// uavcan.primitive.Empty.1.0 empty - uavcan_primitive_Empty_1_0 empty; - - /// uavcan.primitive.String.1.0 string - uavcan_primitive_String_1_0 _string; - - /// uavcan.primitive.Unstructured.1.0 unstructured - uavcan_primitive_Unstructured_1_0 unstructured; - - /// uavcan.primitive.array.Bit.1.0 bit - uavcan_primitive_array_Bit_1_0 bit; - - /// uavcan.primitive.array.Integer64.1.0 integer64 - uavcan_primitive_array_Integer64_1_0 integer64; - - /// uavcan.primitive.array.Integer32.1.0 integer32 - uavcan_primitive_array_Integer32_1_0 integer32; - - /// uavcan.primitive.array.Integer16.1.0 integer16 - uavcan_primitive_array_Integer16_1_0 integer16; - - /// uavcan.primitive.array.Integer8.1.0 integer8 - uavcan_primitive_array_Integer8_1_0 integer8; - - /// uavcan.primitive.array.Natural64.1.0 natural64 - uavcan_primitive_array_Natural64_1_0 natural64; - - /// uavcan.primitive.array.Natural32.1.0 natural32 - uavcan_primitive_array_Natural32_1_0 natural32; - - /// uavcan.primitive.array.Natural16.1.0 natural16 - uavcan_primitive_array_Natural16_1_0 natural16; - - /// uavcan.primitive.array.Natural8.1.0 natural8 - uavcan_primitive_array_Natural8_1_0 natural8; - - /// uavcan.primitive.array.Real64.1.0 real64 - uavcan_primitive_array_Real64_1_0 real64; - - /// uavcan.primitive.array.Real32.1.0 real32 - uavcan_primitive_array_Real32_1_0 real32; - - /// uavcan.primitive.array.Real16.1.0 real16 - uavcan_primitive_array_Real16_1_0 real16; - }; - uint8_t _tag_; -} uavcan_register_Value_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_register_Value_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Value_1_0_serialize_( - const uavcan_register_Value_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2072UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // uavcan.primitive.Empty.1.0 empty - { - size_t _size_bytes0_ = 0UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_primitive_Empty_1_0_serialize_( - &obj->empty, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - else if (1U == obj->_tag_) // uavcan.primitive.String.1.0 string - { - size_t _size_bytes1_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_primitive_String_1_0_serialize_( - &obj->_string, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else if (2U == obj->_tag_) // uavcan.primitive.Unstructured.1.0 unstructured - { - size_t _size_bytes2_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_primitive_Unstructured_1_0_serialize_( - &obj->unstructured, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - else if (3U == obj->_tag_) // uavcan.primitive.array.Bit.1.0 bit - { - size_t _size_bytes3_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_primitive_array_Bit_1_0_serialize_( - &obj->bit, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - else if (4U == obj->_tag_) // uavcan.primitive.array.Integer64.1.0 integer64 - { - size_t _size_bytes4_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_primitive_array_Integer64_1_0_serialize_( - &obj->integer64, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - else if (5U == obj->_tag_) // uavcan.primitive.array.Integer32.1.0 integer32 - { - size_t _size_bytes5_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err5_ = uavcan_primitive_array_Integer32_1_0_serialize_( - &obj->integer32, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err5_ < 0) - { - return _err5_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested object. - } - else if (6U == obj->_tag_) // uavcan.primitive.array.Integer16.1.0 integer16 - { - size_t _size_bytes6_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err6_ = uavcan_primitive_array_Integer16_1_0_serialize_( - &obj->integer16, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested object. - } - else if (7U == obj->_tag_) // uavcan.primitive.array.Integer8.1.0 integer8 - { - size_t _size_bytes7_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err7_ = uavcan_primitive_array_Integer8_1_0_serialize_( - &obj->integer8, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err7_ < 0) - { - return _err7_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested object. - } - else if (8U == obj->_tag_) // uavcan.primitive.array.Natural64.1.0 natural64 - { - size_t _size_bytes8_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err8_ = uavcan_primitive_array_Natural64_1_0_serialize_( - &obj->natural64, &buffer[offset_bits / 8U], &_size_bytes8_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes8_ * 8U; // Advance by the size of the nested object. - } - else if (9U == obj->_tag_) // uavcan.primitive.array.Natural32.1.0 natural32 - { - size_t _size_bytes9_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err9_ = uavcan_primitive_array_Natural32_1_0_serialize_( - &obj->natural32, &buffer[offset_bits / 8U], &_size_bytes9_); - if (_err9_ < 0) - { - return _err9_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes9_ * 8U; // Advance by the size of the nested object. - } - else if (10U == obj->_tag_) // uavcan.primitive.array.Natural16.1.0 natural16 - { - size_t _size_bytes10_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err10_ = uavcan_primitive_array_Natural16_1_0_serialize_( - &obj->natural16, &buffer[offset_bits / 8U], &_size_bytes10_); - if (_err10_ < 0) - { - return _err10_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes10_ * 8U; // Advance by the size of the nested object. - } - else if (11U == obj->_tag_) // uavcan.primitive.array.Natural8.1.0 natural8 - { - size_t _size_bytes11_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err11_ = uavcan_primitive_array_Natural8_1_0_serialize_( - &obj->natural8, &buffer[offset_bits / 8U], &_size_bytes11_); - if (_err11_ < 0) - { - return _err11_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes11_ * 8U; // Advance by the size of the nested object. - } - else if (12U == obj->_tag_) // uavcan.primitive.array.Real64.1.0 real64 - { - size_t _size_bytes12_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err12_ = uavcan_primitive_array_Real64_1_0_serialize_( - &obj->real64, &buffer[offset_bits / 8U], &_size_bytes12_); - if (_err12_ < 0) - { - return _err12_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes12_ * 8U; // Advance by the size of the nested object. - } - else if (13U == obj->_tag_) // uavcan.primitive.array.Real32.1.0 real32 - { - size_t _size_bytes13_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err13_ = uavcan_primitive_array_Real32_1_0_serialize_( - &obj->real32, &buffer[offset_bits / 8U], &_size_bytes13_); - if (_err13_ < 0) - { - return _err13_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes13_ * 8U; // Advance by the size of the nested object. - } - else if (14U == obj->_tag_) // uavcan.primitive.array.Real16.1.0 real16 - { - size_t _size_bytes14_ = 257UL; // Nested object (max) size, in bytes. - int8_t _err14_ = uavcan_primitive_array_Real16_1_0_serialize_( - &obj->real16, &buffer[offset_bits / 8U], &_size_bytes14_); - if (_err14_ < 0) - { - return _err14_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes14_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err15_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err15_ < 0) - { - return _err15_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_register_Value_1_0_deserialize_( - uavcan_register_Value_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // uavcan.primitive.Empty.1.0 empty - { - { - size_t _size_bytes15_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err16_ = uavcan_primitive_Empty_1_0_deserialize_( - &out_obj->empty, &buffer[offset_bits / 8U], &_size_bytes15_); - if (_err16_ < 0) - { - return _err16_; - } - offset_bits += _size_bytes15_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (1U == out_obj->_tag_) // uavcan.primitive.String.1.0 string - { - { - size_t _size_bytes16_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err17_ = uavcan_primitive_String_1_0_deserialize_( - &out_obj->_string, &buffer[offset_bits / 8U], &_size_bytes16_); - if (_err17_ < 0) - { - return _err17_; - } - offset_bits += _size_bytes16_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (2U == out_obj->_tag_) // uavcan.primitive.Unstructured.1.0 unstructured - { - { - size_t _size_bytes17_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err18_ = uavcan_primitive_Unstructured_1_0_deserialize_( - &out_obj->unstructured, &buffer[offset_bits / 8U], &_size_bytes17_); - if (_err18_ < 0) - { - return _err18_; - } - offset_bits += _size_bytes17_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (3U == out_obj->_tag_) // uavcan.primitive.array.Bit.1.0 bit - { - { - size_t _size_bytes18_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err19_ = uavcan_primitive_array_Bit_1_0_deserialize_( - &out_obj->bit, &buffer[offset_bits / 8U], &_size_bytes18_); - if (_err19_ < 0) - { - return _err19_; - } - offset_bits += _size_bytes18_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (4U == out_obj->_tag_) // uavcan.primitive.array.Integer64.1.0 integer64 - { - { - size_t _size_bytes19_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err20_ = uavcan_primitive_array_Integer64_1_0_deserialize_( - &out_obj->integer64, &buffer[offset_bits / 8U], &_size_bytes19_); - if (_err20_ < 0) - { - return _err20_; - } - offset_bits += _size_bytes19_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (5U == out_obj->_tag_) // uavcan.primitive.array.Integer32.1.0 integer32 - { - { - size_t _size_bytes20_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err21_ = uavcan_primitive_array_Integer32_1_0_deserialize_( - &out_obj->integer32, &buffer[offset_bits / 8U], &_size_bytes20_); - if (_err21_ < 0) - { - return _err21_; - } - offset_bits += _size_bytes20_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (6U == out_obj->_tag_) // uavcan.primitive.array.Integer16.1.0 integer16 - { - { - size_t _size_bytes21_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err22_ = uavcan_primitive_array_Integer16_1_0_deserialize_( - &out_obj->integer16, &buffer[offset_bits / 8U], &_size_bytes21_); - if (_err22_ < 0) - { - return _err22_; - } - offset_bits += _size_bytes21_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (7U == out_obj->_tag_) // uavcan.primitive.array.Integer8.1.0 integer8 - { - { - size_t _size_bytes22_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err23_ = uavcan_primitive_array_Integer8_1_0_deserialize_( - &out_obj->integer8, &buffer[offset_bits / 8U], &_size_bytes22_); - if (_err23_ < 0) - { - return _err23_; - } - offset_bits += _size_bytes22_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (8U == out_obj->_tag_) // uavcan.primitive.array.Natural64.1.0 natural64 - { - { - size_t _size_bytes23_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err24_ = uavcan_primitive_array_Natural64_1_0_deserialize_( - &out_obj->natural64, &buffer[offset_bits / 8U], &_size_bytes23_); - if (_err24_ < 0) - { - return _err24_; - } - offset_bits += _size_bytes23_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (9U == out_obj->_tag_) // uavcan.primitive.array.Natural32.1.0 natural32 - { - { - size_t _size_bytes24_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err25_ = uavcan_primitive_array_Natural32_1_0_deserialize_( - &out_obj->natural32, &buffer[offset_bits / 8U], &_size_bytes24_); - if (_err25_ < 0) - { - return _err25_; - } - offset_bits += _size_bytes24_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (10U == out_obj->_tag_) // uavcan.primitive.array.Natural16.1.0 natural16 - { - { - size_t _size_bytes25_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err26_ = uavcan_primitive_array_Natural16_1_0_deserialize_( - &out_obj->natural16, &buffer[offset_bits / 8U], &_size_bytes25_); - if (_err26_ < 0) - { - return _err26_; - } - offset_bits += _size_bytes25_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (11U == out_obj->_tag_) // uavcan.primitive.array.Natural8.1.0 natural8 - { - { - size_t _size_bytes26_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err27_ = uavcan_primitive_array_Natural8_1_0_deserialize_( - &out_obj->natural8, &buffer[offset_bits / 8U], &_size_bytes26_); - if (_err27_ < 0) - { - return _err27_; - } - offset_bits += _size_bytes26_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (12U == out_obj->_tag_) // uavcan.primitive.array.Real64.1.0 real64 - { - { - size_t _size_bytes27_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err28_ = uavcan_primitive_array_Real64_1_0_deserialize_( - &out_obj->real64, &buffer[offset_bits / 8U], &_size_bytes27_); - if (_err28_ < 0) - { - return _err28_; - } - offset_bits += _size_bytes27_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (13U == out_obj->_tag_) // uavcan.primitive.array.Real32.1.0 real32 - { - { - size_t _size_bytes28_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err29_ = uavcan_primitive_array_Real32_1_0_deserialize_( - &out_obj->real32, &buffer[offset_bits / 8U], &_size_bytes28_); - if (_err29_ < 0) - { - return _err29_; - } - offset_bits += _size_bytes28_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (14U == out_obj->_tag_) // uavcan.primitive.array.Real16.1.0 real16 - { - { - size_t _size_bytes29_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err30_ = uavcan_primitive_array_Real16_1_0_deserialize_( - &out_obj->real16, &buffer[offset_bits / 8U], &_size_bytes29_); - if (_err30_ < 0) - { - return _err30_; - } - offset_bits += _size_bytes29_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_register_Value_1_0_initialize_(uavcan_register_Value_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_register_Value_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "empty" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_empty_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "empty" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_empty_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "string" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_string_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "string" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_string_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -/// Mark option "unstructured" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_unstructured_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 2; - } -} - -/// Check if option "unstructured" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_unstructured_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 2)); -} - -/// Mark option "bit" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_bit_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 3; - } -} - -/// Check if option "bit" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_bit_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 3)); -} - -/// Mark option "integer64" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_integer64_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 4; - } -} - -/// Check if option "integer64" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_integer64_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 4)); -} - -/// Mark option "integer32" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_integer32_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 5; - } -} - -/// Check if option "integer32" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_integer32_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 5)); -} - -/// Mark option "integer16" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_integer16_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 6; - } -} - -/// Check if option "integer16" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_integer16_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 6)); -} - -/// Mark option "integer8" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_integer8_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 7; - } -} - -/// Check if option "integer8" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_integer8_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 7)); -} - -/// Mark option "natural64" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_natural64_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 8; - } -} - -/// Check if option "natural64" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_natural64_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 8)); -} - -/// Mark option "natural32" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_natural32_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 9; - } -} - -/// Check if option "natural32" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_natural32_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 9)); -} - -/// Mark option "natural16" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_natural16_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 10; - } -} - -/// Check if option "natural16" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_natural16_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 10)); -} - -/// Mark option "natural8" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_natural8_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 11; - } -} - -/// Check if option "natural8" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_natural8_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 11)); -} - -/// Mark option "real64" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_real64_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 12; - } -} - -/// Check if option "real64" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_real64_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 12)); -} - -/// Mark option "real32" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_real32_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 13; - } -} - -/// Check if option "real32" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_real32_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 13)); -} - -/// Mark option "real16" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_register_Value_1_0_select_real16_(uavcan_register_Value_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 14; - } -} - -/// Check if option "real16" is active. Returns false if @param obj is NULL. -static inline bool uavcan_register_Value_1_0_is_real16_(const uavcan_register_Value_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 14)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_REGISTER_VALUE_1_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_0.h b/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_0.h deleted file mode 100644 index 28c231c83..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_0.h +++ /dev/null @@ -1,342 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.845709 UTC -// Is deprecated: yes -// Fixed port-ID: 8184 -// Full name: uavcan.diagnostic.Record -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_DIAGNOSTIC_RECORD_1_0_INCLUDED_ -#define UAVCAN_DIAGNOSTIC_RECORD_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_diagnostic_Record_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_diagnostic_Record_1_0_FIXED_PORT_ID_ 8184U - -#define uavcan_diagnostic_Record_1_0_FULL_NAME_ "uavcan.diagnostic.Record" -#define uavcan_diagnostic_Record_1_0_FULL_NAME_AND_VERSION_ "uavcan.diagnostic.Record.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_diagnostic_Record_1_0_EXTENT_BYTES_ 300UL -#define uavcan_diagnostic_Record_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 121UL -static_assert(uavcan_diagnostic_Record_1_0_EXTENT_BYTES_ >= uavcan_diagnostic_Record_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=112] text -#define uavcan_diagnostic_Record_1_0_text_ARRAY_CAPACITY_ 112U -#define uavcan_diagnostic_Record_1_0_text_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// uavcan.diagnostic.Severity.1.0 severity - uavcan_diagnostic_Severity_1_0 severity; - - /// saturated uint8[<=112] text - struct /// Array address equivalence guarantee: &elements[0] == &text - { - uint8_t elements[uavcan_diagnostic_Record_1_0_text_ARRAY_CAPACITY_]; - size_t count; - } text; -} uavcan_diagnostic_Record_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_diagnostic_Record_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Record_1_0_serialize_( - const uavcan_diagnostic_Record_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 968UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.diagnostic.Severity.1.0 severity - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_diagnostic_Severity_1_0_serialize_( - &obj->severity, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=112] text - if (obj->text.count > 112) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->text.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->text.count * 8U, &obj->text.elements[0], 0U); - offset_bits += obj->text.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Record_1_0_deserialize_( - uavcan_diagnostic_Record_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.diagnostic.Severity.1.0 severity - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_diagnostic_Severity_1_0_deserialize_( - &out_obj->severity, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=112] text - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->text.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->text.count = 0U; - } - offset_bits += 8U; - if (out_obj->text.count > 112U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->text.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->text.count * 8U); - offset_bits += out_obj->text.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_diagnostic_Record_1_0_initialize_(uavcan_diagnostic_Record_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_diagnostic_Record_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_DIAGNOSTIC_RECORD_1_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_1.h b/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_1.h deleted file mode 100644 index ab8abdac9..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Record_1_1.h +++ /dev/null @@ -1,333 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl -// Generated at: 2023-07-11 16:47:49.845709 UTC -// Is deprecated: no -// Fixed port-ID: 8184 -// Full name: uavcan.diagnostic.Record -// Version: 1.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_DIAGNOSTIC_RECORD_1_1_INCLUDED_ -#define UAVCAN_DIAGNOSTIC_RECORD_1_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/8184.Record.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_diagnostic_Record_1_1_HAS_FIXED_PORT_ID_ true -#define uavcan_diagnostic_Record_1_1_FIXED_PORT_ID_ 8184U - -#define uavcan_diagnostic_Record_1_1_FULL_NAME_ "uavcan.diagnostic.Record" -#define uavcan_diagnostic_Record_1_1_FULL_NAME_AND_VERSION_ "uavcan.diagnostic.Record.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_diagnostic_Record_1_1_EXTENT_BYTES_ 300UL -#define uavcan_diagnostic_Record_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 264UL -static_assert(uavcan_diagnostic_Record_1_1_EXTENT_BYTES_ >= uavcan_diagnostic_Record_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=255] text -#define uavcan_diagnostic_Record_1_1_text_ARRAY_CAPACITY_ 255U -#define uavcan_diagnostic_Record_1_1_text_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// uavcan.diagnostic.Severity.1.0 severity - uavcan_diagnostic_Severity_1_0 severity; - - /// saturated uint8[<=255] text - struct /// Array address equivalence guarantee: &elements[0] == &text - { - uint8_t elements[uavcan_diagnostic_Record_1_1_text_ARRAY_CAPACITY_]; - size_t count; - } text; -} uavcan_diagnostic_Record_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_diagnostic_Record_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Record_1_1_serialize_( - const uavcan_diagnostic_Record_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2112UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.diagnostic.Severity.1.0 severity - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_diagnostic_Severity_1_0_serialize_( - &obj->severity, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=255] text - if (obj->text.count > 255) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->text.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->text.count * 8U, &obj->text.elements[0], 0U); - offset_bits += obj->text.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Record_1_1_deserialize_( - uavcan_diagnostic_Record_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.diagnostic.Severity.1.0 severity - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_diagnostic_Severity_1_0_deserialize_( - &out_obj->severity, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=255] text - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->text.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->text.count = 0U; - } - offset_bits += 8U; - if (out_obj->text.count > 255U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->text.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->text.count * 8U); - offset_bits += out_obj->text.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_diagnostic_Record_1_1_initialize_(uavcan_diagnostic_Record_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_diagnostic_Record_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_DIAGNOSTIC_RECORD_1_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Severity_1_0.h b/platformio/stima_v4/libraries/include/uavcan/diagnostic/Severity_1_0.h deleted file mode 100644 index 77b66d837..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/diagnostic/Severity_1_0.h +++ /dev/null @@ -1,253 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.845709 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.diagnostic.Severity -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_DIAGNOSTIC_SEVERITY_1_0_INCLUDED_ -#define UAVCAN_DIAGNOSTIC_SEVERITY_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/diagnostic/Severity.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_diagnostic_Severity_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_diagnostic_Severity_1_0_FULL_NAME_ "uavcan.diagnostic.Severity" -#define uavcan_diagnostic_Severity_1_0_FULL_NAME_AND_VERSION_ "uavcan.diagnostic.Severity.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_diagnostic_Severity_1_0_EXTENT_BYTES_ 1UL -#define uavcan_diagnostic_Severity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_diagnostic_Severity_1_0_EXTENT_BYTES_ >= uavcan_diagnostic_Severity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint3 TRACE = 0 -#define uavcan_diagnostic_Severity_1_0_TRACE (0U) -/// saturated uint3 DEBUG = 1 -#define uavcan_diagnostic_Severity_1_0_DEBUG (1U) -/// saturated uint3 INFO = 2 -#define uavcan_diagnostic_Severity_1_0_INFO (2U) -/// saturated uint3 NOTICE = 3 -#define uavcan_diagnostic_Severity_1_0_NOTICE (3U) -/// saturated uint3 WARNING = 4 -#define uavcan_diagnostic_Severity_1_0_WARNING (4U) -/// saturated uint3 ERROR = 5 -#define uavcan_diagnostic_Severity_1_0_ERROR (5U) -/// saturated uint3 CRITICAL = 6 -#define uavcan_diagnostic_Severity_1_0_CRITICAL (6U) -/// saturated uint3 ALERT = 7 -#define uavcan_diagnostic_Severity_1_0_ALERT (7U) - -typedef struct -{ - /// saturated uint3 value - uint8_t value; -} uavcan_diagnostic_Severity_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_diagnostic_Severity_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Severity_1_0_serialize_( - const uavcan_diagnostic_Severity_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint3 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 7U) - { - _sat0_ = 7U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 3U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_diagnostic_Severity_1_0_deserialize_( - uavcan_diagnostic_Severity_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint3 value - if ((offset_bits + 3U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 7U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 3U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_diagnostic_Severity_1_0_initialize_(uavcan_diagnostic_Severity_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_diagnostic_Severity_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_DIAGNOSTIC_SEVERITY_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Error_1_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Error_1_0.h deleted file mode 100644 index 6160a0b96..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Error_1_0.h +++ /dev/null @@ -1,246 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.296641 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.file.Error -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_ERROR_1_0_INCLUDED_ -#define UAVCAN_FILE_ERROR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Error.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_file_Error_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_file_Error_1_0_FULL_NAME_ "uavcan.file.Error" -#define uavcan_file_Error_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Error.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Error_1_0_EXTENT_BYTES_ 2UL -#define uavcan_file_Error_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_file_Error_1_0_EXTENT_BYTES_ >= uavcan_file_Error_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 OK = 0 -#define uavcan_file_Error_1_0_OK (0U) -/// saturated uint16 UNKNOWN_ERROR = 65535 -#define uavcan_file_Error_1_0_UNKNOWN_ERROR (65535U) -/// saturated uint16 NOT_FOUND = 2 -#define uavcan_file_Error_1_0_NOT_FOUND (2U) -/// saturated uint16 IO_ERROR = 5 -#define uavcan_file_Error_1_0_IO_ERROR (5U) -/// saturated uint16 ACCESS_DENIED = 13 -#define uavcan_file_Error_1_0_ACCESS_DENIED (13U) -/// saturated uint16 IS_DIRECTORY = 21 -#define uavcan_file_Error_1_0_IS_DIRECTORY (21U) -/// saturated uint16 INVALID_VALUE = 22 -#define uavcan_file_Error_1_0_INVALID_VALUE (22U) -/// saturated uint16 FILE_TOO_LARGE = 27 -#define uavcan_file_Error_1_0_FILE_TOO_LARGE (27U) -/// saturated uint16 OUT_OF_SPACE = 28 -#define uavcan_file_Error_1_0_OUT_OF_SPACE (28U) -/// saturated uint16 NOT_SUPPORTED = 38 -#define uavcan_file_Error_1_0_NOT_SUPPORTED (38U) - -typedef struct -{ - /// saturated uint16 value - uint16_t value; -} uavcan_file_Error_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Error_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Error_1_0_serialize_( - const uavcan_file_Error_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Error_1_0_deserialize_( - uavcan_file_Error_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Error_1_0_initialize_(uavcan_file_Error_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Error_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_ERROR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_1.h b/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_1.h deleted file mode 100644 index 58353e8ce..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_1.h +++ /dev/null @@ -1,601 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.312259 UTC -// Is deprecated: yes -// Fixed port-ID: 405 -// Full name: uavcan.file.GetInfo -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_GET_INFO_0_1_INCLUDED_ -#define UAVCAN_FILE_GET_INFO_0_1_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_GetInfo_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_file_GetInfo_0_1_FIXED_PORT_ID_ 405U - -#define uavcan_file_GetInfo_0_1_FULL_NAME_ "uavcan.file.GetInfo" -#define uavcan_file_GetInfo_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.0.1" - -#define uavcan_file_GetInfo_Request_0_1_FULL_NAME_ "uavcan.file.GetInfo.Request" -#define uavcan_file_GetInfo_Request_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.Request.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_GetInfo_Request_0_1_EXTENT_BYTES_ 300UL -#define uavcan_file_GetInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 113UL -static_assert(uavcan_file_GetInfo_Request_0_1_EXTENT_BYTES_ >= uavcan_file_GetInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Path.1.0 path - uavcan_file_Path_1_0 path; -} uavcan_file_GetInfo_Request_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_GetInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Request_0_1_serialize_( - const uavcan_file_GetInfo_Request_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 904UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Path.1.0 path - size_t _size_bytes0_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_file_Path_1_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Request_0_1_deserialize_( - uavcan_file_GetInfo_Request_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Path.1.0 path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_GetInfo_Request_0_1_initialize_(uavcan_file_GetInfo_Request_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_GetInfo_Request_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_GetInfo_Response_0_1_FULL_NAME_ "uavcan.file.GetInfo.Response" -#define uavcan_file_GetInfo_Response_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.Response.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_GetInfo_Response_0_1_EXTENT_BYTES_ 48UL -#define uavcan_file_GetInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 13UL -static_assert(uavcan_file_GetInfo_Response_0_1_EXTENT_BYTES_ >= uavcan_file_GetInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; - - /// truncated uint40 size - uint64_t size; - - /// truncated uint40 unix_timestamp_of_last_modification - uint64_t unix_timestamp_of_last_modification; - - /// saturated bool is_file_not_directory - bool is_file_not_directory; - - /// saturated bool is_link - bool is_link; - - /// saturated bool is_readable - bool is_readable; - - /// saturated bool is_writeable - bool is_writeable; -} uavcan_file_GetInfo_Response_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_GetInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Response_0_1_serialize_( - const uavcan_file_GetInfo_Response_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 104UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - - - { // truncated uint40 size - (void) memmove(&buffer[offset_bits / 8U], &obj->size, 5U); - offset_bits += 40U; - } - - - - - { // truncated uint40 unix_timestamp_of_last_modification - (void) memmove(&buffer[offset_bits / 8U], &obj->unix_timestamp_of_last_modification, 5U); - offset_bits += 40U; - } - - - - - { // saturated bool is_file_not_directory - buffer[offset_bits / 8U] = obj->is_file_not_directory ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool is_link - if (obj->is_link) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_readable - if (obj->is_readable) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_writeable - if (obj->is_writeable) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void4 - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 4U); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 4UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Response_0_1_deserialize_( - uavcan_file_GetInfo_Response_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // truncated uint40 size - out_obj->size = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // truncated uint40 unix_timestamp_of_last_modification - out_obj->unix_timestamp_of_last_modification = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // saturated bool is_file_not_directory - if (offset_bits < capacity_bits) - { - out_obj->is_file_not_directory = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->is_file_not_directory = false; - } - offset_bits += 1U; - - - - - // saturated bool is_link - if (offset_bits < capacity_bits) - { - out_obj->is_link = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_link = false; - } - offset_bits += 1U; - - - - - // saturated bool is_readable - if (offset_bits < capacity_bits) - { - out_obj->is_readable = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_readable = false; - } - offset_bits += 1U; - - - - - // saturated bool is_writeable - if (offset_bits < capacity_bits) - { - out_obj->is_writeable = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_writeable = false; - } - offset_bits += 1U; - - - - - // void4 - offset_bits += 4; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_GetInfo_Response_0_1_initialize_(uavcan_file_GetInfo_Response_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_GetInfo_Response_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_GET_INFO_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_2.h b/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_2.h deleted file mode 100644 index 2165f4383..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/GetInfo_0_2.h +++ /dev/null @@ -1,592 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.312259 UTC -// Is deprecated: no -// Fixed port-ID: 405 -// Full name: uavcan.file.GetInfo -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_GET_INFO_0_2_INCLUDED_ -#define UAVCAN_FILE_GET_INFO_0_2_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/405.GetInfo.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_GetInfo_0_2_HAS_FIXED_PORT_ID_ true -#define uavcan_file_GetInfo_0_2_FIXED_PORT_ID_ 405U - -#define uavcan_file_GetInfo_0_2_FULL_NAME_ "uavcan.file.GetInfo" -#define uavcan_file_GetInfo_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.0.2" - -#define uavcan_file_GetInfo_Request_0_2_FULL_NAME_ "uavcan.file.GetInfo.Request" -#define uavcan_file_GetInfo_Request_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.Request.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_GetInfo_Request_0_2_EXTENT_BYTES_ 300UL -#define uavcan_file_GetInfo_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 256UL -static_assert(uavcan_file_GetInfo_Request_0_2_EXTENT_BYTES_ >= uavcan_file_GetInfo_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Path.2.0 path - uavcan_file_Path_2_0 path; -} uavcan_file_GetInfo_Request_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_GetInfo_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Request_0_2_serialize_( - const uavcan_file_GetInfo_Request_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2048UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Path.2.0 path - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_file_Path_2_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Request_0_2_deserialize_( - uavcan_file_GetInfo_Request_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Path.2.0 path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_GetInfo_Request_0_2_initialize_(uavcan_file_GetInfo_Request_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_GetInfo_Request_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_GetInfo_Response_0_2_FULL_NAME_ "uavcan.file.GetInfo.Response" -#define uavcan_file_GetInfo_Response_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.GetInfo.Response.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_GetInfo_Response_0_2_EXTENT_BYTES_ 48UL -#define uavcan_file_GetInfo_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 13UL -static_assert(uavcan_file_GetInfo_Response_0_2_EXTENT_BYTES_ >= uavcan_file_GetInfo_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; - - /// truncated uint40 size - uint64_t size; - - /// truncated uint40 unix_timestamp_of_last_modification - uint64_t unix_timestamp_of_last_modification; - - /// saturated bool is_file_not_directory - bool is_file_not_directory; - - /// saturated bool is_link - bool is_link; - - /// saturated bool is_readable - bool is_readable; - - /// saturated bool is_writeable - bool is_writeable; -} uavcan_file_GetInfo_Response_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_GetInfo_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Response_0_2_serialize_( - const uavcan_file_GetInfo_Response_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 104UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - - - { // truncated uint40 size - (void) memmove(&buffer[offset_bits / 8U], &obj->size, 5U); - offset_bits += 40U; - } - - - - - { // truncated uint40 unix_timestamp_of_last_modification - (void) memmove(&buffer[offset_bits / 8U], &obj->unix_timestamp_of_last_modification, 5U); - offset_bits += 40U; - } - - - - - { // saturated bool is_file_not_directory - buffer[offset_bits / 8U] = obj->is_file_not_directory ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool is_link - if (obj->is_link) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_readable - if (obj->is_readable) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // saturated bool is_writeable - if (obj->is_writeable) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void4 - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 4U); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += 4UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_GetInfo_Response_0_2_deserialize_( - uavcan_file_GetInfo_Response_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // truncated uint40 size - out_obj->size = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // truncated uint40 unix_timestamp_of_last_modification - out_obj->unix_timestamp_of_last_modification = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // saturated bool is_file_not_directory - if (offset_bits < capacity_bits) - { - out_obj->is_file_not_directory = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->is_file_not_directory = false; - } - offset_bits += 1U; - - - - - // saturated bool is_link - if (offset_bits < capacity_bits) - { - out_obj->is_link = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_link = false; - } - offset_bits += 1U; - - - - - // saturated bool is_readable - if (offset_bits < capacity_bits) - { - out_obj->is_readable = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_readable = false; - } - offset_bits += 1U; - - - - - // saturated bool is_writeable - if (offset_bits < capacity_bits) - { - out_obj->is_writeable = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->is_writeable = false; - } - offset_bits += 1U; - - - - - // void4 - offset_bits += 4; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_GetInfo_Response_0_2_initialize_(uavcan_file_GetInfo_Response_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_GetInfo_Response_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_GET_INFO_0_2_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/List_0_1.h b/platformio/stima_v4/libraries/include/uavcan/file/List_0_1.h deleted file mode 100644 index 3a0610d61..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/List_0_1.h +++ /dev/null @@ -1,490 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.328062 UTC -// Is deprecated: yes -// Fixed port-ID: 406 -// Full name: uavcan.file.List -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_LIST_0_1_INCLUDED_ -#define UAVCAN_FILE_LIST_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_List_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_file_List_0_1_FIXED_PORT_ID_ 406U - -#define uavcan_file_List_0_1_FULL_NAME_ "uavcan.file.List" -#define uavcan_file_List_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.List.0.1" - -#define uavcan_file_List_Request_0_1_FULL_NAME_ "uavcan.file.List.Request" -#define uavcan_file_List_Request_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.List.Request.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_List_Request_0_1_EXTENT_BYTES_ 300UL -#define uavcan_file_List_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 121UL -static_assert(uavcan_file_List_Request_0_1_EXTENT_BYTES_ >= uavcan_file_List_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 entry_index - uint32_t entry_index; - - /// uavcan.file.Path.1.0 directory_path - uavcan_file_Path_1_0 directory_path; -} uavcan_file_List_Request_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_List_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Request_0_1_serialize_( - const uavcan_file_List_Request_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 968UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 entry_index - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->entry_index, 4U); - offset_bits += 32U; - } - - - - - { // void32 - (void) memset(&buffer[offset_bits / 8U], 0, 4); - offset_bits += 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.1.0 directory_path - size_t _size_bytes0_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_1_0_serialize_( - &obj->directory_path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Request_0_1_deserialize_( - uavcan_file_List_Request_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 entry_index - out_obj->entry_index = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // void32 - offset_bits += 32; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 directory_path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->directory_path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_List_Request_0_1_initialize_(uavcan_file_List_Request_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_List_Request_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_List_Response_0_1_FULL_NAME_ "uavcan.file.List.Response" -#define uavcan_file_List_Response_0_1_FULL_NAME_AND_VERSION_ "uavcan.file.List.Response.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_List_Response_0_1_EXTENT_BYTES_ 300UL -#define uavcan_file_List_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 117UL -static_assert(uavcan_file_List_Response_0_1_EXTENT_BYTES_ >= uavcan_file_List_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Path.1.0 entry_base_name - uavcan_file_Path_1_0 entry_base_name; -} uavcan_file_List_Response_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_List_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Response_0_1_serialize_( - const uavcan_file_List_Response_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 936UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // void32 - (void) memset(&buffer[offset_bits / 8U], 0, 4); - offset_bits += 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - - { // uavcan.file.Path.1.0 entry_base_name - size_t _size_bytes2_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err5_ = uavcan_file_Path_1_0_serialize_( - &obj->entry_base_name, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err5_ < 0) - { - return _err5_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Response_0_1_deserialize_( - uavcan_file_List_Response_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // void32 - offset_bits += 32; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 entry_base_name - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->entry_base_name, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_List_Response_0_1_initialize_(uavcan_file_List_Response_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_List_Response_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_LIST_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/List_0_2.h b/platformio/stima_v4/libraries/include/uavcan/file/List_0_2.h deleted file mode 100644 index 3b2efb656..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/List_0_2.h +++ /dev/null @@ -1,481 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.328062 UTC -// Is deprecated: no -// Fixed port-ID: 406 -// Full name: uavcan.file.List -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_LIST_0_2_INCLUDED_ -#define UAVCAN_FILE_LIST_0_2_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/406.List.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_List_0_2_HAS_FIXED_PORT_ID_ true -#define uavcan_file_List_0_2_FIXED_PORT_ID_ 406U - -#define uavcan_file_List_0_2_FULL_NAME_ "uavcan.file.List" -#define uavcan_file_List_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.List.0.2" - -#define uavcan_file_List_Request_0_2_FULL_NAME_ "uavcan.file.List.Request" -#define uavcan_file_List_Request_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.List.Request.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_List_Request_0_2_EXTENT_BYTES_ 300UL -#define uavcan_file_List_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 264UL -static_assert(uavcan_file_List_Request_0_2_EXTENT_BYTES_ >= uavcan_file_List_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 entry_index - uint32_t entry_index; - - /// uavcan.file.Path.2.0 directory_path - uavcan_file_Path_2_0 directory_path; -} uavcan_file_List_Request_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_List_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Request_0_2_serialize_( - const uavcan_file_List_Request_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2112UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 entry_index - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->entry_index, 4U); - offset_bits += 32U; - } - - - - - { // void32 - (void) memset(&buffer[offset_bits / 8U], 0, 4); - offset_bits += 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.2.0 directory_path - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_2_0_serialize_( - &obj->directory_path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Request_0_2_deserialize_( - uavcan_file_List_Request_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 entry_index - out_obj->entry_index = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // void32 - offset_bits += 32; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 directory_path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->directory_path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_List_Request_0_2_initialize_(uavcan_file_List_Request_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_List_Request_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_List_Response_0_2_FULL_NAME_ "uavcan.file.List.Response" -#define uavcan_file_List_Response_0_2_FULL_NAME_AND_VERSION_ "uavcan.file.List.Response.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_List_Response_0_2_EXTENT_BYTES_ 300UL -#define uavcan_file_List_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 260UL -static_assert(uavcan_file_List_Response_0_2_EXTENT_BYTES_ >= uavcan_file_List_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Path.2.0 entry_base_name - uavcan_file_Path_2_0 entry_base_name; -} uavcan_file_List_Response_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_List_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Response_0_2_serialize_( - const uavcan_file_List_Response_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2080UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // void32 - (void) memset(&buffer[offset_bits / 8U], 0, 4); - offset_bits += 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - - { // uavcan.file.Path.2.0 entry_base_name - size_t _size_bytes2_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err5_ = uavcan_file_Path_2_0_serialize_( - &obj->entry_base_name, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err5_ < 0) - { - return _err5_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err6_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_List_Response_0_2_deserialize_( - uavcan_file_List_Response_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // void32 - offset_bits += 32; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 entry_base_name - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->entry_base_name, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_List_Response_0_2_initialize_(uavcan_file_List_Response_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_List_Response_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_LIST_0_2_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_0.h deleted file mode 100644 index 539d195d9..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_0.h +++ /dev/null @@ -1,551 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.343525 UTC -// Is deprecated: yes -// Fixed port-ID: 407 -// Full name: uavcan.file.Modify -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_MODIFY_1_0_INCLUDED_ -#define UAVCAN_FILE_MODIFY_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Modify_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Modify_1_0_FIXED_PORT_ID_ 407U - -#define uavcan_file_Modify_1_0_FULL_NAME_ "uavcan.file.Modify" -#define uavcan_file_Modify_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.1.0" - -#define uavcan_file_Modify_Request_1_0_FULL_NAME_ "uavcan.file.Modify.Request" -#define uavcan_file_Modify_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Modify_Request_1_0_EXTENT_BYTES_ 600UL -#define uavcan_file_Modify_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 230UL -static_assert(uavcan_file_Modify_Request_1_0_EXTENT_BYTES_ >= uavcan_file_Modify_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated bool preserve_source - bool preserve_source; - - /// saturated bool overwrite_destination - bool overwrite_destination; - - /// uavcan.file.Path.1.0 source - uavcan_file_Path_1_0 source; - - /// uavcan.file.Path.1.0 destination - uavcan_file_Path_1_0 destination; -} uavcan_file_Modify_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Modify_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Request_1_0_serialize_( - const uavcan_file_Modify_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 1840UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated bool preserve_source - buffer[offset_bits / 8U] = obj->preserve_source ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool overwrite_destination - if (obj->overwrite_destination) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void30 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 30U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 30UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.1.0 source - size_t _size_bytes0_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_file_Path_1_0_serialize_( - &obj->source, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.file.Path.1.0 destination - size_t _size_bytes1_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_file_Path_1_0_serialize_( - &obj->destination, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Request_1_0_deserialize_( - uavcan_file_Modify_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated bool preserve_source - if (offset_bits < capacity_bits) - { - out_obj->preserve_source = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->preserve_source = false; - } - offset_bits += 1U; - - - - - // saturated bool overwrite_destination - if (offset_bits < capacity_bits) - { - out_obj->overwrite_destination = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->overwrite_destination = false; - } - offset_bits += 1U; - - - - - // void30 - offset_bits += 30; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 source - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->source, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 destination - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->destination, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Modify_Request_1_0_initialize_(uavcan_file_Modify_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Modify_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Modify_Response_1_0_FULL_NAME_ "uavcan.file.Modify.Response" -#define uavcan_file_Modify_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Modify_Response_1_0_EXTENT_BYTES_ 48UL -#define uavcan_file_Modify_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_file_Modify_Response_1_0_EXTENT_BYTES_ >= uavcan_file_Modify_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; -} uavcan_file_Modify_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Modify_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Response_1_0_serialize_( - const uavcan_file_Modify_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes4_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err8_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Response_1_0_deserialize_( - uavcan_file_Modify_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Modify_Response_1_0_initialize_(uavcan_file_Modify_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Modify_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_MODIFY_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_1.h b/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_1.h deleted file mode 100644 index 852b59ffa..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Modify_1_1.h +++ /dev/null @@ -1,542 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl -// Generated at: 2023-07-11 16:47:49.328062 UTC -// Is deprecated: no -// Fixed port-ID: 407 -// Full name: uavcan.file.Modify -// Version: 1.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_MODIFY_1_1_INCLUDED_ -#define UAVCAN_FILE_MODIFY_1_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/407.Modify.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Modify_1_1_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Modify_1_1_FIXED_PORT_ID_ 407U - -#define uavcan_file_Modify_1_1_FULL_NAME_ "uavcan.file.Modify" -#define uavcan_file_Modify_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.1.1" - -#define uavcan_file_Modify_Request_1_1_FULL_NAME_ "uavcan.file.Modify.Request" -#define uavcan_file_Modify_Request_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.Request.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Modify_Request_1_1_EXTENT_BYTES_ 600UL -#define uavcan_file_Modify_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 516UL -static_assert(uavcan_file_Modify_Request_1_1_EXTENT_BYTES_ >= uavcan_file_Modify_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated bool preserve_source - bool preserve_source; - - /// saturated bool overwrite_destination - bool overwrite_destination; - - /// uavcan.file.Path.2.0 source - uavcan_file_Path_2_0 source; - - /// uavcan.file.Path.2.0 destination - uavcan_file_Path_2_0 destination; -} uavcan_file_Modify_Request_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Modify_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Request_1_1_serialize_( - const uavcan_file_Modify_Request_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 4128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated bool preserve_source - buffer[offset_bits / 8U] = obj->preserve_source ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool overwrite_destination - if (obj->overwrite_destination) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void30 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 30U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 30UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.2.0 source - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_file_Path_2_0_serialize_( - &obj->source, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.file.Path.2.0 destination - size_t _size_bytes1_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_file_Path_2_0_serialize_( - &obj->destination, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Request_1_1_deserialize_( - uavcan_file_Modify_Request_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated bool preserve_source - if (offset_bits < capacity_bits) - { - out_obj->preserve_source = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->preserve_source = false; - } - offset_bits += 1U; - - - - - // saturated bool overwrite_destination - if (offset_bits < capacity_bits) - { - out_obj->overwrite_destination = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->overwrite_destination = false; - } - offset_bits += 1U; - - - - - // void30 - offset_bits += 30; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 source - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->source, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 destination - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->destination, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Modify_Request_1_1_initialize_(uavcan_file_Modify_Request_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Modify_Request_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Modify_Response_1_1_FULL_NAME_ "uavcan.file.Modify.Response" -#define uavcan_file_Modify_Response_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Modify.Response.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Modify_Response_1_1_EXTENT_BYTES_ 48UL -#define uavcan_file_Modify_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_file_Modify_Response_1_1_EXTENT_BYTES_ >= uavcan_file_Modify_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; -} uavcan_file_Modify_Response_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Modify_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Response_1_1_serialize_( - const uavcan_file_Modify_Response_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes4_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err8_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err9_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Modify_Response_1_1_deserialize_( - uavcan_file_Modify_Response_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err10_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err10_ < 0) - { - return _err10_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Modify_Response_1_1_initialize_(uavcan_file_Modify_Response_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Modify_Response_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_MODIFY_1_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Path_1_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Path_1_0.h deleted file mode 100644 index 6661c0e69..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Path_1_0.h +++ /dev/null @@ -1,269 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.359152 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.file.Path -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_PATH_1_0_INCLUDED_ -#define UAVCAN_FILE_PATH_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_file_Path_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_file_Path_1_0_FULL_NAME_ "uavcan.file.Path" -#define uavcan_file_Path_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Path.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Path_1_0_EXTENT_BYTES_ 113UL -#define uavcan_file_Path_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 113UL -static_assert(uavcan_file_Path_1_0_EXTENT_BYTES_ >= uavcan_file_Path_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 SEPARATOR = 47 -#define uavcan_file_Path_1_0_SEPARATOR (47U) -/// saturated uint8 MAX_LENGTH = 112 -#define uavcan_file_Path_1_0_MAX_LENGTH (112U) - -/// Array metadata for: saturated uint8[<=112] path -#define uavcan_file_Path_1_0_path_ARRAY_CAPACITY_ 112U -#define uavcan_file_Path_1_0_path_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=112] path - struct /// Array address equivalence guarantee: &elements[0] == &path - { - uint8_t elements[uavcan_file_Path_1_0_path_ARRAY_CAPACITY_]; - size_t count; - } path; -} uavcan_file_Path_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Path_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Path_1_0_serialize_( - const uavcan_file_Path_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 904UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=112] path - if (obj->path.count > 112) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->path.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->path.count * 8U, &obj->path.elements[0], 0U); - offset_bits += obj->path.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Path_1_0_deserialize_( - uavcan_file_Path_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=112] path - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->path.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->path.count = 0U; - } - offset_bits += 8U; - if (out_obj->path.count > 112U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->path.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->path.count * 8U); - offset_bits += out_obj->path.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Path_1_0_initialize_(uavcan_file_Path_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Path_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_PATH_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Path_2_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Path_2_0.h deleted file mode 100644 index 1374f816f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Path_2_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl -// Generated at: 2023-07-11 16:47:49.343525 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.file.Path -// Version: 2.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_PATH_2_0_INCLUDED_ -#define UAVCAN_FILE_PATH_2_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/Path.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_file_Path_2_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_file_Path_2_0_FULL_NAME_ "uavcan.file.Path" -#define uavcan_file_Path_2_0_FULL_NAME_AND_VERSION_ "uavcan.file.Path.2.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Path_2_0_EXTENT_BYTES_ 256UL -#define uavcan_file_Path_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 256UL -static_assert(uavcan_file_Path_2_0_EXTENT_BYTES_ >= uavcan_file_Path_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 SEPARATOR = 47 -#define uavcan_file_Path_2_0_SEPARATOR (47U) -/// saturated uint8 MAX_LENGTH = 255 -#define uavcan_file_Path_2_0_MAX_LENGTH (255U) - -/// Array metadata for: saturated uint8[<=255] path -#define uavcan_file_Path_2_0_path_ARRAY_CAPACITY_ 255U -#define uavcan_file_Path_2_0_path_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=255] path - struct /// Array address equivalence guarantee: &elements[0] == &path - { - uint8_t elements[uavcan_file_Path_2_0_path_ARRAY_CAPACITY_]; - size_t count; - } path; -} uavcan_file_Path_2_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Path_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Path_2_0_serialize_( - const uavcan_file_Path_2_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2048UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=255] path - if (obj->path.count > 255) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->path.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->path.count * 8U, &obj->path.elements[0], 0U); - offset_bits += obj->path.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Path_2_0_deserialize_( - uavcan_file_Path_2_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=255] path - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->path.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->path.count = 0U; - } - offset_bits += 8U; - if (out_obj->path.count > 255U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->path.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->path.count * 8U); - offset_bits += out_obj->path.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Path_2_0_initialize_(uavcan_file_Path_2_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Path_2_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_PATH_2_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Read_1_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Read_1_0.h deleted file mode 100644 index 46cc49849..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Read_1_0.h +++ /dev/null @@ -1,494 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.359152 UTC -// Is deprecated: yes -// Fixed port-ID: 408 -// Full name: uavcan.file.Read -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_READ_1_0_INCLUDED_ -#define UAVCAN_FILE_READ_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Read_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Read_1_0_FIXED_PORT_ID_ 408U - -#define uavcan_file_Read_1_0_FULL_NAME_ "uavcan.file.Read" -#define uavcan_file_Read_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Read.1.0" - -#define uavcan_file_Read_Request_1_0_FULL_NAME_ "uavcan.file.Read.Request" -#define uavcan_file_Read_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Read.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Read_Request_1_0_EXTENT_BYTES_ 300UL -#define uavcan_file_Read_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 118UL -static_assert(uavcan_file_Read_Request_1_0_EXTENT_BYTES_ >= uavcan_file_Read_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint40 offset - uint64_t offset; - - /// uavcan.file.Path.1.0 path - uavcan_file_Path_1_0 path; -} uavcan_file_Read_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Read_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Request_1_0_serialize_( - const uavcan_file_Read_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 944UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint40 offset - (void) memmove(&buffer[offset_bits / 8U], &obj->offset, 5U); - offset_bits += 40U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.1.0 path - size_t _size_bytes0_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_1_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Request_1_0_deserialize_( - uavcan_file_Read_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint40 offset - out_obj->offset = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Read_Request_1_0_initialize_(uavcan_file_Read_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Read_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Read_Response_1_0_FULL_NAME_ "uavcan.file.Read.Response" -#define uavcan_file_Read_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Read.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Read_Response_1_0_EXTENT_BYTES_ 300UL -#define uavcan_file_Read_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 260UL -static_assert(uavcan_file_Read_Response_1_0_EXTENT_BYTES_ >= uavcan_file_Read_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=256] data -#define uavcan_file_Read_Response_1_0_data_ARRAY_CAPACITY_ 256U -#define uavcan_file_Read_Response_1_0_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; - - /// saturated uint8[<=256] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_file_Read_Response_1_0_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_file_Read_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Read_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Response_1_0_serialize_( - const uavcan_file_Read_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2080UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=256] data - if (obj->data.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->data.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Response_1_0_deserialize_( - uavcan_file_Read_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=256] data - // Array length prefix: truncated uint16 - out_obj->data.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->data.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Read_Response_1_0_initialize_(uavcan_file_Read_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Read_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_READ_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Read_1_1.h b/platformio/stima_v4/libraries/include/uavcan/file/Read_1_1.h deleted file mode 100644 index 9dafc74ae..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Read_1_1.h +++ /dev/null @@ -1,487 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl -// Generated at: 2023-07-11 16:47:49.359152 UTC -// Is deprecated: no -// Fixed port-ID: 408 -// Full name: uavcan.file.Read -// Version: 1.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_READ_1_1_INCLUDED_ -#define UAVCAN_FILE_READ_1_1_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/408.Read.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Read_1_1_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Read_1_1_FIXED_PORT_ID_ 408U - -#define uavcan_file_Read_1_1_FULL_NAME_ "uavcan.file.Read" -#define uavcan_file_Read_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Read.1.1" - -#define uavcan_file_Read_Request_1_1_FULL_NAME_ "uavcan.file.Read.Request" -#define uavcan_file_Read_Request_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Read.Request.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Read_Request_1_1_EXTENT_BYTES_ 300UL -#define uavcan_file_Read_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 261UL -static_assert(uavcan_file_Read_Request_1_1_EXTENT_BYTES_ >= uavcan_file_Read_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint40 offset - uint64_t offset; - - /// uavcan.file.Path.2.0 path - uavcan_file_Path_2_0 path; -} uavcan_file_Read_Request_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Read_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Request_1_1_serialize_( - const uavcan_file_Read_Request_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2088UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint40 offset - (void) memmove(&buffer[offset_bits / 8U], &obj->offset, 5U); - offset_bits += 40U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.2.0 path - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_2_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Request_1_1_deserialize_( - uavcan_file_Read_Request_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint40 offset - out_obj->offset = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Read_Request_1_1_initialize_(uavcan_file_Read_Request_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Read_Request_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Read_Response_1_1_FULL_NAME_ "uavcan.file.Read.Response" -#define uavcan_file_Read_Response_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Read.Response.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Read_Response_1_1_EXTENT_BYTES_ 300UL -#define uavcan_file_Read_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 260UL -static_assert(uavcan_file_Read_Response_1_1_EXTENT_BYTES_ >= uavcan_file_Read_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; - - /// uavcan.primitive.Unstructured.1.0 data - uavcan_primitive_Unstructured_1_0 data; -} uavcan_file_Read_Response_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Read_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Response_1_1_serialize_( - const uavcan_file_Read_Response_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2080UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // uavcan.primitive.Unstructured.1.0 data - size_t _size_bytes3_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err6_ = uavcan_primitive_Unstructured_1_0_serialize_( - &obj->data, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Read_Response_1_1_deserialize_( - uavcan_file_Read_Response_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.Unstructured.1.0 data - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err9_ = uavcan_primitive_Unstructured_1_0_deserialize_( - &out_obj->data, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Read_Response_1_1_initialize_(uavcan_file_Read_Response_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Read_Response_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_READ_1_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Write_1_0.h b/platformio/stima_v4/libraries/include/uavcan/file/Write_1_0.h deleted file mode 100644 index 3f77b4281..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Write_1_0.h +++ /dev/null @@ -1,500 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.375375 UTC -// Is deprecated: yes -// Fixed port-ID: 409 -// Full name: uavcan.file.Write -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_FILE_WRITE_1_0_INCLUDED_ -#define UAVCAN_FILE_WRITE_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Write_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Write_1_0_FIXED_PORT_ID_ 409U - -#define uavcan_file_Write_1_0_FULL_NAME_ "uavcan.file.Write" -#define uavcan_file_Write_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Write.1.0" - -#define uavcan_file_Write_Request_1_0_FULL_NAME_ "uavcan.file.Write.Request" -#define uavcan_file_Write_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Write.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Write_Request_1_0_EXTENT_BYTES_ 600UL -#define uavcan_file_Write_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 311UL -static_assert(uavcan_file_Write_Request_1_0_EXTENT_BYTES_ >= uavcan_file_Write_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=192] data -#define uavcan_file_Write_Request_1_0_data_ARRAY_CAPACITY_ 192U -#define uavcan_file_Write_Request_1_0_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// truncated uint40 offset - uint64_t offset; - - /// uavcan.file.Path.1.0 path - uavcan_file_Path_1_0 path; - - /// saturated uint8[<=192] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_file_Write_Request_1_0_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_file_Write_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Write_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Request_1_0_serialize_( - const uavcan_file_Write_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2488UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint40 offset - (void) memmove(&buffer[offset_bits / 8U], &obj->offset, 5U); - offset_bits += 40U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.1.0 path - size_t _size_bytes0_ = 113UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_1_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=192] data - if (obj->data.count > 192) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->data.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Request_1_0_deserialize_( - uavcan_file_Write_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint40 offset - out_obj->offset = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.1.0 path - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_file_Path_1_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=192] data - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->data.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->data.count = 0U; - } - offset_bits += 8U; - if (out_obj->data.count > 192U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Write_Request_1_0_initialize_(uavcan_file_Write_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Write_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Write_Response_1_0_FULL_NAME_ "uavcan.file.Write.Response" -#define uavcan_file_Write_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.file.Write.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Write_Response_1_0_EXTENT_BYTES_ 48UL -#define uavcan_file_Write_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_file_Write_Response_1_0_EXTENT_BYTES_ >= uavcan_file_Write_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; -} uavcan_file_Write_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Write_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Response_1_0_serialize_( - const uavcan_file_Write_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Response_1_0_deserialize_( - uavcan_file_Write_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Write_Response_1_0_initialize_(uavcan_file_Write_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Write_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_WRITE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/file/Write_1_1.h b/platformio/stima_v4/libraries/include/uavcan/file/Write_1_1.h deleted file mode 100644 index 3c683571d..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/file/Write_1_1.h +++ /dev/null @@ -1,486 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl -// Generated at: 2023-07-11 16:47:49.375375 UTC -// Is deprecated: no -// Fixed port-ID: 409 -// Full name: uavcan.file.Write -// Version: 1.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_FILE_WRITE_1_1_INCLUDED_ -#define UAVCAN_FILE_WRITE_1_1_INCLUDED_ - -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/file/409.Write.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_file_Write_1_1_HAS_FIXED_PORT_ID_ true -#define uavcan_file_Write_1_1_FIXED_PORT_ID_ 409U - -#define uavcan_file_Write_1_1_FULL_NAME_ "uavcan.file.Write" -#define uavcan_file_Write_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Write.1.1" - -#define uavcan_file_Write_Request_1_1_FULL_NAME_ "uavcan.file.Write.Request" -#define uavcan_file_Write_Request_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Write.Request.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Write_Request_1_1_EXTENT_BYTES_ 600UL -#define uavcan_file_Write_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 519UL -static_assert(uavcan_file_Write_Request_1_1_EXTENT_BYTES_ >= uavcan_file_Write_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint40 offset - uint64_t offset; - - /// uavcan.file.Path.2.0 path - uavcan_file_Path_2_0 path; - - /// uavcan.primitive.Unstructured.1.0 data - uavcan_primitive_Unstructured_1_0 data; -} uavcan_file_Write_Request_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Write_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Request_1_1_serialize_( - const uavcan_file_Write_Request_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 4152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint40 offset - (void) memmove(&buffer[offset_bits / 8U], &obj->offset, 5U); - offset_bits += 40U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.file.Path.2.0 path - size_t _size_bytes0_ = 256UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_file_Path_2_0_serialize_( - &obj->path, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - - { // uavcan.primitive.Unstructured.1.0 data - size_t _size_bytes1_ = 258UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_primitive_Unstructured_1_0_serialize_( - &obj->data, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Request_1_1_deserialize_( - uavcan_file_Write_Request_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint40 offset - out_obj->offset = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.file.Path.2.0 path - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_file_Path_2_0_deserialize_( - &out_obj->path, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.primitive.Unstructured.1.0 data - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_primitive_Unstructured_1_0_deserialize_( - &out_obj->data, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Write_Request_1_1_initialize_(uavcan_file_Write_Request_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Write_Request_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_file_Write_Response_1_1_FULL_NAME_ "uavcan.file.Write.Response" -#define uavcan_file_Write_Response_1_1_FULL_NAME_AND_VERSION_ "uavcan.file.Write.Response.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_file_Write_Response_1_1_EXTENT_BYTES_ 48UL -#define uavcan_file_Write_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_file_Write_Response_1_1_EXTENT_BYTES_ >= uavcan_file_Write_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.file.Error.1.0 error - uavcan_file_Error_1_0 _error; -} uavcan_file_Write_Response_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_file_Write_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Response_1_1_serialize_( - const uavcan_file_Write_Response_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.file.Error.1.0 error - size_t _size_bytes4_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err7_ = uavcan_file_Error_1_0_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err8_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_file_Write_Response_1_1_deserialize_( - uavcan_file_Write_Response_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.file.Error.1.0 error - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err9_ = uavcan_file_Error_1_0_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_file_Write_Response_1_1_initialize_(uavcan_file_Write_Response_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_file_Write_Response_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_FILE_WRITE_1_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_1.h b/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_1.h deleted file mode 100644 index 2c6bb5422..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_1.h +++ /dev/null @@ -1,382 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.986901 UTC -// Is deprecated: yes -// Fixed port-ID: 500 -// Full name: uavcan.internet.udp.HandleIncomingPacket -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_1_INCLUDED_ -#define UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_internet_udp_HandleIncomingPacket_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_internet_udp_HandleIncomingPacket_0_1_FIXED_PORT_ID_ 500U - -#define uavcan_internet_udp_HandleIncomingPacket_0_1_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket" -#define uavcan_internet_udp_HandleIncomingPacket_0_1_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.0.1" - -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket.Request" -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.Request.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_EXTENT_BYTES_ 600UL -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 313UL -static_assert(uavcan_internet_udp_HandleIncomingPacket_Request_0_1_EXTENT_BYTES_ >= uavcan_internet_udp_HandleIncomingPacket_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=309] payload -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_payload_ARRAY_CAPACITY_ 309U -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_1_payload_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 session_id - uint16_t session_id; - - /// saturated uint8[<=309] payload - struct /// Array address equivalence guarantee: &elements[0] == &payload - { - uint8_t elements[uavcan_internet_udp_HandleIncomingPacket_Request_0_1_payload_ARRAY_CAPACITY_]; - size_t count; - } payload; -} uavcan_internet_udp_HandleIncomingPacket_Request_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_HandleIncomingPacket_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Request_0_1_serialize_( - const uavcan_internet_udp_HandleIncomingPacket_Request_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2504UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 session_id - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->session_id, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=309] payload - if (obj->payload.count > 309) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->payload.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->payload.count * 8U, &obj->payload.elements[0], 0U); - offset_bits += obj->payload.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Request_0_1_deserialize_( - uavcan_internet_udp_HandleIncomingPacket_Request_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 session_id - out_obj->session_id = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=309] payload - // Array length prefix: truncated uint16 - out_obj->payload.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->payload.count > 309U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->payload.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->payload.count * 8U); - offset_bits += out_obj->payload.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_HandleIncomingPacket_Request_0_1_initialize_(uavcan_internet_udp_HandleIncomingPacket_Request_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_HandleIncomingPacket_Request_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_1_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket.Response" -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_1_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.Response.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_1_EXTENT_BYTES_ 63UL -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_internet_udp_HandleIncomingPacket_Response_0_1_EXTENT_BYTES_ >= uavcan_internet_udp_HandleIncomingPacket_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_internet_udp_HandleIncomingPacket_Response_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_HandleIncomingPacket_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Response_0_1_serialize_( - const uavcan_internet_udp_HandleIncomingPacket_Response_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Response_0_1_deserialize_( - uavcan_internet_udp_HandleIncomingPacket_Response_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_HandleIncomingPacket_Response_0_1_initialize_(uavcan_internet_udp_HandleIncomingPacket_Response_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_HandleIncomingPacket_Response_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_2.h b/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_2.h deleted file mode 100644 index 3a3d8f159..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/internet/udp/HandleIncomingPacket_0_2.h +++ /dev/null @@ -1,373 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.971276 UTC -// Is deprecated: no -// Fixed port-ID: 500 -// Full name: uavcan.internet.udp.HandleIncomingPacket -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_2_INCLUDED_ -#define UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_2_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/500.HandleIncomingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_internet_udp_HandleIncomingPacket_0_2_HAS_FIXED_PORT_ID_ true -#define uavcan_internet_udp_HandleIncomingPacket_0_2_FIXED_PORT_ID_ 500U - -#define uavcan_internet_udp_HandleIncomingPacket_0_2_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket" -#define uavcan_internet_udp_HandleIncomingPacket_0_2_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.0.2" - -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket.Request" -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.Request.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_EXTENT_BYTES_ 600UL -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 512UL -static_assert(uavcan_internet_udp_HandleIncomingPacket_Request_0_2_EXTENT_BYTES_ >= uavcan_internet_udp_HandleIncomingPacket_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=508] payload -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_payload_ARRAY_CAPACITY_ 508U -#define uavcan_internet_udp_HandleIncomingPacket_Request_0_2_payload_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 session_id - uint16_t session_id; - - /// saturated uint8[<=508] payload - struct /// Array address equivalence guarantee: &elements[0] == &payload - { - uint8_t elements[uavcan_internet_udp_HandleIncomingPacket_Request_0_2_payload_ARRAY_CAPACITY_]; - size_t count; - } payload; -} uavcan_internet_udp_HandleIncomingPacket_Request_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_HandleIncomingPacket_Request_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Request_0_2_serialize_( - const uavcan_internet_udp_HandleIncomingPacket_Request_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 4096UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 session_id - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->session_id, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=508] payload - if (obj->payload.count > 508) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->payload.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->payload.count * 8U, &obj->payload.elements[0], 0U); - offset_bits += obj->payload.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Request_0_2_deserialize_( - uavcan_internet_udp_HandleIncomingPacket_Request_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 session_id - out_obj->session_id = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=508] payload - // Array length prefix: truncated uint16 - out_obj->payload.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->payload.count > 508U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->payload.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->payload.count * 8U); - offset_bits += out_obj->payload.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_HandleIncomingPacket_Request_0_2_initialize_(uavcan_internet_udp_HandleIncomingPacket_Request_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_HandleIncomingPacket_Request_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_2_FULL_NAME_ "uavcan.internet.udp.HandleIncomingPacket.Response" -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_2_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.HandleIncomingPacket.Response.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_2_EXTENT_BYTES_ 63UL -#define uavcan_internet_udp_HandleIncomingPacket_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_internet_udp_HandleIncomingPacket_Response_0_2_EXTENT_BYTES_ >= uavcan_internet_udp_HandleIncomingPacket_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_internet_udp_HandleIncomingPacket_Response_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_HandleIncomingPacket_Response_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Response_0_2_serialize_( - const uavcan_internet_udp_HandleIncomingPacket_Response_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_HandleIncomingPacket_Response_0_2_deserialize_( - uavcan_internet_udp_HandleIncomingPacket_Response_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_HandleIncomingPacket_Response_0_2_initialize_(uavcan_internet_udp_HandleIncomingPacket_Response_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_HandleIncomingPacket_Response_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_INTERNET_UDP_HANDLE_INCOMING_PACKET_0_2_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_1.h b/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_1.h deleted file mode 100644 index 4c7dd44ba..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_1.h +++ /dev/null @@ -1,422 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.986901 UTC -// Is deprecated: yes -// Fixed port-ID: 8174 -// Full name: uavcan.internet.udp.OutgoingPacket -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_1_INCLUDED_ -#define UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_internet_udp_OutgoingPacket_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_internet_udp_OutgoingPacket_0_1_FIXED_PORT_ID_ 8174U - -#define uavcan_internet_udp_OutgoingPacket_0_1_FULL_NAME_ "uavcan.internet.udp.OutgoingPacket" -#define uavcan_internet_udp_OutgoingPacket_0_1_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.OutgoingPacket.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_OutgoingPacket_0_1_EXTENT_BYTES_ 600UL -#define uavcan_internet_udp_OutgoingPacket_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 313UL -static_assert(uavcan_internet_udp_OutgoingPacket_0_1_EXTENT_BYTES_ >= uavcan_internet_udp_OutgoingPacket_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint32 NAT_ENTRY_MIN_TTL = 86400 -#define uavcan_internet_udp_OutgoingPacket_0_1_NAT_ENTRY_MIN_TTL (86400UL) - -/// Array metadata for: saturated uint8[<=45] destination_address -#define uavcan_internet_udp_OutgoingPacket_0_1_destination_address_ARRAY_CAPACITY_ 45U -#define uavcan_internet_udp_OutgoingPacket_0_1_destination_address_ARRAY_IS_VARIABLE_LENGTH_ true -/// Array metadata for: saturated uint8[<=260] payload -#define uavcan_internet_udp_OutgoingPacket_0_1_payload_ARRAY_CAPACITY_ 260U -#define uavcan_internet_udp_OutgoingPacket_0_1_payload_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 session_id - uint16_t session_id; - - /// saturated uint16 destination_port - uint16_t destination_port; - - /// saturated uint8[<=45] destination_address - struct /// Array address equivalence guarantee: &elements[0] == &destination_address - { - uint8_t elements[uavcan_internet_udp_OutgoingPacket_0_1_destination_address_ARRAY_CAPACITY_]; - size_t count; - } destination_address; - - /// saturated bool use_masquerading - bool use_masquerading; - - /// saturated bool use_dtls - bool use_dtls; - - /// saturated uint8[<=260] payload - struct /// Array address equivalence guarantee: &elements[0] == &payload - { - uint8_t elements[uavcan_internet_udp_OutgoingPacket_0_1_payload_ARRAY_CAPACITY_]; - size_t count; - } payload; -} uavcan_internet_udp_OutgoingPacket_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_OutgoingPacket_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_OutgoingPacket_0_1_serialize_( - const uavcan_internet_udp_OutgoingPacket_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2504UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 session_id - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->session_id, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint16 destination_port - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->destination_port, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=45] destination_address - if (obj->destination_address.count > 45) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->destination_address.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->destination_address.count * 8U, &obj->destination_address.elements[0], 0U); - offset_bits += obj->destination_address.count * 8U; - } - - - - - { // saturated bool use_masquerading - buffer[offset_bits / 8U] = obj->use_masquerading ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool use_dtls - if (obj->use_dtls) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void6 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 6U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 6UL; - } - - - - - { // saturated uint8[<=260] payload - if (obj->payload.count > 260) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->payload.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->payload.count * 8U, &obj->payload.elements[0], 0U); - offset_bits += obj->payload.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_OutgoingPacket_0_1_deserialize_( - uavcan_internet_udp_OutgoingPacket_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 session_id - out_obj->session_id = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint16 destination_port - out_obj->destination_port = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=45] destination_address - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->destination_address.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->destination_address.count = 0U; - } - offset_bits += 8U; - if (out_obj->destination_address.count > 45U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->destination_address.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->destination_address.count * 8U); - offset_bits += out_obj->destination_address.count * 8U; - - - - - // saturated bool use_masquerading - if (offset_bits < capacity_bits) - { - out_obj->use_masquerading = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->use_masquerading = false; - } - offset_bits += 1U; - - - - - // saturated bool use_dtls - if (offset_bits < capacity_bits) - { - out_obj->use_dtls = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->use_dtls = false; - } - offset_bits += 1U; - - - - - // void6 - offset_bits += 6; - - - - - // saturated uint8[<=260] payload - // Array length prefix: truncated uint16 - out_obj->payload.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->payload.count > 260U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->payload.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->payload.count * 8U); - offset_bits += out_obj->payload.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_OutgoingPacket_0_1_initialize_(uavcan_internet_udp_OutgoingPacket_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_OutgoingPacket_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_2.h b/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_2.h deleted file mode 100644 index f5202d496..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/internet/udp/OutgoingPacket_0_2.h +++ /dev/null @@ -1,413 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.986901 UTC -// Is deprecated: no -// Fixed port-ID: 8174 -// Full name: uavcan.internet.udp.OutgoingPacket -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_2_INCLUDED_ -#define UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_2_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/internet/udp/8174.OutgoingPacket.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_internet_udp_OutgoingPacket_0_2_HAS_FIXED_PORT_ID_ true -#define uavcan_internet_udp_OutgoingPacket_0_2_FIXED_PORT_ID_ 8174U - -#define uavcan_internet_udp_OutgoingPacket_0_2_FULL_NAME_ "uavcan.internet.udp.OutgoingPacket" -#define uavcan_internet_udp_OutgoingPacket_0_2_FULL_NAME_AND_VERSION_ "uavcan.internet.udp.OutgoingPacket.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_internet_udp_OutgoingPacket_0_2_EXTENT_BYTES_ 600UL -#define uavcan_internet_udp_OutgoingPacket_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 561UL -static_assert(uavcan_internet_udp_OutgoingPacket_0_2_EXTENT_BYTES_ >= uavcan_internet_udp_OutgoingPacket_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint32 NAT_ENTRY_MIN_TTL = 86400 -#define uavcan_internet_udp_OutgoingPacket_0_2_NAT_ENTRY_MIN_TTL (86400UL) - -/// Array metadata for: saturated uint8[<=45] destination_address -#define uavcan_internet_udp_OutgoingPacket_0_2_destination_address_ARRAY_CAPACITY_ 45U -#define uavcan_internet_udp_OutgoingPacket_0_2_destination_address_ARRAY_IS_VARIABLE_LENGTH_ true -/// Array metadata for: saturated uint8[<=508] payload -#define uavcan_internet_udp_OutgoingPacket_0_2_payload_ARRAY_CAPACITY_ 508U -#define uavcan_internet_udp_OutgoingPacket_0_2_payload_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 session_id - uint16_t session_id; - - /// saturated uint16 destination_port - uint16_t destination_port; - - /// saturated uint8[<=45] destination_address - struct /// Array address equivalence guarantee: &elements[0] == &destination_address - { - uint8_t elements[uavcan_internet_udp_OutgoingPacket_0_2_destination_address_ARRAY_CAPACITY_]; - size_t count; - } destination_address; - - /// saturated bool use_masquerading - bool use_masquerading; - - /// saturated bool use_dtls - bool use_dtls; - - /// saturated uint8[<=508] payload - struct /// Array address equivalence guarantee: &elements[0] == &payload - { - uint8_t elements[uavcan_internet_udp_OutgoingPacket_0_2_payload_ARRAY_CAPACITY_]; - size_t count; - } payload; -} uavcan_internet_udp_OutgoingPacket_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_internet_udp_OutgoingPacket_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_OutgoingPacket_0_2_serialize_( - const uavcan_internet_udp_OutgoingPacket_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 4488UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 session_id - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->session_id, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint16 destination_port - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->destination_port, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=45] destination_address - if (obj->destination_address.count > 45) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->destination_address.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->destination_address.count * 8U, &obj->destination_address.elements[0], 0U); - offset_bits += obj->destination_address.count * 8U; - } - - - - - { // saturated bool use_masquerading - buffer[offset_bits / 8U] = obj->use_masquerading ? 1U : 0U; - offset_bits += 1U; - } - - - - - { // saturated bool use_dtls - if (obj->use_dtls) - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] | (1U << (offset_bits % 8U))); - } - else - { - buffer[offset_bits / 8U] = (uint8_t)(buffer[offset_bits / 8U] & ~(1U << (offset_bits % 8U))); - } - offset_bits += 1U; - } - - - - - { // void6 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 6U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 6UL; - } - - - - - { // saturated uint8[<=508] payload - if (obj->payload.count > 508) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->payload.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->payload.count * 8U, &obj->payload.elements[0], 0U); - offset_bits += obj->payload.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_internet_udp_OutgoingPacket_0_2_deserialize_( - uavcan_internet_udp_OutgoingPacket_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 session_id - out_obj->session_id = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint16 destination_port - out_obj->destination_port = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=45] destination_address - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->destination_address.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->destination_address.count = 0U; - } - offset_bits += 8U; - if (out_obj->destination_address.count > 45U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->destination_address.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->destination_address.count * 8U); - offset_bits += out_obj->destination_address.count * 8U; - - - - - // saturated bool use_masquerading - if (offset_bits < capacity_bits) - { - out_obj->use_masquerading = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->use_masquerading = false; - } - offset_bits += 1U; - - - - - // saturated bool use_dtls - if (offset_bits < capacity_bits) - { - out_obj->use_dtls = (buffer[offset_bits / 8U] & (1U << (offset_bits % 8U))) != 0U; - } - else - { - out_obj->use_dtls = false; - } - offset_bits += 1U; - - - - - // void6 - offset_bits += 6; - - - - - // saturated uint8[<=508] payload - // Array length prefix: truncated uint16 - out_obj->payload.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->payload.count > 508U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->payload.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->payload.count * 8U); - offset_bits += out_obj->payload.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_internet_udp_OutgoingPacket_0_2_initialize_(uavcan_internet_udp_OutgoingPacket_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_internet_udp_OutgoingPacket_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_INTERNET_UDP_OUTGOING_PACKET_0_2_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ArbitrationID_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ArbitrationID_0_1.h deleted file mode 100644 index e5f24fae1..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ArbitrationID_0_1.h +++ /dev/null @@ -1,324 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.406646 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.ArbitrationID -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_ARBITRATION_ID_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_ARBITRATION_ID_0_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_ArbitrationID_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_ArbitrationID_0_1_FULL_NAME_ "uavcan.metatransport.can.ArbitrationID" -#define uavcan_metatransport_can_ArbitrationID_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.ArbitrationID.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_ArbitrationID_0_1_EXTENT_BYTES_ 5UL -#define uavcan_metatransport_can_ArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 5UL -static_assert(uavcan_metatransport_can_ArbitrationID_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_ArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_metatransport_can_ArbitrationID_0_1_UNION_OPTION_COUNT_ 2U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// uavcan.metatransport.can.BaseArbitrationID.0.1 base - uavcan_metatransport_can_BaseArbitrationID_0_1 base; - - /// uavcan.metatransport.can.ExtendedArbitrationID.0.1 extended - uavcan_metatransport_can_ExtendedArbitrationID_0_1 extended; - }; - uint8_t _tag_; -} uavcan_metatransport_can_ArbitrationID_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_ArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_ArbitrationID_0_1_serialize_( - const uavcan_metatransport_can_ArbitrationID_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 40UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // uavcan.metatransport.can.BaseArbitrationID.0.1 base - { - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_BaseArbitrationID_0_1_serialize_( - &obj->base, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - else if (1U == obj->_tag_) // uavcan.metatransport.can.ExtendedArbitrationID.0.1 extended - { - size_t _size_bytes1_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_metatransport_can_ExtendedArbitrationID_0_1_serialize_( - &obj->extended, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_ArbitrationID_0_1_deserialize_( - uavcan_metatransport_can_ArbitrationID_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // uavcan.metatransport.can.BaseArbitrationID.0.1 base - { - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_metatransport_can_BaseArbitrationID_0_1_deserialize_( - &out_obj->base, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (1U == out_obj->_tag_) // uavcan.metatransport.can.ExtendedArbitrationID.0.1 extended - { - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_metatransport_can_ExtendedArbitrationID_0_1_deserialize_( - &out_obj->extended, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_ArbitrationID_0_1_initialize_(uavcan_metatransport_can_ArbitrationID_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_ArbitrationID_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "base" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_ArbitrationID_0_1_select_base_(uavcan_metatransport_can_ArbitrationID_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "base" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_ArbitrationID_0_1_is_base_(const uavcan_metatransport_can_ArbitrationID_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "extended" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_ArbitrationID_0_1_select_extended_(uavcan_metatransport_can_ArbitrationID_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "extended" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_ArbitrationID_0_1_is_extended_(const uavcan_metatransport_can_ArbitrationID_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_ARBITRATION_ID_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/BaseArbitrationID_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/BaseArbitrationID_0_1.h deleted file mode 100644 index fb9dbe4f8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/BaseArbitrationID_0_1.h +++ /dev/null @@ -1,242 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.406646 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.BaseArbitrationID -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_BASE_ARBITRATION_ID_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_BASE_ARBITRATION_ID_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/BaseArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_BaseArbitrationID_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_BaseArbitrationID_0_1_FULL_NAME_ "uavcan.metatransport.can.BaseArbitrationID" -#define uavcan_metatransport_can_BaseArbitrationID_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.BaseArbitrationID.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_BaseArbitrationID_0_1_EXTENT_BYTES_ 4UL -#define uavcan_metatransport_can_BaseArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_metatransport_can_BaseArbitrationID_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_BaseArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint11 value - uint16_t value; -} uavcan_metatransport_can_BaseArbitrationID_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_BaseArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_BaseArbitrationID_0_1_serialize_( - const uavcan_metatransport_can_BaseArbitrationID_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint11 value - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 11U; - } - - - - - { // void21 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 21U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 21UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_BaseArbitrationID_0_1_deserialize_( - uavcan_metatransport_can_BaseArbitrationID_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint11 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 11); - offset_bits += 11U; - - - - - // void21 - offset_bits += 21; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_BaseArbitrationID_0_1_initialize_(uavcan_metatransport_can_BaseArbitrationID_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_BaseArbitrationID_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_BASE_ARBITRATION_ID_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataClassic_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataClassic_0_1.h deleted file mode 100644 index c15967597..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataClassic_0_1.h +++ /dev/null @@ -1,289 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.422259 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.DataClassic -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_DATA_CLASSIC_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_DATA_CLASSIC_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataClassic.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_DataClassic_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_DataClassic_0_1_FULL_NAME_ "uavcan.metatransport.can.DataClassic" -#define uavcan_metatransport_can_DataClassic_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.DataClassic.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_DataClassic_0_1_EXTENT_BYTES_ 14UL -#define uavcan_metatransport_can_DataClassic_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 14UL -static_assert(uavcan_metatransport_can_DataClassic_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_DataClassic_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=8] data -#define uavcan_metatransport_can_DataClassic_0_1_data_ARRAY_CAPACITY_ 8U -#define uavcan_metatransport_can_DataClassic_0_1_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - uavcan_metatransport_can_ArbitrationID_0_1 arbitration_id; - - /// saturated uint8[<=8] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_metatransport_can_DataClassic_0_1_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_metatransport_can_DataClassic_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_DataClassic_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_DataClassic_0_1_serialize_( - const uavcan_metatransport_can_DataClassic_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 112UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - size_t _size_bytes0_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_ArbitrationID_0_1_serialize_( - &obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=8] data - if (obj->data.count > 8) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->data.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_DataClassic_0_1_deserialize_( - uavcan_metatransport_can_DataClassic_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_metatransport_can_ArbitrationID_0_1_deserialize_( - &out_obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=8] data - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->data.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->data.count = 0U; - } - offset_bits += 8U; - if (out_obj->data.count > 8U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_DataClassic_0_1_initialize_(uavcan_metatransport_can_DataClassic_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_DataClassic_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_DATA_CLASSIC_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataFD_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataFD_0_1.h deleted file mode 100644 index 454c894de..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/DataFD_0_1.h +++ /dev/null @@ -1,289 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.422259 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.DataFD -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_DATA_FD_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_DATA_FD_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/DataFD.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_DataFD_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_DataFD_0_1_FULL_NAME_ "uavcan.metatransport.can.DataFD" -#define uavcan_metatransport_can_DataFD_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.DataFD.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_DataFD_0_1_EXTENT_BYTES_ 70UL -#define uavcan_metatransport_can_DataFD_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 70UL -static_assert(uavcan_metatransport_can_DataFD_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_DataFD_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=64] data -#define uavcan_metatransport_can_DataFD_0_1_data_ARRAY_CAPACITY_ 64U -#define uavcan_metatransport_can_DataFD_0_1_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - uavcan_metatransport_can_ArbitrationID_0_1 arbitration_id; - - /// saturated uint8[<=64] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_metatransport_can_DataFD_0_1_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_metatransport_can_DataFD_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_DataFD_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_DataFD_0_1_serialize_( - const uavcan_metatransport_can_DataFD_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 560UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - size_t _size_bytes0_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_ArbitrationID_0_1_serialize_( - &obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=64] data - if (obj->data.count > 64) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->data.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_DataFD_0_1_deserialize_( - uavcan_metatransport_can_DataFD_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_metatransport_can_ArbitrationID_0_1_deserialize_( - &out_obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=64] data - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->data.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->data.count = 0U; - } - offset_bits += 8U; - if (out_obj->data.count > 64U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_DataFD_0_1_initialize_(uavcan_metatransport_can_DataFD_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_DataFD_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_DATA_FD_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Error_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Error_0_1.h deleted file mode 100644 index 8e70e4855..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Error_0_1.h +++ /dev/null @@ -1,221 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.422259 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.Error -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_ERROR_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_ERROR_0_1_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Error.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_Error_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_Error_0_1_FULL_NAME_ "uavcan.metatransport.can.Error" -#define uavcan_metatransport_can_Error_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.Error.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_Error_0_1_EXTENT_BYTES_ 4UL -#define uavcan_metatransport_can_Error_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_metatransport_can_Error_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_Error_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_metatransport_can_Error_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_Error_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Error_0_1_serialize_( - const uavcan_metatransport_can_Error_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // void32 - (void) memset(&buffer[offset_bits / 8U], 0, 4); - offset_bits += 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Error_0_1_deserialize_( - uavcan_metatransport_can_Error_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // void32 - offset_bits += 32; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_Error_0_1_initialize_(uavcan_metatransport_can_Error_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_Error_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_ERROR_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ExtendedArbitrationID_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ExtendedArbitrationID_0_1.h deleted file mode 100644 index 82ee214af..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/ExtendedArbitrationID_0_1.h +++ /dev/null @@ -1,242 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.437886 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.ExtendedArbitrationID -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_EXTENDED_ARBITRATION_ID_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_EXTENDED_ARBITRATION_ID_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/ExtendedArbitrationID.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_ExtendedArbitrationID_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_ExtendedArbitrationID_0_1_FULL_NAME_ "uavcan.metatransport.can.ExtendedArbitrationID" -#define uavcan_metatransport_can_ExtendedArbitrationID_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.ExtendedArbitrationID.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_ExtendedArbitrationID_0_1_EXTENT_BYTES_ 4UL -#define uavcan_metatransport_can_ExtendedArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_metatransport_can_ExtendedArbitrationID_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_ExtendedArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint29 value - uint32_t value; -} uavcan_metatransport_can_ExtendedArbitrationID_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_ExtendedArbitrationID_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_ExtendedArbitrationID_0_1_serialize_( - const uavcan_metatransport_can_ExtendedArbitrationID_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint29 value - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 4U); - offset_bits += 29U; - } - - - - - { // void3 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 3U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 3UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_ExtendedArbitrationID_0_1_deserialize_( - uavcan_metatransport_can_ExtendedArbitrationID_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint29 value - out_obj->value = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 29); - offset_bits += 29U; - - - - - // void3 - offset_bits += 3; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_ExtendedArbitrationID_0_1_initialize_(uavcan_metatransport_can_ExtendedArbitrationID_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_ExtendedArbitrationID_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_EXTENDED_ARBITRATION_ID_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_1.h deleted file mode 100644 index 63cea8490..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_1.h +++ /dev/null @@ -1,292 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.437886 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.Frame -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_METATRANSPORT_CAN_FRAME_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_FRAME_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_Frame_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_Frame_0_1_FULL_NAME_ "uavcan.metatransport.can.Frame" -#define uavcan_metatransport_can_Frame_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.Frame.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_Frame_0_1_EXTENT_BYTES_ 78UL -#define uavcan_metatransport_can_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 78UL -static_assert(uavcan_metatransport_can_Frame_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// uavcan.metatransport.can.Manifestation.0.1 manifestation - uavcan_metatransport_can_Manifestation_0_1 manifestation; -} uavcan_metatransport_can_Frame_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Frame_0_1_serialize_( - const uavcan_metatransport_can_Frame_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 624UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.metatransport.can.Manifestation.0.1 manifestation - size_t _size_bytes1_ = 71UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_metatransport_can_Manifestation_0_1_serialize_( - &obj->manifestation, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Frame_0_1_deserialize_( - uavcan_metatransport_can_Frame_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.metatransport.can.Manifestation.0.1 manifestation - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_metatransport_can_Manifestation_0_1_deserialize_( - &out_obj->manifestation, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_Frame_0_1_initialize_(uavcan_metatransport_can_Frame_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_Frame_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_FRAME_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_2.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_2.h deleted file mode 100644 index 4ea1dac01..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Frame_0_2.h +++ /dev/null @@ -1,413 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.437886 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.Frame -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_FRAME_0_2_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_FRAME_0_2_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Frame.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_Frame_0_2_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_Frame_0_2_FULL_NAME_ "uavcan.metatransport.can.Frame" -#define uavcan_metatransport_can_Frame_0_2_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.Frame.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_Frame_0_2_EXTENT_BYTES_ 71UL -#define uavcan_metatransport_can_Frame_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 71UL -static_assert(uavcan_metatransport_can_Frame_0_2_EXTENT_BYTES_ >= uavcan_metatransport_can_Frame_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_metatransport_can_Frame_0_2_UNION_OPTION_COUNT_ 4U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// uavcan.metatransport.can.Error.0.1 error - uavcan_metatransport_can_Error_0_1 _error; - - /// uavcan.metatransport.can.DataFD.0.1 data_fd - uavcan_metatransport_can_DataFD_0_1 data_fd; - - /// uavcan.metatransport.can.DataClassic.0.1 data_classic - uavcan_metatransport_can_DataClassic_0_1 data_classic; - - /// uavcan.metatransport.can.RTR.0.1 remote_transmission_request - uavcan_metatransport_can_RTR_0_1 remote_transmission_request; - }; - uint8_t _tag_; -} uavcan_metatransport_can_Frame_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_Frame_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Frame_0_2_serialize_( - const uavcan_metatransport_can_Frame_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 568UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // uavcan.metatransport.can.Error.0.1 error - { - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_Error_0_1_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - else if (1U == obj->_tag_) // uavcan.metatransport.can.DataFD.0.1 data_fd - { - size_t _size_bytes1_ = 70UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_metatransport_can_DataFD_0_1_serialize_( - &obj->data_fd, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else if (2U == obj->_tag_) // uavcan.metatransport.can.DataClassic.0.1 data_classic - { - size_t _size_bytes2_ = 14UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_metatransport_can_DataClassic_0_1_serialize_( - &obj->data_classic, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - else if (3U == obj->_tag_) // uavcan.metatransport.can.RTR.0.1 remote_transmission_request - { - size_t _size_bytes3_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_metatransport_can_RTR_0_1_serialize_( - &obj->remote_transmission_request, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Frame_0_2_deserialize_( - uavcan_metatransport_can_Frame_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // uavcan.metatransport.can.Error.0.1 error - { - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_metatransport_can_Error_0_1_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (1U == out_obj->_tag_) // uavcan.metatransport.can.DataFD.0.1 data_fd - { - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_metatransport_can_DataFD_0_1_deserialize_( - &out_obj->data_fd, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (2U == out_obj->_tag_) // uavcan.metatransport.can.DataClassic.0.1 data_classic - { - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_metatransport_can_DataClassic_0_1_deserialize_( - &out_obj->data_classic, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (3U == out_obj->_tag_) // uavcan.metatransport.can.RTR.0.1 remote_transmission_request - { - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_metatransport_can_RTR_0_1_deserialize_( - &out_obj->remote_transmission_request, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_Frame_0_2_initialize_(uavcan_metatransport_can_Frame_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_Frame_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "error" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Frame_0_2_select_error_(uavcan_metatransport_can_Frame_0_2* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "error" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Frame_0_2_is_error_(const uavcan_metatransport_can_Frame_0_2* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "data_fd" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Frame_0_2_select_data_fd_(uavcan_metatransport_can_Frame_0_2* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "data_fd" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Frame_0_2_is_data_fd_(const uavcan_metatransport_can_Frame_0_2* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -/// Mark option "data_classic" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Frame_0_2_select_data_classic_(uavcan_metatransport_can_Frame_0_2* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 2; - } -} - -/// Check if option "data_classic" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Frame_0_2_is_data_classic_(const uavcan_metatransport_can_Frame_0_2* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 2)); -} - -/// Mark option "remote_transmission_request" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Frame_0_2_select_remote_transmission_request_(uavcan_metatransport_can_Frame_0_2* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 3; - } -} - -/// Check if option "remote_transmission_request" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Frame_0_2_is_remote_transmission_request_(const uavcan_metatransport_can_Frame_0_2* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 3)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_FRAME_0_2_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Manifestation_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Manifestation_0_1.h deleted file mode 100644 index cb0f01866..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/Manifestation_0_1.h +++ /dev/null @@ -1,422 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.453566 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.Manifestation -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_METATRANSPORT_CAN_MANIFESTATION_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_MANIFESTATION_0_1_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/Manifestation.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_Manifestation_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_Manifestation_0_1_FULL_NAME_ "uavcan.metatransport.can.Manifestation" -#define uavcan_metatransport_can_Manifestation_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.Manifestation.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_Manifestation_0_1_EXTENT_BYTES_ 71UL -#define uavcan_metatransport_can_Manifestation_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 71UL -static_assert(uavcan_metatransport_can_Manifestation_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_Manifestation_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_metatransport_can_Manifestation_0_1_UNION_OPTION_COUNT_ 4U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// uavcan.metatransport.can.Error.0.1 error - uavcan_metatransport_can_Error_0_1 _error; - - /// uavcan.metatransport.can.DataFD.0.1 data_fd - uavcan_metatransport_can_DataFD_0_1 data_fd; - - /// uavcan.metatransport.can.DataClassic.0.1 data_classic - uavcan_metatransport_can_DataClassic_0_1 data_classic; - - /// uavcan.metatransport.can.RTR.0.1 remote_transmission_request - uavcan_metatransport_can_RTR_0_1 remote_transmission_request; - }; - uint8_t _tag_; -} uavcan_metatransport_can_Manifestation_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_Manifestation_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Manifestation_0_1_serialize_( - const uavcan_metatransport_can_Manifestation_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 568UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // uavcan.metatransport.can.Error.0.1 error - { - size_t _size_bytes0_ = 4UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_Error_0_1_serialize_( - &obj->_error, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - else if (1U == obj->_tag_) // uavcan.metatransport.can.DataFD.0.1 data_fd - { - size_t _size_bytes1_ = 70UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_metatransport_can_DataFD_0_1_serialize_( - &obj->data_fd, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else if (2U == obj->_tag_) // uavcan.metatransport.can.DataClassic.0.1 data_classic - { - size_t _size_bytes2_ = 14UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_metatransport_can_DataClassic_0_1_serialize_( - &obj->data_classic, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - else if (3U == obj->_tag_) // uavcan.metatransport.can.RTR.0.1 remote_transmission_request - { - size_t _size_bytes3_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_metatransport_can_RTR_0_1_serialize_( - &obj->remote_transmission_request, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_Manifestation_0_1_deserialize_( - uavcan_metatransport_can_Manifestation_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // uavcan.metatransport.can.Error.0.1 error - { - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_metatransport_can_Error_0_1_deserialize_( - &out_obj->_error, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (1U == out_obj->_tag_) // uavcan.metatransport.can.DataFD.0.1 data_fd - { - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_metatransport_can_DataFD_0_1_deserialize_( - &out_obj->data_fd, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (2U == out_obj->_tag_) // uavcan.metatransport.can.DataClassic.0.1 data_classic - { - { - size_t _size_bytes6_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_metatransport_can_DataClassic_0_1_deserialize_( - &out_obj->data_classic, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes6_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (3U == out_obj->_tag_) // uavcan.metatransport.can.RTR.0.1 remote_transmission_request - { - { - size_t _size_bytes7_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_metatransport_can_RTR_0_1_deserialize_( - &out_obj->remote_transmission_request, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes7_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_Manifestation_0_1_initialize_(uavcan_metatransport_can_Manifestation_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_Manifestation_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "error" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Manifestation_0_1_select_error_(uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "error" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Manifestation_0_1_is_error_(const uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "data_fd" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Manifestation_0_1_select_data_fd_(uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "data_fd" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Manifestation_0_1_is_data_fd_(const uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -/// Mark option "data_classic" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Manifestation_0_1_select_data_classic_(uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 2; - } -} - -/// Check if option "data_classic" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Manifestation_0_1_is_data_classic_(const uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 2)); -} - -/// Mark option "remote_transmission_request" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_metatransport_can_Manifestation_0_1_select_remote_transmission_request_(uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 3; - } -} - -/// Check if option "remote_transmission_request" is active. Returns false if @param obj is NULL. -static inline bool uavcan_metatransport_can_Manifestation_0_1_is_remote_transmission_request_(const uavcan_metatransport_can_Manifestation_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 3)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_MANIFESTATION_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/RTR_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/can/RTR_0_1.h deleted file mode 100644 index 78ceb65f0..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/can/RTR_0_1.h +++ /dev/null @@ -1,239 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.453566 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.can.RTR -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_CAN_RTR_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_CAN_RTR_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/can/RTR.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_can_RTR_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_can_RTR_0_1_FULL_NAME_ "uavcan.metatransport.can.RTR" -#define uavcan_metatransport_can_RTR_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.can.RTR.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_can_RTR_0_1_EXTENT_BYTES_ 5UL -#define uavcan_metatransport_can_RTR_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 5UL -static_assert(uavcan_metatransport_can_RTR_0_1_EXTENT_BYTES_ >= uavcan_metatransport_can_RTR_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - uavcan_metatransport_can_ArbitrationID_0_1 arbitration_id; -} uavcan_metatransport_can_RTR_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_can_RTR_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_RTR_0_1_serialize_( - const uavcan_metatransport_can_RTR_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 40UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - size_t _size_bytes0_ = 5UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_metatransport_can_ArbitrationID_0_1_serialize_( - &obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_can_RTR_0_1_deserialize_( - uavcan_metatransport_can_RTR_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.metatransport.can.ArbitrationID.0.1 arbitration_id - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_metatransport_can_ArbitrationID_0_1_deserialize_( - &out_obj->arbitration_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_can_RTR_0_1_initialize_(uavcan_metatransport_can_RTR_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_can_RTR_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_CAN_RTR_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/EtherType_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/EtherType_0_1.h deleted file mode 100644 index b0c1838da..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/EtherType_0_1.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.469274 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.ethernet.EtherType -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_ETHERNET_ETHER_TYPE_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_ETHERNET_ETHER_TYPE_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/EtherType.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_ethernet_EtherType_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_ethernet_EtherType_0_1_FULL_NAME_ "uavcan.metatransport.ethernet.EtherType" -#define uavcan_metatransport_ethernet_EtherType_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.ethernet.EtherType.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_ethernet_EtherType_0_1_EXTENT_BYTES_ 2UL -#define uavcan_metatransport_ethernet_EtherType_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_metatransport_ethernet_EtherType_0_1_EXTENT_BYTES_ >= uavcan_metatransport_ethernet_EtherType_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 IP_V4 = 2048 -#define uavcan_metatransport_ethernet_EtherType_0_1_IP_V4 (2048U) -/// saturated uint16 ARP = 2054 -#define uavcan_metatransport_ethernet_EtherType_0_1_ARP (2054U) -/// saturated uint16 IP_V6 = 34525 -#define uavcan_metatransport_ethernet_EtherType_0_1_IP_V6 (34525U) - -typedef struct -{ - /// saturated uint16 value - uint16_t value; -} uavcan_metatransport_ethernet_EtherType_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_ethernet_EtherType_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_ethernet_EtherType_0_1_serialize_( - const uavcan_metatransport_ethernet_EtherType_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_ethernet_EtherType_0_1_deserialize_( - uavcan_metatransport_ethernet_EtherType_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_ethernet_EtherType_0_1_initialize_(uavcan_metatransport_ethernet_EtherType_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_ethernet_EtherType_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_ETHERNET_ETHER_TYPE_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/Frame_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/Frame_0_1.h deleted file mode 100644 index c3a305d08..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/ethernet/Frame_0_1.h +++ /dev/null @@ -1,336 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.469274 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.ethernet.Frame -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_ETHERNET_FRAME_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_ETHERNET_FRAME_0_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/ethernet/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_ethernet_Frame_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_ethernet_Frame_0_1_FULL_NAME_ "uavcan.metatransport.ethernet.Frame" -#define uavcan_metatransport_ethernet_Frame_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.ethernet.Frame.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_ethernet_Frame_0_1_EXTENT_BYTES_ 9232UL -#define uavcan_metatransport_ethernet_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 9232UL -static_assert(uavcan_metatransport_ethernet_Frame_0_1_EXTENT_BYTES_ >= uavcan_metatransport_ethernet_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[6] destination -#define uavcan_metatransport_ethernet_Frame_0_1_destination_ARRAY_CAPACITY_ 6U -#define uavcan_metatransport_ethernet_Frame_0_1_destination_ARRAY_IS_VARIABLE_LENGTH_ false -/// Array metadata for: saturated uint8[6] source -#define uavcan_metatransport_ethernet_Frame_0_1_source_ARRAY_CAPACITY_ 6U -#define uavcan_metatransport_ethernet_Frame_0_1_source_ARRAY_IS_VARIABLE_LENGTH_ false -/// Array metadata for: saturated uint8[<=9216] payload -#define uavcan_metatransport_ethernet_Frame_0_1_payload_ARRAY_CAPACITY_ 9216U -#define uavcan_metatransport_ethernet_Frame_0_1_payload_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[6] destination - uint8_t destination[6]; - - /// saturated uint8[6] source - uint8_t source[6]; - - /// uavcan.metatransport.ethernet.EtherType.0.1 ethertype - uavcan_metatransport_ethernet_EtherType_0_1 ethertype; - - /// saturated uint8[<=9216] payload - struct /// Array address equivalence guarantee: &elements[0] == &payload - { - uint8_t elements[uavcan_metatransport_ethernet_Frame_0_1_payload_ARRAY_CAPACITY_]; - size_t count; - } payload; -} uavcan_metatransport_ethernet_Frame_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_ethernet_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_ethernet_Frame_0_1_serialize_( - const uavcan_metatransport_ethernet_Frame_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 73856UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[6] destination - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 6UL * 8U, &obj->destination[0], 0U); - offset_bits += 6UL * 8U; - } - - - - - { // saturated uint8[6] source - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 6UL * 8U, &obj->source[0], 0U); - offset_bits += 6UL * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.metatransport.ethernet.EtherType.0.1 ethertype - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_metatransport_ethernet_EtherType_0_1_serialize_( - &obj->ethertype, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=9216] payload - if (obj->payload.count > 9216) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->payload.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->payload.count * 8U, &obj->payload.elements[0], 0U); - offset_bits += obj->payload.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_ethernet_Frame_0_1_deserialize_( - uavcan_metatransport_ethernet_Frame_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[6] destination - nunavutGetBits(&out_obj->destination[0], &buffer[0], capacity_bytes, offset_bits, 6UL * 8U); - offset_bits += 6UL * 8U; - - - - - // saturated uint8[6] source - nunavutGetBits(&out_obj->source[0], &buffer[0], capacity_bytes, offset_bits, 6UL * 8U); - offset_bits += 6UL * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.metatransport.ethernet.EtherType.0.1 ethertype - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_metatransport_ethernet_EtherType_0_1_deserialize_( - &out_obj->ethertype, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=9216] payload - // Array length prefix: truncated uint16 - out_obj->payload.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->payload.count > 9216U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->payload.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->payload.count * 8U); - offset_bits += out_obj->payload.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_ethernet_Frame_0_1_initialize_(uavcan_metatransport_ethernet_Frame_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_ethernet_Frame_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_ETHERNET_FRAME_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_1.h deleted file mode 100644 index 8b830a5b3..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_1.h +++ /dev/null @@ -1,294 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.469274 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.metatransport.serial.Fragment -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_serial_Fragment_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_serial_Fragment_0_1_FULL_NAME_ "uavcan.metatransport.serial.Fragment" -#define uavcan_metatransport_serial_Fragment_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.serial.Fragment.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_serial_Fragment_0_1_EXTENT_BYTES_ 265UL -#define uavcan_metatransport_serial_Fragment_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 265UL -static_assert(uavcan_metatransport_serial_Fragment_0_1_EXTENT_BYTES_ >= uavcan_metatransport_serial_Fragment_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint9 CAPACITY_BYTES = 256 -#define uavcan_metatransport_serial_Fragment_0_1_CAPACITY_BYTES (256U) - -/// Array metadata for: saturated uint8[<=256] data -#define uavcan_metatransport_serial_Fragment_0_1_data_ARRAY_CAPACITY_ 256U -#define uavcan_metatransport_serial_Fragment_0_1_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated uint8[<=256] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_metatransport_serial_Fragment_0_1_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_metatransport_serial_Fragment_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_serial_Fragment_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_serial_Fragment_0_1_serialize_( - const uavcan_metatransport_serial_Fragment_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2120UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=256] data - if (obj->data.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->data.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_serial_Fragment_0_1_deserialize_( - uavcan_metatransport_serial_Fragment_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=256] data - // Array length prefix: truncated uint16 - out_obj->data.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->data.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_serial_Fragment_0_1_initialize_(uavcan_metatransport_serial_Fragment_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_serial_Fragment_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_2.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_2.h deleted file mode 100644 index f3af9134f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/serial/Fragment_0_2.h +++ /dev/null @@ -1,251 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl -// Generated at: 2023-07-11 16:47:49.453566 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.metatransport.serial.Fragment -// Version: 0.2 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_2_INCLUDED_ -#define UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_2_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/serial/Fragment.0.2.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_serial_Fragment_0_2_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_serial_Fragment_0_2_FULL_NAME_ "uavcan.metatransport.serial.Fragment" -#define uavcan_metatransport_serial_Fragment_0_2_FULL_NAME_AND_VERSION_ "uavcan.metatransport.serial.Fragment.0.2" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_serial_Fragment_0_2_EXTENT_BYTES_ 2050UL -#define uavcan_metatransport_serial_Fragment_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ 2050UL -static_assert(uavcan_metatransport_serial_Fragment_0_2_EXTENT_BYTES_ >= uavcan_metatransport_serial_Fragment_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint12 CAPACITY_BYTES = 2048 -#define uavcan_metatransport_serial_Fragment_0_2_CAPACITY_BYTES (2048U) - -/// Array metadata for: saturated uint8[<=2048] data -#define uavcan_metatransport_serial_Fragment_0_2_data_ARRAY_CAPACITY_ 2048U -#define uavcan_metatransport_serial_Fragment_0_2_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=2048] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_metatransport_serial_Fragment_0_2_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_metatransport_serial_Fragment_0_2; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_serial_Fragment_0_2_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_serial_Fragment_0_2_serialize_( - const uavcan_metatransport_serial_Fragment_0_2* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16400UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=2048] data - if (obj->data.count > 2048) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->data.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_serial_Fragment_0_2_deserialize_( - uavcan_metatransport_serial_Fragment_0_2* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=2048] data - // Array length prefix: truncated uint16 - out_obj->data.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->data.count > 2048U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_serial_Fragment_0_2_initialize_(uavcan_metatransport_serial_Fragment_0_2* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_serial_Fragment_0_2_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_SERIAL_FRAGMENT_0_2_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Endpoint_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Endpoint_0_1.h deleted file mode 100644 index 2da71a85e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Endpoint_0_1.h +++ /dev/null @@ -1,294 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.391017 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.metatransport.udp.Endpoint -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_METATRANSPORT_UDP_ENDPOINT_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_UDP_ENDPOINT_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Endpoint.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_udp_Endpoint_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_udp_Endpoint_0_1_FULL_NAME_ "uavcan.metatransport.udp.Endpoint" -#define uavcan_metatransport_udp_Endpoint_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.udp.Endpoint.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_udp_Endpoint_0_1_EXTENT_BYTES_ 32UL -#define uavcan_metatransport_udp_Endpoint_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 32UL -static_assert(uavcan_metatransport_udp_Endpoint_0_1_EXTENT_BYTES_ >= uavcan_metatransport_udp_Endpoint_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[16] ip_address -#define uavcan_metatransport_udp_Endpoint_0_1_ip_address_ARRAY_CAPACITY_ 16U -#define uavcan_metatransport_udp_Endpoint_0_1_ip_address_ARRAY_IS_VARIABLE_LENGTH_ false -/// Array metadata for: saturated uint8[6] mac_address -#define uavcan_metatransport_udp_Endpoint_0_1_mac_address_ARRAY_CAPACITY_ 6U -#define uavcan_metatransport_udp_Endpoint_0_1_mac_address_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated uint8[16] ip_address - uint8_t ip_address[16]; - - /// saturated uint8[6] mac_address - uint8_t mac_address[6]; - - /// saturated uint16 port - uint16_t port; -} uavcan_metatransport_udp_Endpoint_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_udp_Endpoint_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_udp_Endpoint_0_1_serialize_( - const uavcan_metatransport_udp_Endpoint_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 256UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[16] ip_address - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 16UL * 8U, &obj->ip_address[0], 0U); - offset_bits += 16UL * 8U; - } - - - - - { // saturated uint8[6] mac_address - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 6UL * 8U, &obj->mac_address[0], 0U); - offset_bits += 6UL * 8U; - } - - - - - { // saturated uint16 port - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->port, 2U); - offset_bits += 16U; - } - - - - - { // void64 - (void) memset(&buffer[offset_bits / 8U], 0, 8); - offset_bits += 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_udp_Endpoint_0_1_deserialize_( - uavcan_metatransport_udp_Endpoint_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[16] ip_address - nunavutGetBits(&out_obj->ip_address[0], &buffer[0], capacity_bytes, offset_bits, 16UL * 8U); - offset_bits += 16UL * 8U; - - - - - // saturated uint8[6] mac_address - nunavutGetBits(&out_obj->mac_address[0], &buffer[0], capacity_bytes, offset_bits, 6UL * 8U); - offset_bits += 6UL * 8U; - - - - - // saturated uint16 port - out_obj->port = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // void64 - offset_bits += 64; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_udp_Endpoint_0_1_initialize_(uavcan_metatransport_udp_Endpoint_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_udp_Endpoint_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_UDP_ENDPOINT_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Frame_0_1.h b/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Frame_0_1.h deleted file mode 100644 index 99ce3e5e0..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/metatransport/udp/Frame_0_1.h +++ /dev/null @@ -1,394 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.391017 UTC -// Is deprecated: yes -// Fixed port-ID: None -// Full name: uavcan.metatransport.udp.Frame -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_METATRANSPORT_UDP_FRAME_0_1_INCLUDED_ -#define UAVCAN_METATRANSPORT_UDP_FRAME_0_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/metatransport/udp/Frame.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_metatransport_udp_Frame_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_metatransport_udp_Frame_0_1_FULL_NAME_ "uavcan.metatransport.udp.Frame" -#define uavcan_metatransport_udp_Frame_0_1_FULL_NAME_AND_VERSION_ "uavcan.metatransport.udp.Frame.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_metatransport_udp_Frame_0_1_EXTENT_BYTES_ 10240UL -#define uavcan_metatransport_udp_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 9262UL -static_assert(uavcan_metatransport_udp_Frame_0_1_EXTENT_BYTES_ >= uavcan_metatransport_udp_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint14 MTU = 9188 -#define uavcan_metatransport_udp_Frame_0_1_MTU (9188U) - -/// Array metadata for: saturated uint8[<=9188] data -#define uavcan_metatransport_udp_Frame_0_1_data_ARRAY_CAPACITY_ 9188U -#define uavcan_metatransport_udp_Frame_0_1_data_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// uavcan.metatransport.udp.Endpoint.0.1 source - uavcan_metatransport_udp_Endpoint_0_1 source; - - /// uavcan.metatransport.udp.Endpoint.0.1 destination - uavcan_metatransport_udp_Endpoint_0_1 destination; - - /// saturated uint8[<=9188] data - struct /// Array address equivalence guarantee: &elements[0] == &data - { - uint8_t elements[uavcan_metatransport_udp_Frame_0_1_data_ARRAY_CAPACITY_]; - size_t count; - } data; -} uavcan_metatransport_udp_Frame_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_metatransport_udp_Frame_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_udp_Frame_0_1_serialize_( - const uavcan_metatransport_udp_Frame_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 74096UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // void8 - buffer[offset_bits / 8U] = 0U; - offset_bits += 8UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.metatransport.udp.Endpoint.0.1 source - size_t _size_bytes1_ = 32UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_metatransport_udp_Endpoint_0_1_serialize_( - &obj->source, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.metatransport.udp.Endpoint.0.1 destination - size_t _size_bytes2_ = 32UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_metatransport_udp_Endpoint_0_1_serialize_( - &obj->destination, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[<=9188] data - if (obj->data.count > 9188) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->data.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->data.count * 8U, &obj->data.elements[0], 0U); - offset_bits += obj->data.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_metatransport_udp_Frame_0_1_deserialize_( - uavcan_metatransport_udp_Frame_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // void8 - offset_bits += 8; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.metatransport.udp.Endpoint.0.1 source - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_metatransport_udp_Endpoint_0_1_deserialize_( - &out_obj->source, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.metatransport.udp.Endpoint.0.1 destination - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_metatransport_udp_Endpoint_0_1_deserialize_( - &out_obj->destination, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[<=9188] data - // Array length prefix: truncated uint16 - out_obj->data.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->data.count > 9188U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->data.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->data.count * 8U); - offset_bits += out_obj->data.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_metatransport_udp_Frame_0_1_initialize_(uavcan_metatransport_udp_Frame_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_metatransport_udp_Frame_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_METATRANSPORT_UDP_FRAME_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_0.h deleted file mode 100644 index b0ffe61c9..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_0.h +++ /dev/null @@ -1,478 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.002618 UTC -// Is deprecated: yes -// Fixed port-ID: 435 -// Full name: uavcan.node.ExecuteCommand -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -// _____ ______ _____ _____ ______ _____ _______ ______ _____ -// | __ `| ____| __ `| __ `| ____/ ____| /`|__ __| ____| __ ` -// | | | | |__ | |__) | |__) | |__ | | / ` | | | |__ | | | | -// | | | | __| | ___/| _ /| __|| | / /` ` | | | __| | | | | -// | |__| | |____| | | | ` `| |___| |____ / ____ `| | | |____| |__| | -// |_____/|______|_| |_| `_`______`_____/_/ `_`_| |______|_____/ -// -// WARNING: this data type is deprecated and is nearing the end of its life cycle. Seek replacement. - -#ifndef UAVCAN_NODE_EXECUTE_COMMAND_1_0_INCLUDED_ -#define UAVCAN_NODE_EXECUTE_COMMAND_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_ExecuteCommand_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_node_ExecuteCommand_1_0_FIXED_PORT_ID_ 435U - -#define uavcan_node_ExecuteCommand_1_0_FULL_NAME_ "uavcan.node.ExecuteCommand" -#define uavcan_node_ExecuteCommand_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.1.0" - -#define uavcan_node_ExecuteCommand_Request_1_0_FULL_NAME_ "uavcan.node.ExecuteCommand.Request" -#define uavcan_node_ExecuteCommand_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_ExecuteCommand_Request_1_0_EXTENT_BYTES_ 300UL -#define uavcan_node_ExecuteCommand_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 115UL -static_assert(uavcan_node_ExecuteCommand_Request_1_0_EXTENT_BYTES_ >= uavcan_node_ExecuteCommand_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 COMMAND_RESTART = 65535 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_RESTART (65535U) -/// saturated uint16 COMMAND_POWER_OFF = 65534 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_POWER_OFF (65534U) -/// saturated uint16 COMMAND_BEGIN_SOFTWARE_UPDATE = 65533 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_BEGIN_SOFTWARE_UPDATE (65533U) -/// saturated uint16 COMMAND_FACTORY_RESET = 65532 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_FACTORY_RESET (65532U) -/// saturated uint16 COMMAND_EMERGENCY_STOP = 65531 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_EMERGENCY_STOP (65531U) -/// saturated uint16 COMMAND_STORE_PERSISTENT_STATES = 65530 -#define uavcan_node_ExecuteCommand_Request_1_0_COMMAND_STORE_PERSISTENT_STATES (65530U) - -/// Array metadata for: saturated uint8[<=112] parameter -#define uavcan_node_ExecuteCommand_Request_1_0_parameter_ARRAY_CAPACITY_ 112U -#define uavcan_node_ExecuteCommand_Request_1_0_parameter_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 command - uint16_t command; - - /// saturated uint8[<=112] parameter - struct /// Array address equivalence guarantee: &elements[0] == ¶meter - { - uint8_t elements[uavcan_node_ExecuteCommand_Request_1_0_parameter_ARRAY_CAPACITY_]; - size_t count; - } parameter; -} uavcan_node_ExecuteCommand_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_ExecuteCommand_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Request_1_0_serialize_( - const uavcan_node_ExecuteCommand_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 920UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 command - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->command, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=112] parameter - if (obj->parameter.count > 112) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->parameter.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->parameter.count * 8U, &obj->parameter.elements[0], 0U); - offset_bits += obj->parameter.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Request_1_0_deserialize_( - uavcan_node_ExecuteCommand_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 command - out_obj->command = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=112] parameter - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->parameter.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->parameter.count = 0U; - } - offset_bits += 8U; - if (out_obj->parameter.count > 112U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->parameter.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->parameter.count * 8U); - offset_bits += out_obj->parameter.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_ExecuteCommand_Request_1_0_initialize_(uavcan_node_ExecuteCommand_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_ExecuteCommand_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_node_ExecuteCommand_Response_1_0_FULL_NAME_ "uavcan.node.ExecuteCommand.Response" -#define uavcan_node_ExecuteCommand_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_ExecuteCommand_Response_1_0_EXTENT_BYTES_ 48UL -#define uavcan_node_ExecuteCommand_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_node_ExecuteCommand_Response_1_0_EXTENT_BYTES_ >= uavcan_node_ExecuteCommand_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 STATUS_SUCCESS = 0 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_SUCCESS (0U) -/// saturated uint8 STATUS_FAILURE = 1 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_FAILURE (1U) -/// saturated uint8 STATUS_NOT_AUTHORIZED = 2 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_NOT_AUTHORIZED (2U) -/// saturated uint8 STATUS_BAD_COMMAND = 3 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_BAD_COMMAND (3U) -/// saturated uint8 STATUS_BAD_PARAMETER = 4 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_BAD_PARAMETER (4U) -/// saturated uint8 STATUS_BAD_STATE = 5 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_BAD_STATE (5U) -/// saturated uint8 STATUS_INTERNAL_ERROR = 6 -#define uavcan_node_ExecuteCommand_Response_1_0_STATUS_INTERNAL_ERROR (6U) - -typedef struct -{ - /// saturated uint8 status - uint8_t status; -} uavcan_node_ExecuteCommand_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_ExecuteCommand_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Response_1_0_serialize_( - const uavcan_node_ExecuteCommand_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8 status - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->status); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Response_1_0_deserialize_( - uavcan_node_ExecuteCommand_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8 status - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->status = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->status = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_ExecuteCommand_Response_1_0_initialize_(uavcan_node_ExecuteCommand_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_ExecuteCommand_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_EXECUTE_COMMAND_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_1.h b/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_1.h deleted file mode 100644 index 6cc79bf2c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/ExecuteCommand_1_1.h +++ /dev/null @@ -1,469 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl -// Generated at: 2023-07-11 16:47:50.002618 UTC -// Is deprecated: no -// Fixed port-ID: 435 -// Full name: uavcan.node.ExecuteCommand -// Version: 1.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_EXECUTE_COMMAND_1_1_INCLUDED_ -#define UAVCAN_NODE_EXECUTE_COMMAND_1_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/435.ExecuteCommand.1.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_ExecuteCommand_1_1_HAS_FIXED_PORT_ID_ true -#define uavcan_node_ExecuteCommand_1_1_FIXED_PORT_ID_ 435U - -#define uavcan_node_ExecuteCommand_1_1_FULL_NAME_ "uavcan.node.ExecuteCommand" -#define uavcan_node_ExecuteCommand_1_1_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.1.1" - -#define uavcan_node_ExecuteCommand_Request_1_1_FULL_NAME_ "uavcan.node.ExecuteCommand.Request" -#define uavcan_node_ExecuteCommand_Request_1_1_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.Request.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_ExecuteCommand_Request_1_1_EXTENT_BYTES_ 300UL -#define uavcan_node_ExecuteCommand_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_node_ExecuteCommand_Request_1_1_EXTENT_BYTES_ >= uavcan_node_ExecuteCommand_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 COMMAND_RESTART = 65535 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_RESTART (65535U) -/// saturated uint16 COMMAND_POWER_OFF = 65534 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_POWER_OFF (65534U) -/// saturated uint16 COMMAND_BEGIN_SOFTWARE_UPDATE = 65533 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_BEGIN_SOFTWARE_UPDATE (65533U) -/// saturated uint16 COMMAND_FACTORY_RESET = 65532 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_FACTORY_RESET (65532U) -/// saturated uint16 COMMAND_EMERGENCY_STOP = 65531 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_EMERGENCY_STOP (65531U) -/// saturated uint16 COMMAND_STORE_PERSISTENT_STATES = 65530 -#define uavcan_node_ExecuteCommand_Request_1_1_COMMAND_STORE_PERSISTENT_STATES (65530U) - -/// Array metadata for: saturated uint8[<=255] parameter -#define uavcan_node_ExecuteCommand_Request_1_1_parameter_ARRAY_CAPACITY_ 255U -#define uavcan_node_ExecuteCommand_Request_1_1_parameter_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16 command - uint16_t command; - - /// saturated uint8[<=255] parameter - struct /// Array address equivalence guarantee: &elements[0] == ¶meter - { - uint8_t elements[uavcan_node_ExecuteCommand_Request_1_1_parameter_ARRAY_CAPACITY_]; - size_t count; - } parameter; -} uavcan_node_ExecuteCommand_Request_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_ExecuteCommand_Request_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Request_1_1_serialize_( - const uavcan_node_ExecuteCommand_Request_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 command - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->command, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint8[<=255] parameter - if (obj->parameter.count > 255) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->parameter.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->parameter.count * 8U, &obj->parameter.elements[0], 0U); - offset_bits += obj->parameter.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Request_1_1_deserialize_( - uavcan_node_ExecuteCommand_Request_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 command - out_obj->command = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint8[<=255] parameter - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->parameter.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->parameter.count = 0U; - } - offset_bits += 8U; - if (out_obj->parameter.count > 255U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->parameter.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->parameter.count * 8U); - offset_bits += out_obj->parameter.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_ExecuteCommand_Request_1_1_initialize_(uavcan_node_ExecuteCommand_Request_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_ExecuteCommand_Request_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_node_ExecuteCommand_Response_1_1_FULL_NAME_ "uavcan.node.ExecuteCommand.Response" -#define uavcan_node_ExecuteCommand_Response_1_1_FULL_NAME_AND_VERSION_ "uavcan.node.ExecuteCommand.Response.1.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_ExecuteCommand_Response_1_1_EXTENT_BYTES_ 48UL -#define uavcan_node_ExecuteCommand_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_node_ExecuteCommand_Response_1_1_EXTENT_BYTES_ >= uavcan_node_ExecuteCommand_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 STATUS_SUCCESS = 0 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_SUCCESS (0U) -/// saturated uint8 STATUS_FAILURE = 1 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_FAILURE (1U) -/// saturated uint8 STATUS_NOT_AUTHORIZED = 2 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_NOT_AUTHORIZED (2U) -/// saturated uint8 STATUS_BAD_COMMAND = 3 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_BAD_COMMAND (3U) -/// saturated uint8 STATUS_BAD_PARAMETER = 4 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_BAD_PARAMETER (4U) -/// saturated uint8 STATUS_BAD_STATE = 5 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_BAD_STATE (5U) -/// saturated uint8 STATUS_INTERNAL_ERROR = 6 -#define uavcan_node_ExecuteCommand_Response_1_1_STATUS_INTERNAL_ERROR (6U) - -typedef struct -{ - /// saturated uint8 status - uint8_t status; -} uavcan_node_ExecuteCommand_Response_1_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_ExecuteCommand_Response_1_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Response_1_1_serialize_( - const uavcan_node_ExecuteCommand_Response_1_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8 status - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->status); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ExecuteCommand_Response_1_1_deserialize_( - uavcan_node_ExecuteCommand_Response_1_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8 status - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->status = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->status = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_ExecuteCommand_Response_1_1_initialize_(uavcan_node_ExecuteCommand_Response_1_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_ExecuteCommand_Response_1_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_EXECUTE_COMMAND_1_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/GetInfo_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/GetInfo_1_0.h deleted file mode 100644 index 09c04c1bf..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/GetInfo_1_0.h +++ /dev/null @@ -1,616 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.018338 UTC -// Is deprecated: no -// Fixed port-ID: 430 -// Full name: uavcan.node.GetInfo -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_GET_INFO_1_0_INCLUDED_ -#define UAVCAN_NODE_GET_INFO_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/430.GetInfo.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_GetInfo_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_node_GetInfo_1_0_FIXED_PORT_ID_ 430U - -#define uavcan_node_GetInfo_1_0_FULL_NAME_ "uavcan.node.GetInfo" -#define uavcan_node_GetInfo_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.GetInfo.1.0" - -#define uavcan_node_GetInfo_Request_1_0_FULL_NAME_ "uavcan.node.GetInfo.Request" -#define uavcan_node_GetInfo_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.GetInfo.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_GetInfo_Request_1_0_EXTENT_BYTES_ 0UL -#define uavcan_node_GetInfo_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_node_GetInfo_Request_1_0_EXTENT_BYTES_ >= uavcan_node_GetInfo_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_node_GetInfo_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_GetInfo_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetInfo_Request_1_0_serialize_( - const uavcan_node_GetInfo_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetInfo_Request_1_0_deserialize_( - uavcan_node_GetInfo_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_GetInfo_Request_1_0_initialize_(uavcan_node_GetInfo_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_GetInfo_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_node_GetInfo_Response_1_0_FULL_NAME_ "uavcan.node.GetInfo.Response" -#define uavcan_node_GetInfo_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.GetInfo.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_GetInfo_Response_1_0_EXTENT_BYTES_ 448UL -#define uavcan_node_GetInfo_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 313UL -static_assert(uavcan_node_GetInfo_Response_1_0_EXTENT_BYTES_ >= uavcan_node_GetInfo_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[16] unique_id -#define uavcan_node_GetInfo_Response_1_0_unique_id_ARRAY_CAPACITY_ 16U -#define uavcan_node_GetInfo_Response_1_0_unique_id_ARRAY_IS_VARIABLE_LENGTH_ false -/// Array metadata for: saturated uint8[<=50] name -#define uavcan_node_GetInfo_Response_1_0_name_ARRAY_CAPACITY_ 50U -#define uavcan_node_GetInfo_Response_1_0_name_ARRAY_IS_VARIABLE_LENGTH_ true -/// Array metadata for: saturated uint64[<=1] software_image_crc -#define uavcan_node_GetInfo_Response_1_0_software_image_crc_ARRAY_CAPACITY_ 1U -#define uavcan_node_GetInfo_Response_1_0_software_image_crc_ARRAY_IS_VARIABLE_LENGTH_ true -/// Array metadata for: saturated uint8[<=222] certificate_of_authenticity -#define uavcan_node_GetInfo_Response_1_0_certificate_of_authenticity_ARRAY_CAPACITY_ 222U -#define uavcan_node_GetInfo_Response_1_0_certificate_of_authenticity_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.node.Version.1.0 protocol_version - uavcan_node_Version_1_0 protocol_version; - - /// uavcan.node.Version.1.0 hardware_version - uavcan_node_Version_1_0 hardware_version; - - /// uavcan.node.Version.1.0 software_version - uavcan_node_Version_1_0 software_version; - - /// saturated uint64 software_vcs_revision_id - uint64_t software_vcs_revision_id; - - /// saturated uint8[16] unique_id - uint8_t unique_id[16]; - - /// saturated uint8[<=50] name - struct /// Array address equivalence guarantee: &elements[0] == &name - { - uint8_t elements[uavcan_node_GetInfo_Response_1_0_name_ARRAY_CAPACITY_]; - size_t count; - } name; - - /// saturated uint64[<=1] software_image_crc - struct /// Array address equivalence guarantee: &elements[0] == &software_image_crc - { - uint64_t elements[uavcan_node_GetInfo_Response_1_0_software_image_crc_ARRAY_CAPACITY_]; - size_t count; - } software_image_crc; - - /// saturated uint8[<=222] certificate_of_authenticity - struct /// Array address equivalence guarantee: &elements[0] == &certificate_of_authenticity - { - uint8_t elements[uavcan_node_GetInfo_Response_1_0_certificate_of_authenticity_ARRAY_CAPACITY_]; - size_t count; - } certificate_of_authenticity; -} uavcan_node_GetInfo_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_GetInfo_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetInfo_Response_1_0_serialize_( - const uavcan_node_GetInfo_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2504UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.node.Version.1.0 protocol_version - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_node_Version_1_0_serialize_( - &obj->protocol_version, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.Version.1.0 hardware_version - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_node_Version_1_0_serialize_( - &obj->hardware_version, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.node.Version.1.0 software_version - size_t _size_bytes2_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err4_ = uavcan_node_Version_1_0_serialize_( - &obj->software_version, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint64 software_vcs_revision_id - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->software_vcs_revision_id, 8U); - offset_bits += 64U; - } - - - - - { // saturated uint8[16] unique_id - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 16UL * 8U, &obj->unique_id[0], 0U); - offset_bits += 16UL * 8U; - } - - - - - { // saturated uint8[<=50] name - if (obj->name.count > 50) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->name.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->name.count * 8U, &obj->name.elements[0], 0U); - offset_bits += obj->name.count * 8U; - } - - - - - { // saturated uint64[<=1] software_image_crc - if (obj->software_image_crc.count > 1) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->software_image_crc.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->software_image_crc.count * 64UL, &obj->software_image_crc.elements[0], 0U); - offset_bits += obj->software_image_crc.count * 64UL; - } - - - - - { // saturated uint8[<=222] certificate_of_authenticity - if (obj->certificate_of_authenticity.count > 222) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->certificate_of_authenticity.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->certificate_of_authenticity.count * 8U, &obj->certificate_of_authenticity.elements[0], 0U); - offset_bits += obj->certificate_of_authenticity.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetInfo_Response_1_0_deserialize_( - uavcan_node_GetInfo_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.node.Version.1.0 protocol_version - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_node_Version_1_0_deserialize_( - &out_obj->protocol_version, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.Version.1.0 hardware_version - { - size_t _size_bytes4_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err7_ = uavcan_node_Version_1_0_deserialize_( - &out_obj->hardware_version, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _size_bytes4_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.Version.1.0 software_version - { - size_t _size_bytes5_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err8_ = uavcan_node_Version_1_0_deserialize_( - &out_obj->software_version, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err8_ < 0) - { - return _err8_; - } - offset_bits += _size_bytes5_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint64 software_vcs_revision_id - out_obj->software_vcs_revision_id = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 64); - offset_bits += 64U; - - - - - // saturated uint8[16] unique_id - nunavutGetBits(&out_obj->unique_id[0], &buffer[0], capacity_bytes, offset_bits, 16UL * 8U); - offset_bits += 16UL * 8U; - - - - - // saturated uint8[<=50] name - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->name.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->name.count = 0U; - } - offset_bits += 8U; - if (out_obj->name.count > 50U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->name.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->name.count * 8U); - offset_bits += out_obj->name.count * 8U; - - - - - // saturated uint64[<=1] software_image_crc - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->software_image_crc.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->software_image_crc.count = 0U; - } - offset_bits += 8U; - if (out_obj->software_image_crc.count > 1U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->software_image_crc.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->software_image_crc.count * 64U); - offset_bits += out_obj->software_image_crc.count * 64U; - - - - - // saturated uint8[<=222] certificate_of_authenticity - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->certificate_of_authenticity.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->certificate_of_authenticity.count = 0U; - } - offset_bits += 8U; - if (out_obj->certificate_of_authenticity.count > 222U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->certificate_of_authenticity.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->certificate_of_authenticity.count * 8U); - offset_bits += out_obj->certificate_of_authenticity.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_GetInfo_Response_1_0_initialize_(uavcan_node_GetInfo_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_GetInfo_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_GET_INFO_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/GetTransportStatistics_0_1.h b/platformio/stima_v4/libraries/include/uavcan/node/GetTransportStatistics_0_1.h deleted file mode 100644 index 5d549a041..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/GetTransportStatistics_0_1.h +++ /dev/null @@ -1,427 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl -// Generated at: 2023-07-11 16:47:50.018338 UTC -// Is deprecated: no -// Fixed port-ID: 434 -// Full name: uavcan.node.GetTransportStatistics -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_GET_TRANSPORT_STATISTICS_0_1_INCLUDED_ -#define UAVCAN_NODE_GET_TRANSPORT_STATISTICS_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/434.GetTransportStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_GetTransportStatistics_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_node_GetTransportStatistics_0_1_FIXED_PORT_ID_ 434U - -#define uavcan_node_GetTransportStatistics_0_1_FULL_NAME_ "uavcan.node.GetTransportStatistics" -#define uavcan_node_GetTransportStatistics_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.GetTransportStatistics.0.1" - -#define uavcan_node_GetTransportStatistics_Request_0_1_FULL_NAME_ "uavcan.node.GetTransportStatistics.Request" -#define uavcan_node_GetTransportStatistics_Request_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.GetTransportStatistics.Request.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_GetTransportStatistics_Request_0_1_EXTENT_BYTES_ 0UL -#define uavcan_node_GetTransportStatistics_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_node_GetTransportStatistics_Request_0_1_EXTENT_BYTES_ >= uavcan_node_GetTransportStatistics_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_node_GetTransportStatistics_Request_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_GetTransportStatistics_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetTransportStatistics_Request_0_1_serialize_( - const uavcan_node_GetTransportStatistics_Request_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetTransportStatistics_Request_0_1_deserialize_( - uavcan_node_GetTransportStatistics_Request_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_GetTransportStatistics_Request_0_1_initialize_(uavcan_node_GetTransportStatistics_Request_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_GetTransportStatistics_Request_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_node_GetTransportStatistics_Response_0_1_FULL_NAME_ "uavcan.node.GetTransportStatistics.Response" -#define uavcan_node_GetTransportStatistics_Response_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.GetTransportStatistics.Response.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_GetTransportStatistics_Response_0_1_EXTENT_BYTES_ 192UL -#define uavcan_node_GetTransportStatistics_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 61UL -static_assert(uavcan_node_GetTransportStatistics_Response_0_1_EXTENT_BYTES_ >= uavcan_node_GetTransportStatistics_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 MAX_NETWORK_INTERFACES = 3 -#define uavcan_node_GetTransportStatistics_Response_0_1_MAX_NETWORK_INTERFACES (3U) - -/// Array metadata for: uavcan.node.IOStatistics.0.1[<=3] network_interface_statistics -#define uavcan_node_GetTransportStatistics_Response_0_1_network_interface_statistics_ARRAY_CAPACITY_ 3U -#define uavcan_node_GetTransportStatistics_Response_0_1_network_interface_statistics_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// uavcan.node.IOStatistics.0.1 transfer_statistics - uavcan_node_IOStatistics_0_1 transfer_statistics; - - /// uavcan.node.IOStatistics.0.1[<=3] network_interface_statistics - struct /// Array address equivalence guarantee: &elements[0] == &network_interface_statistics - { - uavcan_node_IOStatistics_0_1 elements[uavcan_node_GetTransportStatistics_Response_0_1_network_interface_statistics_ARRAY_CAPACITY_]; - size_t count; - } network_interface_statistics; -} uavcan_node_GetTransportStatistics_Response_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_GetTransportStatistics_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetTransportStatistics_Response_0_1_serialize_( - const uavcan_node_GetTransportStatistics_Response_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 488UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.node.IOStatistics.0.1 transfer_statistics - size_t _size_bytes0_ = 15UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_node_IOStatistics_0_1_serialize_( - &obj->transfer_statistics, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.IOStatistics.0.1[<=3] network_interface_statistics - if (obj->network_interface_statistics.count > 3) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->network_interface_statistics.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->network_interface_statistics.count; ++_index0_) - { - size_t _size_bytes1_ = 15UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_node_IOStatistics_0_1_serialize_( - &obj->network_interface_statistics.elements[_index0_], &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_GetTransportStatistics_Response_0_1_deserialize_( - uavcan_node_GetTransportStatistics_Response_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.node.IOStatistics.0.1 transfer_statistics - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_node_IOStatistics_0_1_deserialize_( - &out_obj->transfer_statistics, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.IOStatistics.0.1[<=3] network_interface_statistics - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->network_interface_statistics.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->network_interface_statistics.count = 0U; - } - offset_bits += 8U; - if (out_obj->network_interface_statistics.count > 3U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->network_interface_statistics.count; ++_index1_) - { - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_node_IOStatistics_0_1_deserialize_( - &out_obj->network_interface_statistics.elements[_index1_], &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_GetTransportStatistics_Response_0_1_initialize_(uavcan_node_GetTransportStatistics_Response_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_GetTransportStatistics_Response_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_GET_TRANSPORT_STATISTICS_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/Health_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/Health_1_0.h deleted file mode 100644 index dbc88c9cb..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/Health_1_0.h +++ /dev/null @@ -1,245 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.034016 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.Health -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_HEALTH_1_0_INCLUDED_ -#define UAVCAN_NODE_HEALTH_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Health.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_Health_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_Health_1_0_FULL_NAME_ "uavcan.node.Health" -#define uavcan_node_Health_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.Health.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_Health_1_0_EXTENT_BYTES_ 1UL -#define uavcan_node_Health_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_node_Health_1_0_EXTENT_BYTES_ >= uavcan_node_Health_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint2 NOMINAL = 0 -#define uavcan_node_Health_1_0_NOMINAL (0U) -/// saturated uint2 ADVISORY = 1 -#define uavcan_node_Health_1_0_ADVISORY (1U) -/// saturated uint2 CAUTION = 2 -#define uavcan_node_Health_1_0_CAUTION (2U) -/// saturated uint2 WARNING = 3 -#define uavcan_node_Health_1_0_WARNING (3U) - -typedef struct -{ - /// saturated uint2 value - uint8_t value; -} uavcan_node_Health_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_Health_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Health_1_0_serialize_( - const uavcan_node_Health_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint2 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 3U) - { - _sat0_ = 3U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 2U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Health_1_0_deserialize_( - uavcan_node_Health_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint2 value - if ((offset_bits + 2U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 3U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 2U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_Health_1_0_initialize_(uavcan_node_Health_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_Health_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_HEALTH_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/Heartbeat_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/Heartbeat_1_0.h deleted file mode 100644 index 0b1aa47ae..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/Heartbeat_1_0.h +++ /dev/null @@ -1,343 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.034016 UTC -// Is deprecated: no -// Fixed port-ID: 7509 -// Full name: uavcan.node.Heartbeat -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_HEARTBEAT_1_0_INCLUDED_ -#define UAVCAN_NODE_HEARTBEAT_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/7509.Heartbeat.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_Heartbeat_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_node_Heartbeat_1_0_FIXED_PORT_ID_ 7509U - -#define uavcan_node_Heartbeat_1_0_FULL_NAME_ "uavcan.node.Heartbeat" -#define uavcan_node_Heartbeat_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.Heartbeat.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_Heartbeat_1_0_EXTENT_BYTES_ 12UL -#define uavcan_node_Heartbeat_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 7UL -static_assert(uavcan_node_Heartbeat_1_0_EXTENT_BYTES_ >= uavcan_node_Heartbeat_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 MAX_PUBLICATION_PERIOD = 1 -#define uavcan_node_Heartbeat_1_0_MAX_PUBLICATION_PERIOD (1U) -/// saturated uint16 OFFLINE_TIMEOUT = 3 -#define uavcan_node_Heartbeat_1_0_OFFLINE_TIMEOUT (3U) - -typedef struct -{ - /// saturated uint32 uptime - uint32_t uptime; - - /// uavcan.node.Health.1.0 health - uavcan_node_Health_1_0 health; - - /// uavcan.node.Mode.1.0 mode - uavcan_node_Mode_1_0 mode; - - /// saturated uint8 vendor_specific_status_code - uint8_t vendor_specific_status_code; -} uavcan_node_Heartbeat_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_Heartbeat_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Heartbeat_1_0_serialize_( - const uavcan_node_Heartbeat_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 56UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 uptime - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->uptime, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.Health.1.0 health - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_node_Health_1_0_serialize_( - &obj->health, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - - { // uavcan.node.Mode.1.0 mode - size_t _size_bytes1_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_node_Mode_1_0_serialize_( - &obj->mode, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8 vendor_specific_status_code - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->vendor_specific_status_code); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Heartbeat_1_0_deserialize_( - uavcan_node_Heartbeat_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 uptime - out_obj->uptime = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.Health.1.0 health - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_node_Health_1_0_deserialize_( - &out_obj->health, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.Mode.1.0 mode - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_node_Mode_1_0_deserialize_( - &out_obj->mode, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8 vendor_specific_status_code - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->vendor_specific_status_code = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->vendor_specific_status_code = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_Heartbeat_1_0_initialize_(uavcan_node_Heartbeat_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_Heartbeat_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_HEARTBEAT_1_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/node/ID_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/ID_1_0.h deleted file mode 100644 index 2d7e9d4ff..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/ID_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.034016 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.ID -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_ID_1_0_INCLUDED_ -#define UAVCAN_NODE_ID_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_ID_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_ID_1_0_FULL_NAME_ "uavcan.node.ID" -#define uavcan_node_ID_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.ID.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_ID_1_0_EXTENT_BYTES_ 2UL -#define uavcan_node_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_node_ID_1_0_EXTENT_BYTES_ >= uavcan_node_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint16 value - uint16_t value; -} uavcan_node_ID_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ID_1_0_serialize_( - const uavcan_node_ID_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_ID_1_0_deserialize_( - uavcan_node_ID_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_ID_1_0_initialize_(uavcan_node_ID_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_ID_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_ID_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/IOStatistics_0_1.h b/platformio/stima_v4/libraries/include/uavcan/node/IOStatistics_0_1.h deleted file mode 100644 index cc1c41cb6..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/IOStatistics_0_1.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl -// Generated at: 2023-07-11 16:47:50.049673 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.IOStatistics -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_IO_STATISTICS_0_1_INCLUDED_ -#define UAVCAN_NODE_IO_STATISTICS_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/IOStatistics.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_IOStatistics_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_IOStatistics_0_1_FULL_NAME_ "uavcan.node.IOStatistics" -#define uavcan_node_IOStatistics_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.IOStatistics.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_IOStatistics_0_1_EXTENT_BYTES_ 15UL -#define uavcan_node_IOStatistics_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 15UL -static_assert(uavcan_node_IOStatistics_0_1_EXTENT_BYTES_ >= uavcan_node_IOStatistics_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// truncated uint40 num_emitted - uint64_t num_emitted; - - /// truncated uint40 num_received - uint64_t num_received; - - /// truncated uint40 num_errored - uint64_t num_errored; -} uavcan_node_IOStatistics_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_IOStatistics_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_IOStatistics_0_1_serialize_( - const uavcan_node_IOStatistics_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 120UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint40 num_emitted - (void) memmove(&buffer[offset_bits / 8U], &obj->num_emitted, 5U); - offset_bits += 40U; - } - - - - - { // truncated uint40 num_received - (void) memmove(&buffer[offset_bits / 8U], &obj->num_received, 5U); - offset_bits += 40U; - } - - - - - { // truncated uint40 num_errored - (void) memmove(&buffer[offset_bits / 8U], &obj->num_errored, 5U); - offset_bits += 40U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_IOStatistics_0_1_deserialize_( - uavcan_node_IOStatistics_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint40 num_emitted - out_obj->num_emitted = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // truncated uint40 num_received - out_obj->num_received = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - - - // truncated uint40 num_errored - out_obj->num_errored = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 40); - offset_bits += 40U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_IOStatistics_0_1_initialize_(uavcan_node_IOStatistics_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_IOStatistics_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_IO_STATISTICS_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/Mode_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/Mode_1_0.h deleted file mode 100644 index 85af7d1d8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/Mode_1_0.h +++ /dev/null @@ -1,245 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.049673 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.Mode -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_MODE_1_0_INCLUDED_ -#define UAVCAN_NODE_MODE_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Mode.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_Mode_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_Mode_1_0_FULL_NAME_ "uavcan.node.Mode" -#define uavcan_node_Mode_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.Mode.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_Mode_1_0_EXTENT_BYTES_ 1UL -#define uavcan_node_Mode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_node_Mode_1_0_EXTENT_BYTES_ >= uavcan_node_Mode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint3 OPERATIONAL = 0 -#define uavcan_node_Mode_1_0_OPERATIONAL (0U) -/// saturated uint3 INITIALIZATION = 1 -#define uavcan_node_Mode_1_0_INITIALIZATION (1U) -/// saturated uint3 MAINTENANCE = 2 -#define uavcan_node_Mode_1_0_MAINTENANCE (2U) -/// saturated uint3 SOFTWARE_UPDATE = 3 -#define uavcan_node_Mode_1_0_SOFTWARE_UPDATE (3U) - -typedef struct -{ - /// saturated uint3 value - uint8_t value; -} uavcan_node_Mode_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_Mode_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Mode_1_0_serialize_( - const uavcan_node_Mode_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint3 value - uint8_t _sat0_ = obj->value; - if (_sat0_ > 7U) - { - _sat0_ = 7U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 3U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Mode_1_0_deserialize_( - uavcan_node_Mode_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint3 value - if ((offset_bits + 3U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 7U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 3U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_Mode_1_0_initialize_(uavcan_node_Mode_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_Mode_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_MODE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/Version_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/Version_1_0.h deleted file mode 100644 index d83348e24..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/Version_1_0.h +++ /dev/null @@ -1,258 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.049673 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.Version -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_VERSION_1_0_INCLUDED_ -#define UAVCAN_NODE_VERSION_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/Version.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_Version_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_Version_1_0_FULL_NAME_ "uavcan.node.Version" -#define uavcan_node_Version_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.Version.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_Version_1_0_EXTENT_BYTES_ 2UL -#define uavcan_node_Version_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_node_Version_1_0_EXTENT_BYTES_ >= uavcan_node_Version_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint8 major - uint8_t major; - - /// saturated uint8 minor - uint8_t minor; -} uavcan_node_Version_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_Version_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Version_1_0_serialize_( - const uavcan_node_Version_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8 major - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->major); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - - - { // saturated uint8 minor - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->minor); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_Version_1_0_deserialize_( - uavcan_node_Version_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8 major - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->major = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->major = 0U; - } - offset_bits += 8U; - - - - - // saturated uint8 minor - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->minor = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->minor = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_Version_1_0_initialize_(uavcan_node_Version_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_Version_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_VERSION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/ID_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/port/ID_1_0.h deleted file mode 100644 index b19a384d5..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/ID_1_0.h +++ /dev/null @@ -1,324 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.049673 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.port.ID -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_ID_1_0_INCLUDED_ -#define UAVCAN_NODE_PORT_ID_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_port_ID_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_port_ID_1_0_FULL_NAME_ "uavcan.node.port.ID" -#define uavcan_node_port_ID_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.port.ID.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_ID_1_0_EXTENT_BYTES_ 3UL -#define uavcan_node_port_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 3UL -static_assert(uavcan_node_port_ID_1_0_EXTENT_BYTES_ >= uavcan_node_port_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_node_port_ID_1_0_UNION_OPTION_COUNT_ 2U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// uavcan.node.port.SubjectID.1.0 subject_id - uavcan_node_port_SubjectID_1_0 subject_id; - - /// uavcan.node.port.ServiceID.1.0 service_id - uavcan_node_port_ServiceID_1_0 service_id; - }; - uint8_t _tag_; -} uavcan_node_port_ID_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_ID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ID_1_0_serialize_( - const uavcan_node_port_ID_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 24UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // uavcan.node.port.SubjectID.1.0 subject_id - { - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_node_port_SubjectID_1_0_serialize_( - &obj->subject_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - else if (1U == obj->_tag_) // uavcan.node.port.ServiceID.1.0 service_id - { - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_node_port_ServiceID_1_0_serialize_( - &obj->service_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ID_1_0_deserialize_( - uavcan_node_port_ID_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // uavcan.node.port.SubjectID.1.0 subject_id - { - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_node_port_SubjectID_1_0_deserialize_( - &out_obj->subject_id, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else if (1U == out_obj->_tag_) // uavcan.node.port.ServiceID.1.0 service_id - { - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_node_port_ServiceID_1_0_deserialize_( - &out_obj->service_id, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_ID_1_0_initialize_(uavcan_node_port_ID_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_ID_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "subject_id" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_node_port_ID_1_0_select_subject_id_(uavcan_node_port_ID_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "subject_id" is active. Returns false if @param obj is NULL. -static inline bool uavcan_node_port_ID_1_0_is_subject_id_(const uavcan_node_port_ID_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "service_id" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_node_port_ID_1_0_select_service_id_(uavcan_node_port_ID_1_0* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "service_id" is active. Returns false if @param obj is NULL. -static inline bool uavcan_node_port_ID_1_0_is_service_id_(const uavcan_node_port_ID_1_0* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_ID_1_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/List_0_1.h b/platformio/stima_v4/libraries/include/uavcan/node/port/List_0_1.h deleted file mode 100644 index 420a68573..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/List_0_1.h +++ /dev/null @@ -1,423 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl -// Generated at: 2023-07-11 16:47:50.065533 UTC -// Is deprecated: no -// Fixed port-ID: 7510 -// Full name: uavcan.node.port.List -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_LIST_0_1_INCLUDED_ -#define UAVCAN_NODE_PORT_LIST_0_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/7510.List.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_node_port_List_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_node_port_List_0_1_FIXED_PORT_ID_ 7510U - -#define uavcan_node_port_List_0_1_FULL_NAME_ "uavcan.node.port.List" -#define uavcan_node_port_List_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.port.List.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_List_0_1_EXTENT_BYTES_ 8466UL -#define uavcan_node_port_List_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 8466UL -static_assert(uavcan_node_port_List_0_1_EXTENT_BYTES_ >= uavcan_node_port_List_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 MAX_PUBLICATION_PERIOD = 10 -#define uavcan_node_port_List_0_1_MAX_PUBLICATION_PERIOD (10U) - -typedef struct -{ - /// uavcan.node.port.SubjectIDList.0.1 publishers - uavcan_node_port_SubjectIDList_0_1 publishers; - - /// uavcan.node.port.SubjectIDList.0.1 subscribers - uavcan_node_port_SubjectIDList_0_1 subscribers; - - /// uavcan.node.port.ServiceIDList.0.1 clients - uavcan_node_port_ServiceIDList_0_1 clients; - - /// uavcan.node.port.ServiceIDList.0.1 servers - uavcan_node_port_ServiceIDList_0_1 servers; -} uavcan_node_port_List_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_List_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_List_0_1_serialize_( - const uavcan_node_port_List_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 67728UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.node.port.SubjectIDList.0.1 publishers - size_t _size_bytes0_ = 1025UL; // Nested object (max) size, in bytes. - offset_bits += 32U; // Reserve space for the delimiter header. - int8_t _err0_ = uavcan_node_port_SubjectIDList_0_1_serialize_( - &obj->publishers, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - // Jump back to write the delimiter header after the nested object is serialized and its length is known. - (void) memmove(&buffer[(offset_bits - 32) / 8U], &_size_bytes0_, 4U); - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.port.SubjectIDList.0.1 subscribers - size_t _size_bytes1_ = 1025UL; // Nested object (max) size, in bytes. - offset_bits += 32U; // Reserve space for the delimiter header. - int8_t _err2_ = uavcan_node_port_SubjectIDList_0_1_serialize_( - &obj->subscribers, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - // Jump back to write the delimiter header after the nested object is serialized and its length is known. - (void) memmove(&buffer[(offset_bits - 32) / 8U], &_size_bytes1_, 4U); - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - - { // uavcan.node.port.ServiceIDList.0.1 clients - size_t _size_bytes2_ = 64UL; // Nested object (max) size, in bytes. - // Constant delimiter header can be written ahead of the nested object. - (void) memmove(&buffer[offset_bits / 8U], &_size_bytes2_, 4U); - offset_bits += 32U; - int8_t _err4_ = uavcan_node_port_ServiceIDList_0_1_serialize_( - &obj->clients, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err4_ < 0) - { - return _err4_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err5_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _pad2_; - } - - { // uavcan.node.port.ServiceIDList.0.1 servers - size_t _size_bytes3_ = 64UL; // Nested object (max) size, in bytes. - // Constant delimiter header can be written ahead of the nested object. - (void) memmove(&buffer[offset_bits / 8U], &_size_bytes3_, 4U); - offset_bits += 32U; - int8_t _err6_ = uavcan_node_port_ServiceIDList_0_1_serialize_( - &obj->servers, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad3_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err7_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad3_); // Optimize? - if (_err7_ < 0) - { - return _err7_; - } - offset_bits += _pad3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_List_0_1_deserialize_( - uavcan_node_port_List_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.node.port.SubjectIDList.0.1 publishers - { - // Delimiter header: truncated uint32 - size_t _size_bytes4_ = 0U; - _size_bytes4_ = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - if (_size_bytes4_ > (capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes))) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_DELIMITER_HEADER; - } - const size_t _dh0_ = _size_bytes4_; // Store the original delimiter header value. - const int8_t _err8_ = uavcan_node_port_SubjectIDList_0_1_deserialize_( - &out_obj->publishers, &buffer[offset_bits / 8U], &_size_bytes4_); - if (_err8_ < 0) - { - return _err8_; - } - // Advance the offset by the size of the delimiter header, even if the nested deserialization routine - // consumed fewer bytes of data. This behavior implements the implicit truncation rule for nested objects. - offset_bits += _dh0_ * 8U; - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.port.SubjectIDList.0.1 subscribers - { - // Delimiter header: truncated uint32 - size_t _size_bytes5_ = 0U; - _size_bytes5_ = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - if (_size_bytes5_ > (capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes))) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_DELIMITER_HEADER; - } - const size_t _dh1_ = _size_bytes5_; // Store the original delimiter header value. - const int8_t _err9_ = uavcan_node_port_SubjectIDList_0_1_deserialize_( - &out_obj->subscribers, &buffer[offset_bits / 8U], &_size_bytes5_); - if (_err9_ < 0) - { - return _err9_; - } - // Advance the offset by the size of the delimiter header, even if the nested deserialization routine - // consumed fewer bytes of data. This behavior implements the implicit truncation rule for nested objects. - offset_bits += _dh1_ * 8U; - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.port.ServiceIDList.0.1 clients - { - // Delimiter header: truncated uint32 - size_t _size_bytes6_ = 0U; - _size_bytes6_ = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - if (_size_bytes6_ > (capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes))) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_DELIMITER_HEADER; - } - const size_t _dh2_ = _size_bytes6_; // Store the original delimiter header value. - const int8_t _err10_ = uavcan_node_port_ServiceIDList_0_1_deserialize_( - &out_obj->clients, &buffer[offset_bits / 8U], &_size_bytes6_); - if (_err10_ < 0) - { - return _err10_; - } - // Advance the offset by the size of the delimiter header, even if the nested deserialization routine - // consumed fewer bytes of data. This behavior implements the implicit truncation rule for nested objects. - offset_bits += _dh2_ * 8U; - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.port.ServiceIDList.0.1 servers - { - // Delimiter header: truncated uint32 - size_t _size_bytes7_ = 0U; - _size_bytes7_ = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - if (_size_bytes7_ > (capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes))) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_DELIMITER_HEADER; - } - const size_t _dh3_ = _size_bytes7_; // Store the original delimiter header value. - const int8_t _err11_ = uavcan_node_port_ServiceIDList_0_1_deserialize_( - &out_obj->servers, &buffer[offset_bits / 8U], &_size_bytes7_); - if (_err11_ < 0) - { - return _err11_; - } - // Advance the offset by the size of the delimiter header, even if the nested deserialization routine - // consumed fewer bytes of data. This behavior implements the implicit truncation rule for nested objects. - offset_bits += _dh3_ * 8U; - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_List_0_1_initialize_(uavcan_node_port_List_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_List_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_LIST_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceIDList_0_1.h b/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceIDList_0_1.h deleted file mode 100644 index aca68b520..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceIDList_0_1.h +++ /dev/null @@ -1,236 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl -// Generated at: 2023-07-11 16:47:50.065533 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.port.ServiceIDList -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_SERVICE_ID_LIST_0_1_INCLUDED_ -#define UAVCAN_NODE_PORT_SERVICE_ID_LIST_0_1_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_port_ServiceIDList_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_port_ServiceIDList_0_1_FULL_NAME_ "uavcan.node.port.ServiceIDList" -#define uavcan_node_port_ServiceIDList_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.port.ServiceIDList.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_ServiceIDList_0_1_EXTENT_BYTES_ 128UL -#define uavcan_node_port_ServiceIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 64UL -static_assert(uavcan_node_port_ServiceIDList_0_1_EXTENT_BYTES_ >= uavcan_node_port_ServiceIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 CAPACITY = 512 -#define uavcan_node_port_ServiceIDList_0_1_CAPACITY (512U) - -/// Array metadata for: saturated bool[512] mask -#define uavcan_node_port_ServiceIDList_0_1_mask_ARRAY_CAPACITY_ 512U -#define uavcan_node_port_ServiceIDList_0_1_mask_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated bool[512] mask - /// Bitpacked array, capacity 512 bits. Access via @ref nunavutSetBit(), @ref nunavutGetBit(). - uint8_t mask_bitpacked_[64]; -} uavcan_node_port_ServiceIDList_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_ServiceIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ServiceIDList_0_1_serialize_( - const uavcan_node_port_ServiceIDList_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 512UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated bool[512] mask - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 512UL, &obj->mask_bitpacked_[0], 0U); - offset_bits += 512UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ServiceIDList_0_1_deserialize_( - uavcan_node_port_ServiceIDList_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated bool[512] mask - nunavutGetBits(&out_obj->mask_bitpacked_[0], &buffer[0], capacity_bytes, offset_bits, 512UL); - offset_bits += 512UL; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_ServiceIDList_0_1_initialize_(uavcan_node_port_ServiceIDList_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_ServiceIDList_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_SERVICE_ID_LIST_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceID_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceID_1_0.h deleted file mode 100644 index 019d5eb76..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/ServiceID_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.065533 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.port.ServiceID -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_SERVICE_ID_1_0_INCLUDED_ -#define UAVCAN_NODE_PORT_SERVICE_ID_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/ServiceID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_port_ServiceID_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_port_ServiceID_1_0_FULL_NAME_ "uavcan.node.port.ServiceID" -#define uavcan_node_port_ServiceID_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.port.ServiceID.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_ServiceID_1_0_EXTENT_BYTES_ 2UL -#define uavcan_node_port_ServiceID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_node_port_ServiceID_1_0_EXTENT_BYTES_ >= uavcan_node_port_ServiceID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint9 MAX = 511 -#define uavcan_node_port_ServiceID_1_0_MAX (511U) - -typedef struct -{ - /// saturated uint9 value - uint16_t value; -} uavcan_node_port_ServiceID_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_ServiceID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ServiceID_1_0_serialize_( - const uavcan_node_port_ServiceID_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint9 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 511U) - { - _sat0_ = 511U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 9U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_ServiceID_1_0_deserialize_( - uavcan_node_port_ServiceID_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint9 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 9); - offset_bits += 9U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_ServiceID_1_0_initialize_(uavcan_node_port_ServiceID_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_ServiceID_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_SERVICE_ID_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectIDList_0_1.h b/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectIDList_0_1.h deleted file mode 100644 index 56015b65d..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectIDList_0_1.h +++ /dev/null @@ -1,398 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl -// Generated at: 2023-07-11 16:47:50.081500 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.port.SubjectIDList -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_SUBJECT_ID_LIST_0_1_INCLUDED_ -#define UAVCAN_NODE_PORT_SUBJECT_ID_LIST_0_1_INCLUDED_ - -#include -#include -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectIDList.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_port_SubjectIDList_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_port_SubjectIDList_0_1_FULL_NAME_ "uavcan.node.port.SubjectIDList" -#define uavcan_node_port_SubjectIDList_0_1_FULL_NAME_AND_VERSION_ "uavcan.node.port.SubjectIDList.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_SubjectIDList_0_1_EXTENT_BYTES_ 4097UL -#define uavcan_node_port_SubjectIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 1025UL -static_assert(uavcan_node_port_SubjectIDList_0_1_EXTENT_BYTES_ >= uavcan_node_port_SubjectIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint16 CAPACITY = 8192 -#define uavcan_node_port_SubjectIDList_0_1_CAPACITY (8192U) - -/// Array metadata for: saturated bool[8192] mask -#define uavcan_node_port_SubjectIDList_0_1_mask_ARRAY_CAPACITY_ 8192U -#define uavcan_node_port_SubjectIDList_0_1_mask_ARRAY_IS_VARIABLE_LENGTH_ false -/// Array metadata for: uavcan.node.port.SubjectID.1.0[<=255] sparse_list -#define uavcan_node_port_SubjectIDList_0_1_sparse_list_ARRAY_CAPACITY_ 255U -#define uavcan_node_port_SubjectIDList_0_1_sparse_list_ARRAY_IS_VARIABLE_LENGTH_ true - -/// The number of fields in the union. Valid tag values range from zero to this value minus one, inclusive. -#define uavcan_node_port_SubjectIDList_0_1_UNION_OPTION_COUNT_ 3U - -typedef struct -{ - union /// The union is placed first to ensure that the active element address equals the struct address. - { - /// saturated bool[8192] mask - /// Bitpacked array, capacity 8192 bits. Access via @ref nunavutSetBit(), @ref nunavutGetBit(). - uint8_t mask_bitpacked_[1024]; - - /// uavcan.node.port.SubjectID.1.0[<=255] sparse_list - struct /// Array address equivalence guarantee: &elements[0] == &sparse_list - { - uavcan_node_port_SubjectID_1_0 elements[uavcan_node_port_SubjectIDList_0_1_sparse_list_ARRAY_CAPACITY_]; - size_t count; - } sparse_list; - - /// uavcan.primitive.Empty.1.0 total - uavcan_primitive_Empty_1_0 _total; - }; - uint8_t _tag_; -} uavcan_node_port_SubjectIDList_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_SubjectIDList_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_SubjectIDList_0_1_serialize_( - const uavcan_node_port_SubjectIDList_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8200UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - { // Union tag field: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->_tag_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - if (0U == obj->_tag_) // saturated bool[8192] mask - { - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 8192UL, &obj->mask_bitpacked_[0], 0U); - offset_bits += 8192UL; - } - else if (1U == obj->_tag_) // uavcan.node.port.SubjectID.1.0[<=255] sparse_list - { - if (obj->sparse_list.count > 255) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->sparse_list.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->sparse_list.count; ++_index0_) - { - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_node_port_SubjectID_1_0_serialize_( - &obj->sparse_list.elements[_index0_], &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - } - else if (2U == obj->_tag_) // uavcan.primitive.Empty.1.0 total - { - size_t _size_bytes1_ = 0UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_primitive_Empty_1_0_serialize_( - &obj->_total, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_SubjectIDList_0_1_deserialize_( - uavcan_node_port_SubjectIDList_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - // Union tag field: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->_tag_ = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->_tag_ = 0U; - } - offset_bits += 8U; - - if (0U == out_obj->_tag_) // saturated bool[8192] mask - { - nunavutGetBits(&out_obj->mask_bitpacked_[0], &buffer[0], capacity_bytes, offset_bits, 8192UL); - offset_bits += 8192UL; - } - else if (1U == out_obj->_tag_) // uavcan.node.port.SubjectID.1.0[<=255] sparse_list - { - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->sparse_list.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->sparse_list.count = 0U; - } - offset_bits += 8U; - if (out_obj->sparse_list.count > 255U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->sparse_list.count; ++_index1_) - { - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_node_port_SubjectID_1_0_deserialize_( - &out_obj->sparse_list.elements[_index1_], &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - } - } - else if (2U == out_obj->_tag_) // uavcan.primitive.Empty.1.0 total - { - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_primitive_Empty_1_0_deserialize_( - &out_obj->_total, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - } - else - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_UNION_TAG; - } - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_SubjectIDList_0_1_initialize_(uavcan_node_port_SubjectIDList_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_SubjectIDList_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -/// Mark option "mask" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_node_port_SubjectIDList_0_1_select_mask_(uavcan_node_port_SubjectIDList_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 0; - } -} - -/// Check if option "mask" is active. Returns false if @param obj is NULL. -static inline bool uavcan_node_port_SubjectIDList_0_1_is_mask_(const uavcan_node_port_SubjectIDList_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 0)); -} - -/// Mark option "sparse_list" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_node_port_SubjectIDList_0_1_select_sparse_list_(uavcan_node_port_SubjectIDList_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 1; - } -} - -/// Check if option "sparse_list" is active. Returns false if @param obj is NULL. -static inline bool uavcan_node_port_SubjectIDList_0_1_is_sparse_list_(const uavcan_node_port_SubjectIDList_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 1)); -} - -/// Mark option "total" active without initializing it. Does nothing if @param obj is NULL. -static inline void uavcan_node_port_SubjectIDList_0_1_select_total_(uavcan_node_port_SubjectIDList_0_1* const obj) -{ - if (obj != NULL) - { - obj->_tag_ = 2; - } -} - -/// Check if option "total" is active. Returns false if @param obj is NULL. -static inline bool uavcan_node_port_SubjectIDList_0_1_is_total_(const uavcan_node_port_SubjectIDList_0_1* const obj) -{ - return ((obj != NULL) && (obj->_tag_ == 2)); -} - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_SUBJECT_ID_LIST_0_1_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectID_1_0.h b/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectID_1_0.h deleted file mode 100644 index c69f4fa53..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/node/port/SubjectID_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl -// Generated at: 2023-07-11 16:47:50.081500 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.node.port.SubjectID -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_NODE_PORT_SUBJECT_ID_1_0_INCLUDED_ -#define UAVCAN_NODE_PORT_SUBJECT_ID_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/node/port/SubjectID.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_node_port_SubjectID_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_node_port_SubjectID_1_0_FULL_NAME_ "uavcan.node.port.SubjectID" -#define uavcan_node_port_SubjectID_1_0_FULL_NAME_AND_VERSION_ "uavcan.node.port.SubjectID.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_node_port_SubjectID_1_0_EXTENT_BYTES_ 2UL -#define uavcan_node_port_SubjectID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_node_port_SubjectID_1_0_EXTENT_BYTES_ >= uavcan_node_port_SubjectID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint13 MAX = 8191 -#define uavcan_node_port_SubjectID_1_0_MAX (8191U) - -typedef struct -{ - /// saturated uint13 value - uint16_t value; -} uavcan_node_port_SubjectID_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_node_port_SubjectID_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_SubjectID_1_0_serialize_( - const uavcan_node_port_SubjectID_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint13 value - uint16_t _sat0_ = obj->value; - if (_sat0_ > 8191U) - { - _sat0_ = 8191U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 13U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_node_port_SubjectID_1_0_deserialize_( - uavcan_node_port_SubjectID_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint13 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 13); - offset_bits += 13U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_node_port_SubjectID_1_0_initialize_(uavcan_node_port_SubjectID_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_node_port_SubjectID_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_NODE_PORT_SUBJECT_ID_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_1_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_1_0.h deleted file mode 100644 index 1d9ecfea0..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_1_0.h +++ /dev/null @@ -1,303 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.484966 UTC -// Is deprecated: no -// Fixed port-ID: 8166 -// Full name: uavcan.pnp.NodeIDAllocationData -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_1_0_INCLUDED_ -#define UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8166.NodeIDAllocationData.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_pnp_NodeIDAllocationData_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_pnp_NodeIDAllocationData_1_0_FIXED_PORT_ID_ 8166U - -#define uavcan_pnp_NodeIDAllocationData_1_0_FULL_NAME_ "uavcan.pnp.NodeIDAllocationData" -#define uavcan_pnp_NodeIDAllocationData_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.NodeIDAllocationData.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_NodeIDAllocationData_1_0_EXTENT_BYTES_ 9UL -#define uavcan_pnp_NodeIDAllocationData_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 9UL -static_assert(uavcan_pnp_NodeIDAllocationData_1_0_EXTENT_BYTES_ >= uavcan_pnp_NodeIDAllocationData_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: uavcan.node.ID.1.0[<=1] allocated_node_id -#define uavcan_pnp_NodeIDAllocationData_1_0_allocated_node_id_ARRAY_CAPACITY_ 1U -#define uavcan_pnp_NodeIDAllocationData_1_0_allocated_node_id_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// truncated uint48 unique_id_hash - uint64_t unique_id_hash; - - /// uavcan.node.ID.1.0[<=1] allocated_node_id - struct /// Array address equivalence guarantee: &elements[0] == &allocated_node_id - { - uavcan_node_ID_1_0 elements[uavcan_pnp_NodeIDAllocationData_1_0_allocated_node_id_ARRAY_CAPACITY_]; - size_t count; - } allocated_node_id; -} uavcan_pnp_NodeIDAllocationData_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_NodeIDAllocationData_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_NodeIDAllocationData_1_0_serialize_( - const uavcan_pnp_NodeIDAllocationData_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 72UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint48 unique_id_hash - (void) memmove(&buffer[offset_bits / 8U], &obj->unique_id_hash, 6U); - offset_bits += 48U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.ID.1.0[<=1] allocated_node_id - if (obj->allocated_node_id.count > 1) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->allocated_node_id.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->allocated_node_id.count; ++_index0_) - { - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_node_ID_1_0_serialize_( - &obj->allocated_node_id.elements[_index0_], &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_NodeIDAllocationData_1_0_deserialize_( - uavcan_pnp_NodeIDAllocationData_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint48 unique_id_hash - out_obj->unique_id_hash = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 48); - offset_bits += 48U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.ID.1.0[<=1] allocated_node_id - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->allocated_node_id.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->allocated_node_id.count = 0U; - } - offset_bits += 8U; - if (out_obj->allocated_node_id.count > 1U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->allocated_node_id.count; ++_index1_) - { - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_node_ID_1_0_deserialize_( - &out_obj->allocated_node_id.elements[_index1_], &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_NodeIDAllocationData_1_0_initialize_(uavcan_pnp_NodeIDAllocationData_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_NodeIDAllocationData_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_2_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_2_0.h deleted file mode 100644 index 189d8f851..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/NodeIDAllocationData_2_0.h +++ /dev/null @@ -1,265 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl -// Generated at: 2023-07-11 16:47:49.469274 UTC -// Is deprecated: no -// Fixed port-ID: 8165 -// Full name: uavcan.pnp.NodeIDAllocationData -// Version: 2.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_2_0_INCLUDED_ -#define UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_2_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_pnp_NodeIDAllocationData_2_0_HAS_FIXED_PORT_ID_ true -#define uavcan_pnp_NodeIDAllocationData_2_0_FIXED_PORT_ID_ 8165U - -#define uavcan_pnp_NodeIDAllocationData_2_0_FULL_NAME_ "uavcan.pnp.NodeIDAllocationData" -#define uavcan_pnp_NodeIDAllocationData_2_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.NodeIDAllocationData.2.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_NodeIDAllocationData_2_0_EXTENT_BYTES_ 48UL -#define uavcan_pnp_NodeIDAllocationData_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 18UL -static_assert(uavcan_pnp_NodeIDAllocationData_2_0_EXTENT_BYTES_ >= uavcan_pnp_NodeIDAllocationData_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[16] unique_id -#define uavcan_pnp_NodeIDAllocationData_2_0_unique_id_ARRAY_CAPACITY_ 16U -#define uavcan_pnp_NodeIDAllocationData_2_0_unique_id_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.node.ID.1.0 node_id - uavcan_node_ID_1_0 node_id; - - /// saturated uint8[16] unique_id - uint8_t unique_id[16]; -} uavcan_pnp_NodeIDAllocationData_2_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_NodeIDAllocationData_2_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_NodeIDAllocationData_2_0_serialize_( - const uavcan_pnp_NodeIDAllocationData_2_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 144UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.node.ID.1.0 node_id - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_node_ID_1_0_serialize_( - &obj->node_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated uint8[16] unique_id - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 16UL * 8U, &obj->unique_id[0], 0U); - offset_bits += 16UL * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_NodeIDAllocationData_2_0_deserialize_( - uavcan_pnp_NodeIDAllocationData_2_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.node.ID.1.0 node_id - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_node_ID_1_0_deserialize_( - &out_obj->node_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated uint8[16] unique_id - nunavutGetBits(&out_obj->unique_id[0], &buffer[0], capacity_bytes, offset_bits, 16UL * 8U); - offset_bits += 16UL * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_NodeIDAllocationData_2_0_initialize_(uavcan_pnp_NodeIDAllocationData_2_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_NodeIDAllocationData_2_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_NODE_ID_ALLOCATION_DATA_2_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/AppendEntries_1_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/AppendEntries_1_0.h deleted file mode 100644 index 7633dff43..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/AppendEntries_1_0.h +++ /dev/null @@ -1,552 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.484966 UTC -// Is deprecated: no -// Fixed port-ID: 390 -// Full name: uavcan.pnp.cluster.AppendEntries -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_CLUSTER_APPEND_ENTRIES_1_0_INCLUDED_ -#define UAVCAN_PNP_CLUSTER_APPEND_ENTRIES_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/390.AppendEntries.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_pnp_cluster_AppendEntries_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_pnp_cluster_AppendEntries_1_0_FIXED_PORT_ID_ 390U - -#define uavcan_pnp_cluster_AppendEntries_1_0_FULL_NAME_ "uavcan.pnp.cluster.AppendEntries" -#define uavcan_pnp_cluster_AppendEntries_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.AppendEntries.1.0" - -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_FULL_NAME_ "uavcan.pnp.cluster.AppendEntries.Request" -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.AppendEntries.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_EXTENT_BYTES_ 96UL -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 35UL -static_assert(uavcan_pnp_cluster_AppendEntries_Request_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_AppendEntries_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 DEFAULT_MIN_ELECTION_TIMEOUT = 2 -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_DEFAULT_MIN_ELECTION_TIMEOUT (2U) -/// saturated uint8 DEFAULT_MAX_ELECTION_TIMEOUT = 4 -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_DEFAULT_MAX_ELECTION_TIMEOUT (4U) - -/// Array metadata for: uavcan.pnp.cluster.Entry.1.0[<=1] entries -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_entries_ARRAY_CAPACITY_ 1U -#define uavcan_pnp_cluster_AppendEntries_Request_1_0_entries_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint32 term - uint32_t term; - - /// saturated uint32 prev_log_term - uint32_t prev_log_term; - - /// saturated uint16 prev_log_index - uint16_t prev_log_index; - - /// saturated uint16 leader_commit - uint16_t leader_commit; - - /// uavcan.pnp.cluster.Entry.1.0[<=1] entries - struct /// Array address equivalence guarantee: &elements[0] == &entries - { - uavcan_pnp_cluster_Entry_1_0 elements[uavcan_pnp_cluster_AppendEntries_Request_1_0_entries_ARRAY_CAPACITY_]; - size_t count; - } entries; -} uavcan_pnp_cluster_AppendEntries_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_AppendEntries_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_AppendEntries_Request_1_0_serialize_( - const uavcan_pnp_cluster_AppendEntries_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 280UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->term, 4U); - offset_bits += 32U; - } - - - - - { // saturated uint32 prev_log_term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->prev_log_term, 4U); - offset_bits += 32U; - } - - - - - { // saturated uint16 prev_log_index - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->prev_log_index, 2U); - offset_bits += 16U; - } - - - - - { // saturated uint16 leader_commit - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->leader_commit, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.pnp.cluster.Entry.1.0[<=1] entries - if (obj->entries.count > 1) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->entries.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->entries.count; ++_index0_) - { - size_t _size_bytes0_ = 22UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_pnp_cluster_Entry_1_0_serialize_( - &obj->entries.elements[_index0_], &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_AppendEntries_Request_1_0_deserialize_( - uavcan_pnp_cluster_AppendEntries_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 term - out_obj->term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated uint32 prev_log_term - out_obj->prev_log_term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated uint16 prev_log_index - out_obj->prev_log_index = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - - - // saturated uint16 leader_commit - out_obj->leader_commit = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.pnp.cluster.Entry.1.0[<=1] entries - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->entries.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->entries.count = 0U; - } - offset_bits += 8U; - if (out_obj->entries.count > 1U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->entries.count; ++_index1_) - { - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_pnp_cluster_Entry_1_0_deserialize_( - &out_obj->entries.elements[_index1_], &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_AppendEntries_Request_1_0_initialize_(uavcan_pnp_cluster_AppendEntries_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_AppendEntries_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_pnp_cluster_AppendEntries_Response_1_0_FULL_NAME_ "uavcan.pnp.cluster.AppendEntries.Response" -#define uavcan_pnp_cluster_AppendEntries_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.AppendEntries.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_AppendEntries_Response_1_0_EXTENT_BYTES_ 48UL -#define uavcan_pnp_cluster_AppendEntries_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 5UL -static_assert(uavcan_pnp_cluster_AppendEntries_Response_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_AppendEntries_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 term - uint32_t term; - - /// saturated bool success - bool success; -} uavcan_pnp_cluster_AppendEntries_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_AppendEntries_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_AppendEntries_Response_1_0_serialize_( - const uavcan_pnp_cluster_AppendEntries_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 40UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->term, 4U); - offset_bits += 32U; - } - - - - - { // saturated bool success - buffer[offset_bits / 8U] = obj->success ? 1U : 0U; - offset_bits += 1U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_AppendEntries_Response_1_0_deserialize_( - uavcan_pnp_cluster_AppendEntries_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 term - out_obj->term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated bool success - if (offset_bits < capacity_bits) - { - out_obj->success = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->success = false; - } - offset_bits += 1U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_AppendEntries_Response_1_0_initialize_(uavcan_pnp_cluster_AppendEntries_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_AppendEntries_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_CLUSTER_APPEND_ENTRIES_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Discovery_1_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Discovery_1_0.h deleted file mode 100644 index 6a72fb134..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Discovery_1_0.h +++ /dev/null @@ -1,339 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.500806 UTC -// Is deprecated: no -// Fixed port-ID: 8164 -// Full name: uavcan.pnp.cluster.Discovery -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_CLUSTER_DISCOVERY_1_0_INCLUDED_ -#define UAVCAN_PNP_CLUSTER_DISCOVERY_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/8164.Discovery.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_pnp_cluster_Discovery_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_pnp_cluster_Discovery_1_0_FIXED_PORT_ID_ 8164U - -#define uavcan_pnp_cluster_Discovery_1_0_FULL_NAME_ "uavcan.pnp.cluster.Discovery" -#define uavcan_pnp_cluster_Discovery_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.Discovery.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_Discovery_1_0_EXTENT_BYTES_ 96UL -#define uavcan_pnp_cluster_Discovery_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_pnp_cluster_Discovery_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_Discovery_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 BROADCASTING_PERIOD = 1 -#define uavcan_pnp_cluster_Discovery_1_0_BROADCASTING_PERIOD (1U) -/// saturated uint3 MAX_CLUSTER_SIZE = 5 -#define uavcan_pnp_cluster_Discovery_1_0_MAX_CLUSTER_SIZE (5U) - -/// Array metadata for: uavcan.node.ID.1.0[<=5] known_nodes -#define uavcan_pnp_cluster_Discovery_1_0_known_nodes_ARRAY_CAPACITY_ 5U -#define uavcan_pnp_cluster_Discovery_1_0_known_nodes_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint3 configured_cluster_size - uint8_t configured_cluster_size; - - /// uavcan.node.ID.1.0[<=5] known_nodes - struct /// Array address equivalence guarantee: &elements[0] == &known_nodes - { - uavcan_node_ID_1_0 elements[uavcan_pnp_cluster_Discovery_1_0_known_nodes_ARRAY_CAPACITY_]; - size_t count; - } known_nodes; -} uavcan_pnp_cluster_Discovery_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_Discovery_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_Discovery_1_0_serialize_( - const uavcan_pnp_cluster_Discovery_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint3 configured_cluster_size - uint8_t _sat0_ = obj->configured_cluster_size; - if (_sat0_ > 7U) - { - _sat0_ = 7U; - } - buffer[offset_bits / 8U] = (uint8_t)(_sat0_); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 3U; - } - - - - - { // void5 - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, 5U); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += 5UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.ID.1.0[<=5] known_nodes - if (obj->known_nodes.count > 5) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->known_nodes.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->known_nodes.count; ++_index0_) - { - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err2_ = uavcan_node_ID_1_0_serialize_( - &obj->known_nodes.elements[_index0_], &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err2_ < 0) - { - return _err2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err3_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_Discovery_1_0_deserialize_( - uavcan_pnp_cluster_Discovery_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint3 configured_cluster_size - if ((offset_bits + 3U) <= capacity_bits) - { - out_obj->configured_cluster_size = buffer[offset_bits / 8U] & 7U; - } - else - { - out_obj->configured_cluster_size = 0U; - } - offset_bits += 3U; - - - - - // void5 - offset_bits += 5; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.ID.1.0[<=5] known_nodes - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->known_nodes.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->known_nodes.count = 0U; - } - offset_bits += 8U; - if (out_obj->known_nodes.count > 5U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->known_nodes.count; ++_index1_) - { - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err4_ = uavcan_node_ID_1_0_deserialize_( - &out_obj->known_nodes.elements[_index1_], &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_Discovery_1_0_initialize_(uavcan_pnp_cluster_Discovery_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_Discovery_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_CLUSTER_DISCOVERY_1_0_INCLUDED_ - diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Entry_1_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Entry_1_0.h deleted file mode 100644 index f35efcffb..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/Entry_1_0.h +++ /dev/null @@ -1,292 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.500806 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.pnp.cluster.Entry -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_CLUSTER_ENTRY_1_0_INCLUDED_ -#define UAVCAN_PNP_CLUSTER_ENTRY_1_0_INCLUDED_ - -#include -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/Entry.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_pnp_cluster_Entry_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_pnp_cluster_Entry_1_0_FULL_NAME_ "uavcan.pnp.cluster.Entry" -#define uavcan_pnp_cluster_Entry_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.Entry.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_Entry_1_0_EXTENT_BYTES_ 22UL -#define uavcan_pnp_cluster_Entry_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 22UL -static_assert(uavcan_pnp_cluster_Entry_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_Entry_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[16] unique_id -#define uavcan_pnp_cluster_Entry_1_0_unique_id_ARRAY_CAPACITY_ 16U -#define uavcan_pnp_cluster_Entry_1_0_unique_id_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated uint32 term - uint32_t term; - - /// saturated uint8[16] unique_id - uint8_t unique_id[16]; - - /// uavcan.node.ID.1.0 node_id - uavcan_node_ID_1_0 node_id; -} uavcan_pnp_cluster_Entry_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_Entry_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_Entry_1_0_serialize_( - const uavcan_pnp_cluster_Entry_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 176UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->term, 4U); - offset_bits += 32U; - } - - - - - { // saturated uint8[16] unique_id - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 16UL * 8U, &obj->unique_id[0], 0U); - offset_bits += 16UL * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.node.ID.1.0 node_id - size_t _size_bytes0_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_node_ID_1_0_serialize_( - &obj->node_id, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_Entry_1_0_deserialize_( - uavcan_pnp_cluster_Entry_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 term - out_obj->term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated uint8[16] unique_id - nunavutGetBits(&out_obj->unique_id[0], &buffer[0], capacity_bytes, offset_bits, 16UL * 8U); - offset_bits += 16UL * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.node.ID.1.0 node_id - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err3_ = uavcan_node_ID_1_0_deserialize_( - &out_obj->node_id, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_Entry_1_0_initialize_(uavcan_pnp_cluster_Entry_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_Entry_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_CLUSTER_ENTRY_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/RequestVote_1_0.h b/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/RequestVote_1_0.h deleted file mode 100644 index cfab1a0c6..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/pnp/cluster/RequestVote_1_0.h +++ /dev/null @@ -1,449 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.500806 UTC -// Is deprecated: no -// Fixed port-ID: 391 -// Full name: uavcan.pnp.cluster.RequestVote -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PNP_CLUSTER_REQUEST_VOTE_1_0_INCLUDED_ -#define UAVCAN_PNP_CLUSTER_REQUEST_VOTE_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/pnp/cluster/391.RequestVote.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_pnp_cluster_RequestVote_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_pnp_cluster_RequestVote_1_0_FIXED_PORT_ID_ 391U - -#define uavcan_pnp_cluster_RequestVote_1_0_FULL_NAME_ "uavcan.pnp.cluster.RequestVote" -#define uavcan_pnp_cluster_RequestVote_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.RequestVote.1.0" - -#define uavcan_pnp_cluster_RequestVote_Request_1_0_FULL_NAME_ "uavcan.pnp.cluster.RequestVote.Request" -#define uavcan_pnp_cluster_RequestVote_Request_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.RequestVote.Request.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_RequestVote_Request_1_0_EXTENT_BYTES_ 48UL -#define uavcan_pnp_cluster_RequestVote_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 10UL -static_assert(uavcan_pnp_cluster_RequestVote_Request_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_RequestVote_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 term - uint32_t term; - - /// saturated uint32 last_log_term - uint32_t last_log_term; - - /// saturated uint16 last_log_index - uint16_t last_log_index; -} uavcan_pnp_cluster_RequestVote_Request_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_RequestVote_Request_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_RequestVote_Request_1_0_serialize_( - const uavcan_pnp_cluster_RequestVote_Request_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 80UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->term, 4U); - offset_bits += 32U; - } - - - - - { // saturated uint32 last_log_term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->last_log_term, 4U); - offset_bits += 32U; - } - - - - - { // saturated uint16 last_log_index - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->last_log_index, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_RequestVote_Request_1_0_deserialize_( - uavcan_pnp_cluster_RequestVote_Request_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 term - out_obj->term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated uint32 last_log_term - out_obj->last_log_term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated uint16 last_log_index - out_obj->last_log_index = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_RequestVote_Request_1_0_initialize_(uavcan_pnp_cluster_RequestVote_Request_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_RequestVote_Request_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_pnp_cluster_RequestVote_Response_1_0_FULL_NAME_ "uavcan.pnp.cluster.RequestVote.Response" -#define uavcan_pnp_cluster_RequestVote_Response_1_0_FULL_NAME_AND_VERSION_ "uavcan.pnp.cluster.RequestVote.Response.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_pnp_cluster_RequestVote_Response_1_0_EXTENT_BYTES_ 48UL -#define uavcan_pnp_cluster_RequestVote_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 5UL -static_assert(uavcan_pnp_cluster_RequestVote_Response_1_0_EXTENT_BYTES_ >= uavcan_pnp_cluster_RequestVote_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 term - uint32_t term; - - /// saturated bool vote_granted - bool vote_granted; -} uavcan_pnp_cluster_RequestVote_Response_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_pnp_cluster_RequestVote_Response_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_RequestVote_Response_1_0_serialize_( - const uavcan_pnp_cluster_RequestVote_Response_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 40UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 term - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->term, 4U); - offset_bits += 32U; - } - - - - - { // saturated bool vote_granted - buffer[offset_bits / 8U] = obj->vote_granted ? 1U : 0U; - offset_bits += 1U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_pnp_cluster_RequestVote_Response_1_0_deserialize_( - uavcan_pnp_cluster_RequestVote_Response_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 term - out_obj->term = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - - - // saturated bool vote_granted - if (offset_bits < capacity_bits) - { - out_obj->vote_granted = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->vote_granted = false; - } - offset_bits += 1U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_pnp_cluster_RequestVote_Response_1_0_initialize_(uavcan_pnp_cluster_RequestVote_Response_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_pnp_cluster_RequestVote_Response_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PNP_CLUSTER_REQUEST_VOTE_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/Empty_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/Empty_1_0.h deleted file mode 100644 index ffe0a6b67..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/Empty_1_0.h +++ /dev/null @@ -1,170 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.845709 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.Empty -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_EMPTY_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_EMPTY_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Empty.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_Empty_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_Empty_1_0_FULL_NAME_ "uavcan.primitive.Empty" -#define uavcan_primitive_Empty_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.Empty.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_Empty_1_0_EXTENT_BYTES_ 0UL -#define uavcan_primitive_Empty_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_primitive_Empty_1_0_EXTENT_BYTES_ >= uavcan_primitive_Empty_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_primitive_Empty_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_Empty_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_Empty_1_0_serialize_( - const uavcan_primitive_Empty_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_Empty_1_0_deserialize_( - uavcan_primitive_Empty_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_Empty_1_0_initialize_(uavcan_primitive_Empty_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_Empty_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_EMPTY_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/String_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/String_1_0.h deleted file mode 100644 index 18c2a10ad..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/String_1_0.h +++ /dev/null @@ -1,248 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.861406 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.String -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_STRING_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_STRING_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/String.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_String_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_String_1_0_FULL_NAME_ "uavcan.primitive.String" -#define uavcan_primitive_String_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.String.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_String_1_0_EXTENT_BYTES_ 258UL -#define uavcan_primitive_String_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_primitive_String_1_0_EXTENT_BYTES_ >= uavcan_primitive_String_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=256] value -#define uavcan_primitive_String_1_0_value_ARRAY_CAPACITY_ 256U -#define uavcan_primitive_String_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=256] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint8_t elements[uavcan_primitive_String_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_String_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_String_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_String_1_0_serialize_( - const uavcan_primitive_String_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=256] value - if (obj->value.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->value.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 8U, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_String_1_0_deserialize_( - uavcan_primitive_String_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=256] value - // Array length prefix: truncated uint16 - out_obj->value.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->value.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 8U); - offset_bits += out_obj->value.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_String_1_0_initialize_(uavcan_primitive_String_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_String_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_STRING_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/Unstructured_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/Unstructured_1_0.h deleted file mode 100644 index f0f526259..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/Unstructured_1_0.h +++ /dev/null @@ -1,248 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.861406 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.Unstructured -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_UNSTRUCTURED_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_UNSTRUCTURED_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/Unstructured.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_Unstructured_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_Unstructured_1_0_FULL_NAME_ "uavcan.primitive.Unstructured" -#define uavcan_primitive_Unstructured_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.Unstructured.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_Unstructured_1_0_EXTENT_BYTES_ 258UL -#define uavcan_primitive_Unstructured_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_primitive_Unstructured_1_0_EXTENT_BYTES_ >= uavcan_primitive_Unstructured_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=256] value -#define uavcan_primitive_Unstructured_1_0_value_ARRAY_CAPACITY_ 256U -#define uavcan_primitive_Unstructured_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=256] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint8_t elements[uavcan_primitive_Unstructured_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_Unstructured_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_Unstructured_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_Unstructured_1_0_serialize_( - const uavcan_primitive_Unstructured_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=256] value - if (obj->value.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->value.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 8U, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_Unstructured_1_0_deserialize_( - uavcan_primitive_Unstructured_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=256] value - // Array length prefix: truncated uint16 - out_obj->value.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->value.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 8U); - offset_bits += out_obj->value.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_Unstructured_1_0_initialize_(uavcan_primitive_Unstructured_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_Unstructured_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_UNSTRUCTURED_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Bit_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Bit_1_0.h deleted file mode 100644 index d48437261..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Bit_1_0.h +++ /dev/null @@ -1,249 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.924083 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Bit -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_BIT_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_BIT_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Bit_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Bit_1_0_FULL_NAME_ "uavcan.primitive.array.Bit" -#define uavcan_primitive_array_Bit_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Bit.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Bit_1_0_EXTENT_BYTES_ 258UL -#define uavcan_primitive_array_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_primitive_array_Bit_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated bool[<=2048] value -#define uavcan_primitive_array_Bit_1_0_value_ARRAY_CAPACITY_ 2048U -#define uavcan_primitive_array_Bit_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated bool[<=2048] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - /// Bitpacked array, capacity 2048 bits. Access via @ref nunavutSetBit(), @ref nunavutGetBit(). - uint8_t bitpacked[256]; - size_t count; - } value; -} uavcan_primitive_array_Bit_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Bit_1_0_serialize_( - const uavcan_primitive_array_Bit_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated bool[<=2048] value - if (obj->value.count > 2048) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->value.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count, &obj->value.bitpacked[0], 0U); - offset_bits += obj->value.count; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Bit_1_0_deserialize_( - uavcan_primitive_array_Bit_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated bool[<=2048] value - // Array length prefix: truncated uint16 - out_obj->value.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->value.count > 2048U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.bitpacked[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count); - offset_bits += out_obj->value.count; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Bit_1_0_initialize_(uavcan_primitive_array_Bit_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Bit_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_BIT_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer16_1_0.h deleted file mode 100644 index 377b0309c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer16_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.924083 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Integer16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_INTEGER16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_INTEGER16_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Integer16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Integer16_1_0_FULL_NAME_ "uavcan.primitive.array.Integer16" -#define uavcan_primitive_array_Integer16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Integer16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Integer16_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Integer16_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated int16[<=128] value -#define uavcan_primitive_array_Integer16_1_0_value_ARRAY_CAPACITY_ 128U -#define uavcan_primitive_array_Integer16_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated int16[<=128] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - int16_t elements[uavcan_primitive_array_Integer16_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Integer16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer16_1_0_serialize_( - const uavcan_primitive_array_Integer16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int16[<=128] value - if (obj->value.count > 128) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 16UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 16UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer16_1_0_deserialize_( - uavcan_primitive_array_Integer16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int16[<=128] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 128U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 16U); - offset_bits += out_obj->value.count * 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Integer16_1_0_initialize_(uavcan_primitive_array_Integer16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Integer16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_INTEGER16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer32_1_0.h deleted file mode 100644 index 53f4bed90..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer32_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.924083 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Integer32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_INTEGER32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_INTEGER32_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Integer32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Integer32_1_0_FULL_NAME_ "uavcan.primitive.array.Integer32" -#define uavcan_primitive_array_Integer32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Integer32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Integer32_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Integer32_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated int32[<=64] value -#define uavcan_primitive_array_Integer32_1_0_value_ARRAY_CAPACITY_ 64U -#define uavcan_primitive_array_Integer32_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated int32[<=64] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - int32_t elements[uavcan_primitive_array_Integer32_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Integer32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer32_1_0_serialize_( - const uavcan_primitive_array_Integer32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int32[<=64] value - if (obj->value.count > 64) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 32UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer32_1_0_deserialize_( - uavcan_primitive_array_Integer32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int32[<=64] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 64U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 32U); - offset_bits += out_obj->value.count * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Integer32_1_0_initialize_(uavcan_primitive_array_Integer32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Integer32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_INTEGER32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer64_1_0.h deleted file mode 100644 index ff215ab01..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer64_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.939765 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Integer64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_INTEGER64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_INTEGER64_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Integer64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Integer64_1_0_FULL_NAME_ "uavcan.primitive.array.Integer64" -#define uavcan_primitive_array_Integer64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Integer64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Integer64_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Integer64_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated int64[<=32] value -#define uavcan_primitive_array_Integer64_1_0_value_ARRAY_CAPACITY_ 32U -#define uavcan_primitive_array_Integer64_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated int64[<=32] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - int64_t elements[uavcan_primitive_array_Integer64_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Integer64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer64_1_0_serialize_( - const uavcan_primitive_array_Integer64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int64[<=32] value - if (obj->value.count > 32) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 64UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer64_1_0_deserialize_( - uavcan_primitive_array_Integer64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int64[<=32] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 32U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 64U); - offset_bits += out_obj->value.count * 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Integer64_1_0_initialize_(uavcan_primitive_array_Integer64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Integer64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_INTEGER64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer8_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer8_1_0.h deleted file mode 100644 index 495ab8628..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Integer8_1_0.h +++ /dev/null @@ -1,248 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.939765 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Integer8 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_INTEGER8_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_INTEGER8_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Integer8_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Integer8_1_0_FULL_NAME_ "uavcan.primitive.array.Integer8" -#define uavcan_primitive_array_Integer8_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Integer8.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Integer8_1_0_EXTENT_BYTES_ 258UL -#define uavcan_primitive_array_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_primitive_array_Integer8_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated int8[<=256] value -#define uavcan_primitive_array_Integer8_1_0_value_ARRAY_CAPACITY_ 256U -#define uavcan_primitive_array_Integer8_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated int8[<=256] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - int8_t elements[uavcan_primitive_array_Integer8_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Integer8_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer8_1_0_serialize_( - const uavcan_primitive_array_Integer8_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int8[<=256] value - if (obj->value.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->value.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 8U, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Integer8_1_0_deserialize_( - uavcan_primitive_array_Integer8_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int8[<=256] value - // Array length prefix: truncated uint16 - out_obj->value.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->value.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 8U); - offset_bits += out_obj->value.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Integer8_1_0_initialize_(uavcan_primitive_array_Integer8_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Integer8_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_INTEGER8_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural16_1_0.h deleted file mode 100644 index 3920112c2..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural16_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.939765 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Natural16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_NATURAL16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_NATURAL16_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Natural16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Natural16_1_0_FULL_NAME_ "uavcan.primitive.array.Natural16" -#define uavcan_primitive_array_Natural16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Natural16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Natural16_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Natural16_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint16[<=128] value -#define uavcan_primitive_array_Natural16_1_0_value_ARRAY_CAPACITY_ 128U -#define uavcan_primitive_array_Natural16_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint16[<=128] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint16_t elements[uavcan_primitive_array_Natural16_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Natural16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural16_1_0_serialize_( - const uavcan_primitive_array_Natural16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16[<=128] value - if (obj->value.count > 128) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 16UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 16UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural16_1_0_deserialize_( - uavcan_primitive_array_Natural16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16[<=128] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 128U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 16U); - offset_bits += out_obj->value.count * 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Natural16_1_0_initialize_(uavcan_primitive_array_Natural16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Natural16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_NATURAL16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural32_1_0.h deleted file mode 100644 index a4b10a371..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural32_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.939765 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Natural32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_NATURAL32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_NATURAL32_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Natural32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Natural32_1_0_FULL_NAME_ "uavcan.primitive.array.Natural32" -#define uavcan_primitive_array_Natural32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Natural32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Natural32_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Natural32_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint32[<=64] value -#define uavcan_primitive_array_Natural32_1_0_value_ARRAY_CAPACITY_ 64U -#define uavcan_primitive_array_Natural32_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint32[<=64] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint32_t elements[uavcan_primitive_array_Natural32_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Natural32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural32_1_0_serialize_( - const uavcan_primitive_array_Natural32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32[<=64] value - if (obj->value.count > 64) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 32UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural32_1_0_deserialize_( - uavcan_primitive_array_Natural32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32[<=64] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 64U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 32U); - offset_bits += out_obj->value.count * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Natural32_1_0_initialize_(uavcan_primitive_array_Natural32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Natural32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_NATURAL32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural64_1_0.h deleted file mode 100644 index cccc423a8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural64_1_0.h +++ /dev/null @@ -1,256 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.955619 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Natural64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_NATURAL64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_NATURAL64_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Natural64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Natural64_1_0_FULL_NAME_ "uavcan.primitive.array.Natural64" -#define uavcan_primitive_array_Natural64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Natural64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Natural64_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Natural64_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint64[<=32] value -#define uavcan_primitive_array_Natural64_1_0_value_ARRAY_CAPACITY_ 32U -#define uavcan_primitive_array_Natural64_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint64[<=32] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint64_t elements[uavcan_primitive_array_Natural64_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Natural64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural64_1_0_serialize_( - const uavcan_primitive_array_Natural64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint64[<=32] value - if (obj->value.count > 32) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 64UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural64_1_0_deserialize_( - uavcan_primitive_array_Natural64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint64[<=32] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 32U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 64U); - offset_bits += out_obj->value.count * 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Natural64_1_0_initialize_(uavcan_primitive_array_Natural64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Natural64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_NATURAL64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural8_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural8_1_0.h deleted file mode 100644 index a4ecc5d70..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Natural8_1_0.h +++ /dev/null @@ -1,248 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.955619 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Natural8 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_NATURAL8_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_NATURAL8_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Natural8_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Natural8_1_0_FULL_NAME_ "uavcan.primitive.array.Natural8" -#define uavcan_primitive_array_Natural8_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Natural8.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Natural8_1_0_EXTENT_BYTES_ 258UL -#define uavcan_primitive_array_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 258UL -static_assert(uavcan_primitive_array_Natural8_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated uint8[<=256] value -#define uavcan_primitive_array_Natural8_1_0_value_ARRAY_CAPACITY_ 256U -#define uavcan_primitive_array_Natural8_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated uint8[<=256] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - uint8_t elements[uavcan_primitive_array_Natural8_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Natural8_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural8_1_0_serialize_( - const uavcan_primitive_array_Natural8_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2064UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8[<=256] value - if (obj->value.count > 256) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint16 - (void) memmove(&buffer[offset_bits / 8U], &obj->value.count, 2U); - offset_bits += 16U; - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 8U, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Natural8_1_0_deserialize_( - uavcan_primitive_array_Natural8_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8[<=256] value - // Array length prefix: truncated uint16 - out_obj->value.count = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - if (out_obj->value.count > 256U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 8U); - offset_bits += out_obj->value.count * 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Natural8_1_0_initialize_(uavcan_primitive_array_Natural8_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Natural8_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_NATURAL8_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real16_1_0.h deleted file mode 100644 index 08d4aeb71..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real16_1_0.h +++ /dev/null @@ -1,272 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.955619 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Real16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_REAL16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_REAL16_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Real16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Real16_1_0_FULL_NAME_ "uavcan.primitive.array.Real16" -#define uavcan_primitive_array_Real16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Real16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Real16_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Real16_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float16[<=128] value -#define uavcan_primitive_array_Real16_1_0_value_ARRAY_CAPACITY_ 128U -#define uavcan_primitive_array_Real16_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated float16[<=128] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - float elements[uavcan_primitive_array_Real16_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Real16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real16_1_0_serialize_( - const uavcan_primitive_array_Real16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float16[<=128] value - if (obj->value.count > 128) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - for (size_t _index0_ = 0U; _index0_ < obj->value.count; ++_index0_) - { - float _sat0_ = obj->value.elements[_index0_]; - if (isfinite(_sat0_)) - { - if (_sat0_ < ((float) -65504.0)) - { - _sat0_ = ((float) -65504.0); - } - if (_sat0_ > ((float) 65504.0)) - { - _sat0_ = ((float) 65504.0); - } - } - const uint16_t _half0_ = nunavutFloat16Pack(_sat0_); - (void) memmove(&buffer[offset_bits / 8U], &_half0_, 2U); - offset_bits += 16U; - } - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real16_1_0_deserialize_( - uavcan_primitive_array_Real16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float16[<=128] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 128U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - for (size_t _index1_ = 0U; _index1_ < out_obj->value.count; ++_index1_) - { - out_obj->value.elements[_index1_] = nunavutGetF16(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 16U; - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Real16_1_0_initialize_(uavcan_primitive_array_Real16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Real16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_REAL16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real32_1_0.h deleted file mode 100644 index e4547a446..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real32_1_0.h +++ /dev/null @@ -1,257 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.971276 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Real32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_REAL32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_REAL32_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Real32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Real32_1_0_FULL_NAME_ "uavcan.primitive.array.Real32" -#define uavcan_primitive_array_Real32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Real32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Real32_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Real32_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[<=64] value -#define uavcan_primitive_array_Real32_1_0_value_ARRAY_CAPACITY_ 64U -#define uavcan_primitive_array_Real32_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated float32[<=64] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - float elements[uavcan_primitive_array_Real32_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Real32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real32_1_0_serialize_( - const uavcan_primitive_array_Real32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[<=64] value - if (obj->value.count > 64) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 32UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real32_1_0_deserialize_( - uavcan_primitive_array_Real32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[<=64] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 64U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 32U); - offset_bits += out_obj->value.count * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Real32_1_0_initialize_(uavcan_primitive_array_Real32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Real32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_REAL32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real64_1_0.h deleted file mode 100644 index 5fcf0bf0a..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/array/Real64_1_0.h +++ /dev/null @@ -1,259 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.971276 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.array.Real64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_ARRAY_REAL64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_ARRAY_REAL64_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/array/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_array_Real64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_array_Real64_1_0_FULL_NAME_ "uavcan.primitive.array.Real64" -#define uavcan_primitive_array_Real64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.array.Real64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_array_Real64_1_0_EXTENT_BYTES_ 257UL -#define uavcan_primitive_array_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 257UL -static_assert(uavcan_primitive_array_Real64_1_0_EXTENT_BYTES_ >= uavcan_primitive_array_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float64[<=32] value -#define uavcan_primitive_array_Real64_1_0_value_ARRAY_CAPACITY_ 32U -#define uavcan_primitive_array_Real64_1_0_value_ARRAY_IS_VARIABLE_LENGTH_ true - -typedef struct -{ - /// saturated float64[<=32] value - struct /// Array address equivalence guarantee: &elements[0] == &value - { - double elements[uavcan_primitive_array_Real64_1_0_value_ARRAY_CAPACITY_]; - size_t count; - } value; -} uavcan_primitive_array_Real64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_array_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real64_1_0_serialize_( - const uavcan_primitive_array_Real64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 2056UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float64[<=32] value - if (obj->value.count > 32) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - // Array length prefix: truncated uint8 - buffer[offset_bits / 8U] = (uint8_t)(obj->value.count); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, obj->value.count * 64UL, &obj->value.elements[0], 0U); - offset_bits += obj->value.count * 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_array_Real64_1_0_deserialize_( - uavcan_primitive_array_Real64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float64[<=32] value - // Array length prefix: truncated uint8 - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value.count = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value.count = 0U; - } - offset_bits += 8U; - if (out_obj->value.count > 32U) - { - return -NUNAVUT_ERROR_REPRESENTATION_BAD_ARRAY_LENGTH; - } - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->value.elements[0], &buffer[0], capacity_bytes, offset_bits, out_obj->value.count * 64U); - offset_bits += out_obj->value.count * 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_array_Real64_1_0_initialize_(uavcan_primitive_array_Real64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_array_Real64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_ARRAY_REAL64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Bit_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Bit_1_0.h deleted file mode 100644 index 13e295e97..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Bit_1_0.h +++ /dev/null @@ -1,231 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.861406 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Bit -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_BIT_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_BIT_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Bit.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Bit_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Bit_1_0_FULL_NAME_ "uavcan.primitive.scalar.Bit" -#define uavcan_primitive_scalar_Bit_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Bit.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Bit_1_0_EXTENT_BYTES_ 1UL -#define uavcan_primitive_scalar_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_primitive_scalar_Bit_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated bool value - bool value; -} uavcan_primitive_scalar_Bit_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Bit_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Bit_1_0_serialize_( - const uavcan_primitive_scalar_Bit_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated bool value - buffer[offset_bits / 8U] = obj->value ? 1U : 0U; - offset_bits += 1U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Bit_1_0_deserialize_( - uavcan_primitive_scalar_Bit_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated bool value - if (offset_bits < capacity_bits) - { - out_obj->value = (buffer[offset_bits / 8U] & 1U) != 0U; - } - else - { - out_obj->value = false; - } - offset_bits += 1U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Bit_1_0_initialize_(uavcan_primitive_scalar_Bit_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Bit_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_BIT_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer16_1_0.h deleted file mode 100644 index 61ecb89ed..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer16_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.877125 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Integer16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_INTEGER16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_INTEGER16_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Integer16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Integer16_1_0_FULL_NAME_ "uavcan.primitive.scalar.Integer16" -#define uavcan_primitive_scalar_Integer16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Integer16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Integer16_1_0_EXTENT_BYTES_ 2UL -#define uavcan_primitive_scalar_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_primitive_scalar_Integer16_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated int16 value - int16_t value; -} uavcan_primitive_scalar_Integer16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Integer16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer16_1_0_serialize_( - const uavcan_primitive_scalar_Integer16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer16_1_0_deserialize_( - uavcan_primitive_scalar_Integer16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int16 value - out_obj->value = nunavutGetI16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Integer16_1_0_initialize_(uavcan_primitive_scalar_Integer16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Integer16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_INTEGER16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer32_1_0.h deleted file mode 100644 index ff1ceae7c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer32_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.877125 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Integer32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_INTEGER32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_INTEGER32_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Integer32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Integer32_1_0_FULL_NAME_ "uavcan.primitive.scalar.Integer32" -#define uavcan_primitive_scalar_Integer32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Integer32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Integer32_1_0_EXTENT_BYTES_ 4UL -#define uavcan_primitive_scalar_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_primitive_scalar_Integer32_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated int32 value - int32_t value; -} uavcan_primitive_scalar_Integer32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Integer32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer32_1_0_serialize_( - const uavcan_primitive_scalar_Integer32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int32 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer32_1_0_deserialize_( - uavcan_primitive_scalar_Integer32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int32 value - out_obj->value = nunavutGetI32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Integer32_1_0_initialize_(uavcan_primitive_scalar_Integer32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Integer32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_INTEGER32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer64_1_0.h deleted file mode 100644 index eb4f56fb7..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer64_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.877125 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Integer64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_INTEGER64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_INTEGER64_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Integer64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Integer64_1_0_FULL_NAME_ "uavcan.primitive.scalar.Integer64" -#define uavcan_primitive_scalar_Integer64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Integer64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Integer64_1_0_EXTENT_BYTES_ 8UL -#define uavcan_primitive_scalar_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(uavcan_primitive_scalar_Integer64_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated int64 value - int64_t value; -} uavcan_primitive_scalar_Integer64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Integer64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer64_1_0_serialize_( - const uavcan_primitive_scalar_Integer64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int64 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer64_1_0_deserialize_( - uavcan_primitive_scalar_Integer64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int64 value - out_obj->value = nunavutGetI64(&buffer[0], capacity_bytes, offset_bits, 64); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Integer64_1_0_initialize_(uavcan_primitive_scalar_Integer64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Integer64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_INTEGER64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer8_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer8_1_0.h deleted file mode 100644 index 8f508c41a..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Integer8_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.877125 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Integer8 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_INTEGER8_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_INTEGER8_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Integer8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Integer8_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Integer8_1_0_FULL_NAME_ "uavcan.primitive.scalar.Integer8" -#define uavcan_primitive_scalar_Integer8_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Integer8.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Integer8_1_0_EXTENT_BYTES_ 1UL -#define uavcan_primitive_scalar_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_primitive_scalar_Integer8_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated int8 value - int8_t value; -} uavcan_primitive_scalar_Integer8_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Integer8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer8_1_0_serialize_( - const uavcan_primitive_scalar_Integer8_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated int8 value - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->value); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Integer8_1_0_deserialize_( - uavcan_primitive_scalar_Integer8_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated int8 value - out_obj->value = nunavutGetI8(&buffer[0], capacity_bytes, offset_bits, 8); - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Integer8_1_0_initialize_(uavcan_primitive_scalar_Integer8_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Integer8_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_INTEGER8_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural16_1_0.h deleted file mode 100644 index 61107a918..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural16_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.892755 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Natural16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_NATURAL16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_NATURAL16_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Natural16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Natural16_1_0_FULL_NAME_ "uavcan.primitive.scalar.Natural16" -#define uavcan_primitive_scalar_Natural16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Natural16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Natural16_1_0_EXTENT_BYTES_ 2UL -#define uavcan_primitive_scalar_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_primitive_scalar_Natural16_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint16 value - uint16_t value; -} uavcan_primitive_scalar_Natural16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Natural16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural16_1_0_serialize_( - const uavcan_primitive_scalar_Natural16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint16 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural16_1_0_deserialize_( - uavcan_primitive_scalar_Natural16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint16 value - out_obj->value = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 16); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Natural16_1_0_initialize_(uavcan_primitive_scalar_Natural16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Natural16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_NATURAL16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural32_1_0.h deleted file mode 100644 index c1b0bd76f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural32_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.892755 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Natural32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_NATURAL32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_NATURAL32_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Natural32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Natural32_1_0_FULL_NAME_ "uavcan.primitive.scalar.Natural32" -#define uavcan_primitive_scalar_Natural32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Natural32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Natural32_1_0_EXTENT_BYTES_ 4UL -#define uavcan_primitive_scalar_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_primitive_scalar_Natural32_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint32 value - uint32_t value; -} uavcan_primitive_scalar_Natural32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Natural32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural32_1_0_serialize_( - const uavcan_primitive_scalar_Natural32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint32 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural32_1_0_deserialize_( - uavcan_primitive_scalar_Natural32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint32 value - out_obj->value = nunavutGetU32(&buffer[0], capacity_bytes, offset_bits, 32); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Natural32_1_0_initialize_(uavcan_primitive_scalar_Natural32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Natural32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_NATURAL32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural64_1_0.h deleted file mode 100644 index ba5096674..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural64_1_0.h +++ /dev/null @@ -1,225 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.892755 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Natural64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_NATURAL64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_NATURAL64_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Natural64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Natural64_1_0_FULL_NAME_ "uavcan.primitive.scalar.Natural64" -#define uavcan_primitive_scalar_Natural64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Natural64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Natural64_1_0_EXTENT_BYTES_ 8UL -#define uavcan_primitive_scalar_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(uavcan_primitive_scalar_Natural64_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint64 value - uint64_t value; -} uavcan_primitive_scalar_Natural64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Natural64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural64_1_0_serialize_( - const uavcan_primitive_scalar_Natural64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint64 value - // Saturation code not emitted -- native representation matches the serialized representation. - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural64_1_0_deserialize_( - uavcan_primitive_scalar_Natural64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint64 value - out_obj->value = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 64); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Natural64_1_0_initialize_(uavcan_primitive_scalar_Natural64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Natural64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_NATURAL64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural8_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural8_1_0.h deleted file mode 100644 index ddfe20383..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Natural8_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.908360 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Natural8 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_NATURAL8_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_NATURAL8_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Natural8.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Natural8_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Natural8_1_0_FULL_NAME_ "uavcan.primitive.scalar.Natural8" -#define uavcan_primitive_scalar_Natural8_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Natural8.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Natural8_1_0_EXTENT_BYTES_ 1UL -#define uavcan_primitive_scalar_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_primitive_scalar_Natural8_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated uint8 value - uint8_t value; -} uavcan_primitive_scalar_Natural8_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Natural8_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural8_1_0_serialize_( - const uavcan_primitive_scalar_Natural8_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint8 value - // Saturation code not emitted -- native representation matches the serialized representation. - buffer[offset_bits / 8U] = (uint8_t)(obj->value); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 8U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Natural8_1_0_deserialize_( - uavcan_primitive_scalar_Natural8_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint8 value - if ((offset_bits + 8U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 255U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 8U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Natural8_1_0_initialize_(uavcan_primitive_scalar_Natural8_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Natural8_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_NATURAL8_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real16_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real16_1_0.h deleted file mode 100644 index 813080f9a..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real16_1_0.h +++ /dev/null @@ -1,236 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.908360 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Real16 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_REAL16_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_REAL16_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real16.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Real16_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Real16_1_0_FULL_NAME_ "uavcan.primitive.scalar.Real16" -#define uavcan_primitive_scalar_Real16_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Real16.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Real16_1_0_EXTENT_BYTES_ 2UL -#define uavcan_primitive_scalar_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_primitive_scalar_Real16_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float16 value - float value; -} uavcan_primitive_scalar_Real16_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Real16_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real16_1_0_serialize_( - const uavcan_primitive_scalar_Real16_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float16 value - float _sat0_ = obj->value; - if (isfinite(_sat0_)) - { - if (_sat0_ < ((float) -65504.0)) - { - _sat0_ = ((float) -65504.0); - } - if (_sat0_ > ((float) 65504.0)) - { - _sat0_ = ((float) 65504.0); - } - } - const uint16_t _half0_ = nunavutFloat16Pack(_sat0_); - (void) memmove(&buffer[offset_bits / 8U], &_half0_, 2U); - offset_bits += 16U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real16_1_0_deserialize_( - uavcan_primitive_scalar_Real16_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float16 value - out_obj->value = nunavutGetF16(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 16U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Real16_1_0_initialize_(uavcan_primitive_scalar_Real16_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Real16_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_REAL16_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real32_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real32_1_0.h deleted file mode 100644 index b6ee0e7e8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real32_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.908360 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Real32 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_REAL32_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_REAL32_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real32.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Real32_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Real32_1_0_FULL_NAME_ "uavcan.primitive.scalar.Real32" -#define uavcan_primitive_scalar_Real32_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Real32.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Real32_1_0_EXTENT_BYTES_ 4UL -#define uavcan_primitive_scalar_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_primitive_scalar_Real32_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 value - float value; -} uavcan_primitive_scalar_Real32_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Real32_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real32_1_0_serialize_( - const uavcan_primitive_scalar_Real32_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 value - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real32_1_0_deserialize_( - uavcan_primitive_scalar_Real32_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 value - out_obj->value = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Real32_1_0_initialize_(uavcan_primitive_scalar_Real32_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Real32_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_REAL32_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real64_1_0.h b/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real64_1_0.h deleted file mode 100644 index d40573bae..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/primitive/scalar/Real64_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.908360 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.primitive.scalar.Real64 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_PRIMITIVE_SCALAR_REAL64_1_0_INCLUDED_ -#define UAVCAN_PRIMITIVE_SCALAR_REAL64_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/primitive/scalar/Real64.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_primitive_scalar_Real64_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_primitive_scalar_Real64_1_0_FULL_NAME_ "uavcan.primitive.scalar.Real64" -#define uavcan_primitive_scalar_Real64_1_0_FULL_NAME_AND_VERSION_ "uavcan.primitive.scalar.Real64.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_primitive_scalar_Real64_1_0_EXTENT_BYTES_ 8UL -#define uavcan_primitive_scalar_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(uavcan_primitive_scalar_Real64_1_0_EXTENT_BYTES_ >= uavcan_primitive_scalar_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float64 value - double value; -} uavcan_primitive_scalar_Real64_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_primitive_scalar_Real64_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real64_1_0_serialize_( - const uavcan_primitive_scalar_Real64_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float64 value - // Saturation code not emitted -- assume the native representation of float64 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->value, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_primitive_scalar_Real64_1_0_deserialize_( - uavcan_primitive_scalar_Real64_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float64 value - out_obj->value = nunavutGetF64(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_primitive_scalar_Real64_1_0_initialize_(uavcan_primitive_scalar_Real64_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_primitive_scalar_Real64_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_PRIMITIVE_SCALAR_REAL64_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Scalar_1_0.h deleted file mode 100644 index e23672254..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.798567 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.acceleration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ACCELERATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ACCELERATION_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_acceleration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_acceleration_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.acceleration.Scalar" -#define uavcan_si_sample_acceleration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.acceleration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_acceleration_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_acceleration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 meter_per_second_per_second - float meter_per_second_per_second; -} uavcan_si_sample_acceleration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_acceleration_Scalar_1_0_serialize_( - const uavcan_si_sample_acceleration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 meter_per_second_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter_per_second_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_acceleration_Scalar_1_0_deserialize_( - uavcan_si_sample_acceleration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 meter_per_second_per_second - out_obj->meter_per_second_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_acceleration_Scalar_1_0_initialize_(uavcan_si_sample_acceleration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_acceleration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ACCELERATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Vector3_1_0.h deleted file mode 100644 index 8bfc5c016..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/acceleration/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.814193 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.acceleration.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ACCELERATION_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ACCELERATION_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_acceleration_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_acceleration_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.acceleration.Vector3" -#define uavcan_si_sample_acceleration_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.acceleration.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_acceleration_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_acceleration_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter_per_second_per_second -#define uavcan_si_sample_acceleration_Vector3_1_0_meter_per_second_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_acceleration_Vector3_1_0_meter_per_second_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] meter_per_second_per_second - float meter_per_second_per_second[3]; -} uavcan_si_sample_acceleration_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_acceleration_Vector3_1_0_serialize_( - const uavcan_si_sample_acceleration_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] meter_per_second_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter_per_second_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_acceleration_Vector3_1_0_deserialize_( - uavcan_si_sample_acceleration_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] meter_per_second_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter_per_second_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_acceleration_Vector3_1_0_initialize_(uavcan_si_sample_acceleration_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_acceleration_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ACCELERATION_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Quaternion_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Quaternion_1_0.h deleted file mode 100644 index 2245d1241..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Quaternion_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.782941 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angle.Quaternion -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGLE_QUATERNION_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGLE_QUATERNION_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angle_Quaternion_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angle_Quaternion_1_0_FULL_NAME_ "uavcan.si.sample.angle.Quaternion" -#define uavcan_si_sample_angle_Quaternion_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angle.Quaternion.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angle_Quaternion_1_0_EXTENT_BYTES_ 23UL -#define uavcan_si_sample_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 23UL -static_assert(uavcan_si_sample_angle_Quaternion_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[4] wxyz -#define uavcan_si_sample_angle_Quaternion_1_0_wxyz_ARRAY_CAPACITY_ 4U -#define uavcan_si_sample_angle_Quaternion_1_0_wxyz_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[4] wxyz - float wxyz[4]; -} uavcan_si_sample_angle_Quaternion_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angle_Quaternion_1_0_serialize_( - const uavcan_si_sample_angle_Quaternion_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 184UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[4] wxyz - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 4UL * 32UL, &obj->wxyz[0], 0U); - offset_bits += 4UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angle_Quaternion_1_0_deserialize_( - uavcan_si_sample_angle_Quaternion_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[4] wxyz - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->wxyz[0], &buffer[0], capacity_bytes, offset_bits, 4UL * 32U); - offset_bits += 4UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angle_Quaternion_1_0_initialize_(uavcan_si_sample_angle_Quaternion_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angle_Quaternion_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGLE_QUATERNION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Scalar_1_0.h deleted file mode 100644 index 9e364f5af..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angle/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.782941 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angle.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGLE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGLE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angle_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angle_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.angle.Scalar" -#define uavcan_si_sample_angle_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angle.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angle_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_angle_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 radian - float radian; -} uavcan_si_sample_angle_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angle_Scalar_1_0_serialize_( - const uavcan_si_sample_angle_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 radian - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angle_Scalar_1_0_deserialize_( - uavcan_si_sample_angle_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 radian - out_obj->radian = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angle_Scalar_1_0_initialize_(uavcan_si_sample_angle_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angle_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGLE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Scalar_1_0.h deleted file mode 100644 index 399e7d616..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.751544 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angular_acceleration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angular_acceleration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angular_acceleration_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.angular_acceleration.Scalar" -#define uavcan_si_sample_angular_acceleration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angular_acceleration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angular_acceleration_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_angular_acceleration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 radian_per_second_per_second - float radian_per_second_per_second; -} uavcan_si_sample_angular_acceleration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_acceleration_Scalar_1_0_serialize_( - const uavcan_si_sample_angular_acceleration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 radian_per_second_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian_per_second_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_acceleration_Scalar_1_0_deserialize_( - uavcan_si_sample_angular_acceleration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 radian_per_second_per_second - out_obj->radian_per_second_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angular_acceleration_Scalar_1_0_initialize_(uavcan_si_sample_angular_acceleration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angular_acceleration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Vector3_1_0.h deleted file mode 100644 index 61203dac3..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_acceleration/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.751544 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angular_acceleration.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.angular_acceleration.Vector3" -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angular_acceleration.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_angular_acceleration_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] radian_per_second_per_second -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_radian_per_second_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_angular_acceleration_Vector3_1_0_radian_per_second_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] radian_per_second_per_second - float radian_per_second_per_second[3]; -} uavcan_si_sample_angular_acceleration_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_acceleration_Vector3_1_0_serialize_( - const uavcan_si_sample_angular_acceleration_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] radian_per_second_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->radian_per_second_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_acceleration_Vector3_1_0_deserialize_( - uavcan_si_sample_angular_acceleration_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] radian_per_second_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->radian_per_second_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angular_acceleration_Vector3_1_0_initialize_(uavcan_si_sample_angular_acceleration_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angular_acceleration_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Scalar_1_0.h deleted file mode 100644 index 3514dd7a4..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.720123 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angular_velocity.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angular_velocity_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angular_velocity_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.angular_velocity.Scalar" -#define uavcan_si_sample_angular_velocity_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angular_velocity.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angular_velocity_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_angular_velocity_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 radian_per_second - float radian_per_second; -} uavcan_si_sample_angular_velocity_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_velocity_Scalar_1_0_serialize_( - const uavcan_si_sample_angular_velocity_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 radian_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_velocity_Scalar_1_0_deserialize_( - uavcan_si_sample_angular_velocity_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 radian_per_second - out_obj->radian_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angular_velocity_Scalar_1_0_initialize_(uavcan_si_sample_angular_velocity_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angular_velocity_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Vector3_1_0.h deleted file mode 100644 index abea403cf..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/angular_velocity/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.720123 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.angular_velocity.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_angular_velocity_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_angular_velocity_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.angular_velocity.Vector3" -#define uavcan_si_sample_angular_velocity_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.angular_velocity.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_angular_velocity_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_angular_velocity_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] radian_per_second -#define uavcan_si_sample_angular_velocity_Vector3_1_0_radian_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_angular_velocity_Vector3_1_0_radian_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] radian_per_second - float radian_per_second[3]; -} uavcan_si_sample_angular_velocity_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_velocity_Vector3_1_0_serialize_( - const uavcan_si_sample_angular_velocity_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] radian_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->radian_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_angular_velocity_Vector3_1_0_deserialize_( - uavcan_si_sample_angular_velocity_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] radian_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->radian_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_angular_velocity_Vector3_1_0_initialize_(uavcan_si_sample_angular_velocity_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_angular_velocity_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/Scalar_1_0.h deleted file mode 100644 index 771becc04..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.814193 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.duration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_DURATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_DURATION_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_duration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_duration_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.duration.Scalar" -#define uavcan_si_sample_duration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.duration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_duration_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_duration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 second - float second; -} uavcan_si_sample_duration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_duration_Scalar_1_0_serialize_( - const uavcan_si_sample_duration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_duration_Scalar_1_0_deserialize_( - uavcan_si_sample_duration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 second - out_obj->second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_duration_Scalar_1_0_initialize_(uavcan_si_sample_duration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_duration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_DURATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/WideScalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/WideScalar_1_0.h deleted file mode 100644 index 55428a6ea..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/duration/WideScalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.829871 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.duration.WideScalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_DURATION_WIDE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_DURATION_WIDE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_duration_WideScalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_duration_WideScalar_1_0_FULL_NAME_ "uavcan.si.sample.duration.WideScalar" -#define uavcan_si_sample_duration_WideScalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.duration.WideScalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_duration_WideScalar_1_0_EXTENT_BYTES_ 15UL -#define uavcan_si_sample_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 15UL -static_assert(uavcan_si_sample_duration_WideScalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float64 second - double second; -} uavcan_si_sample_duration_WideScalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_duration_WideScalar_1_0_serialize_( - const uavcan_si_sample_duration_WideScalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 120UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float64 second - // Saturation code not emitted -- assume the native representation of float64 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->second, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_duration_WideScalar_1_0_deserialize_( - uavcan_si_sample_duration_WideScalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float64 second - out_obj->second = nunavutGetF64(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_duration_WideScalar_1_0_initialize_(uavcan_si_sample_duration_WideScalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_duration_WideScalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_DURATION_WIDE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_charge/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_charge/Scalar_1_0.h deleted file mode 100644 index 897eb413d..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_charge/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.688521 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.electric_charge.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_electric_charge_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_electric_charge_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.electric_charge.Scalar" -#define uavcan_si_sample_electric_charge_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.electric_charge.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_electric_charge_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_electric_charge_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 coulomb - float coulomb; -} uavcan_si_sample_electric_charge_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_electric_charge_Scalar_1_0_serialize_( - const uavcan_si_sample_electric_charge_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 coulomb - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->coulomb, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_electric_charge_Scalar_1_0_deserialize_( - uavcan_si_sample_electric_charge_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 coulomb - out_obj->coulomb = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_electric_charge_Scalar_1_0_initialize_(uavcan_si_sample_electric_charge_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_electric_charge_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_current/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_current/Scalar_1_0.h deleted file mode 100644 index a3e528e94..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/electric_current/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.767277 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.electric_current.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_electric_current_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_electric_current_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.electric_current.Scalar" -#define uavcan_si_sample_electric_current_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.electric_current.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_electric_current_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_electric_current_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 ampere - float ampere; -} uavcan_si_sample_electric_current_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_electric_current_Scalar_1_0_serialize_( - const uavcan_si_sample_electric_current_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 ampere - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->ampere, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_electric_current_Scalar_1_0_deserialize_( - uavcan_si_sample_electric_current_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 ampere - out_obj->ampere = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_electric_current_Scalar_1_0_initialize_(uavcan_si_sample_electric_current_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_electric_current_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/energy/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/energy/Scalar_1_0.h deleted file mode 100644 index 137329448..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/energy/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.814193 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.energy.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_ENERGY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_ENERGY_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_energy_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_energy_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.energy.Scalar" -#define uavcan_si_sample_energy_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.energy.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_energy_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_energy_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 joule - float joule; -} uavcan_si_sample_energy_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_energy_Scalar_1_0_serialize_( - const uavcan_si_sample_energy_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 joule - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->joule, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_energy_Scalar_1_0_deserialize_( - uavcan_si_sample_energy_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 joule - out_obj->joule = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_energy_Scalar_1_0_initialize_(uavcan_si_sample_energy_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_energy_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_ENERGY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Scalar_1_0.h deleted file mode 100644 index b69014ba2..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.735886 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.force.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_FORCE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_FORCE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_force_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_force_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.force.Scalar" -#define uavcan_si_sample_force_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.force.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_force_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_force_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 newton - float newton; -} uavcan_si_sample_force_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_force_Scalar_1_0_serialize_( - const uavcan_si_sample_force_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 newton - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->newton, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_force_Scalar_1_0_deserialize_( - uavcan_si_sample_force_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 newton - out_obj->newton = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_force_Scalar_1_0_initialize_(uavcan_si_sample_force_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_force_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_FORCE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Vector3_1_0.h deleted file mode 100644 index bf51d3c76..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/force/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.735886 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.force.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_FORCE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_FORCE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_force_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_force_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.force.Vector3" -#define uavcan_si_sample_force_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.force.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_force_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_force_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] newton -#define uavcan_si_sample_force_Vector3_1_0_newton_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_force_Vector3_1_0_newton_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] newton - float newton[3]; -} uavcan_si_sample_force_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_force_Vector3_1_0_serialize_( - const uavcan_si_sample_force_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] newton - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->newton[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_force_Vector3_1_0_deserialize_( - uavcan_si_sample_force_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] newton - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->newton[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_force_Vector3_1_0_initialize_(uavcan_si_sample_force_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_force_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_FORCE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/frequency/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/frequency/Scalar_1_0.h deleted file mode 100644 index 33b769731..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/frequency/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.751544 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.frequency.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_FREQUENCY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_FREQUENCY_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_frequency_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_frequency_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.frequency.Scalar" -#define uavcan_si_sample_frequency_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.frequency.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_frequency_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_frequency_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 hertz - float hertz; -} uavcan_si_sample_frequency_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_frequency_Scalar_1_0_serialize_( - const uavcan_si_sample_frequency_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 hertz - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->hertz, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_frequency_Scalar_1_0_deserialize_( - uavcan_si_sample_frequency_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 hertz - out_obj->hertz = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_frequency_Scalar_1_0_initialize_(uavcan_si_sample_frequency_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_frequency_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_FREQUENCY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Scalar_1_0.h deleted file mode 100644 index 9f3af1439..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.782941 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.length.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_LENGTH_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_LENGTH_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_length_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_length_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.length.Scalar" -#define uavcan_si_sample_length_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.length.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_length_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_length_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 meter - float meter; -} uavcan_si_sample_length_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_Scalar_1_0_serialize_( - const uavcan_si_sample_length_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_Scalar_1_0_deserialize_( - uavcan_si_sample_length_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 meter - out_obj->meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_length_Scalar_1_0_initialize_(uavcan_si_sample_length_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_length_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_LENGTH_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Vector3_1_0.h deleted file mode 100644 index 3efaf4a30..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.798567 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.length.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_LENGTH_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_LENGTH_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_length_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_length_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.length.Vector3" -#define uavcan_si_sample_length_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.length.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_length_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_length_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter -#define uavcan_si_sample_length_Vector3_1_0_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_length_Vector3_1_0_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] meter - float meter[3]; -} uavcan_si_sample_length_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_Vector3_1_0_serialize_( - const uavcan_si_sample_length_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_Vector3_1_0_deserialize_( - uavcan_si_sample_length_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_length_Vector3_1_0_initialize_(uavcan_si_sample_length_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_length_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_LENGTH_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideScalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideScalar_1_0.h deleted file mode 100644 index e4e6c098e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideScalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.798567 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.length.WideScalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_length_WideScalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_length_WideScalar_1_0_FULL_NAME_ "uavcan.si.sample.length.WideScalar" -#define uavcan_si_sample_length_WideScalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.length.WideScalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_length_WideScalar_1_0_EXTENT_BYTES_ 15UL -#define uavcan_si_sample_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 15UL -static_assert(uavcan_si_sample_length_WideScalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float64 meter - double meter; -} uavcan_si_sample_length_WideScalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_WideScalar_1_0_serialize_( - const uavcan_si_sample_length_WideScalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 120UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float64 meter - // Saturation code not emitted -- assume the native representation of float64 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_WideScalar_1_0_deserialize_( - uavcan_si_sample_length_WideScalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float64 meter - out_obj->meter = nunavutGetF64(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_length_WideScalar_1_0_initialize_(uavcan_si_sample_length_WideScalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_length_WideScalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideVector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideVector3_1_0.h deleted file mode 100644 index a407631d5..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/length/WideVector3_1_0.h +++ /dev/null @@ -1,268 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.798567 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.length.WideVector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_length_WideVector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_length_WideVector3_1_0_FULL_NAME_ "uavcan.si.sample.length.WideVector3" -#define uavcan_si_sample_length_WideVector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.length.WideVector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_length_WideVector3_1_0_EXTENT_BYTES_ 31UL -#define uavcan_si_sample_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 31UL -static_assert(uavcan_si_sample_length_WideVector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float64[3] meter -#define uavcan_si_sample_length_WideVector3_1_0_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_length_WideVector3_1_0_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float64[3] meter - double meter[3]; -} uavcan_si_sample_length_WideVector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_WideVector3_1_0_serialize_( - const uavcan_si_sample_length_WideVector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 248UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float64[3] meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 64UL, &obj->meter[0], 0U); - offset_bits += 3UL * 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_length_WideVector3_1_0_deserialize_( - uavcan_si_sample_length_WideVector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float64[3] meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 64U); - offset_bits += 3UL * 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_length_WideVector3_1_0_initialize_(uavcan_si_sample_length_WideVector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_length_WideVector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Scalar_1_0.h deleted file mode 100644 index 43c1a9d73..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.829871 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.magnetic_field_strength.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_magnetic_field_strength_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_magnetic_field_strength_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.magnetic_field_strength.Scalar" -#define uavcan_si_sample_magnetic_field_strength_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.magnetic_field_strength.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_magnetic_field_strength_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_magnetic_field_strength_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 tesla - float tesla; -} uavcan_si_sample_magnetic_field_strength_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_magnetic_field_strength_Scalar_1_0_serialize_( - const uavcan_si_sample_magnetic_field_strength_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 tesla - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->tesla, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_magnetic_field_strength_Scalar_1_0_deserialize_( - uavcan_si_sample_magnetic_field_strength_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 tesla - out_obj->tesla = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_magnetic_field_strength_Scalar_1_0_initialize_(uavcan_si_sample_magnetic_field_strength_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_magnetic_field_strength_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Vector3_1_0.h deleted file mode 100644 index 0a08c1089..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/magnetic_field_strength/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.829871 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.magnetic_field_strength.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.magnetic_field_strength.Vector3" -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.magnetic_field_strength.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] tesla -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_tesla_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_magnetic_field_strength_Vector3_1_0_tesla_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] tesla - float tesla[3]; -} uavcan_si_sample_magnetic_field_strength_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_magnetic_field_strength_Vector3_1_0_serialize_( - const uavcan_si_sample_magnetic_field_strength_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] tesla - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->tesla[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_magnetic_field_strength_Vector3_1_0_deserialize_( - uavcan_si_sample_magnetic_field_strength_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] tesla - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->tesla[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_magnetic_field_strength_Vector3_1_0_initialize_(uavcan_si_sample_magnetic_field_strength_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_magnetic_field_strength_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/mass/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/mass/Scalar_1_0.h deleted file mode 100644 index a14de5213..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/mass/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.704147 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.mass.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_MASS_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_MASS_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_mass_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_mass_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.mass.Scalar" -#define uavcan_si_sample_mass_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.mass.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_mass_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_mass_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 kilogram - float kilogram; -} uavcan_si_sample_mass_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_mass_Scalar_1_0_serialize_( - const uavcan_si_sample_mass_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 kilogram - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->kilogram, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_mass_Scalar_1_0_deserialize_( - uavcan_si_sample_mass_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 kilogram - out_obj->kilogram = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_mass_Scalar_1_0_initialize_(uavcan_si_sample_mass_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_mass_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_MASS_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/power/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/power/Scalar_1_0.h deleted file mode 100644 index f1c2b9eee..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/power/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.767277 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.power.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_POWER_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_POWER_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_power_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_power_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.power.Scalar" -#define uavcan_si_sample_power_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.power.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_power_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_power_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 watt - float watt; -} uavcan_si_sample_power_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_power_Scalar_1_0_serialize_( - const uavcan_si_sample_power_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 watt - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->watt, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_power_Scalar_1_0_deserialize_( - uavcan_si_sample_power_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 watt - out_obj->watt = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_power_Scalar_1_0_initialize_(uavcan_si_sample_power_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_power_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_POWER_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/pressure/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/pressure/Scalar_1_0.h deleted file mode 100644 index bbc65f3f5..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/pressure/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.735886 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.pressure.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_PRESSURE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_PRESSURE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_pressure_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_pressure_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.pressure.Scalar" -#define uavcan_si_sample_pressure_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.pressure.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_pressure_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_pressure_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 pascal - float pascal; -} uavcan_si_sample_pressure_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_pressure_Scalar_1_0_serialize_( - const uavcan_si_sample_pressure_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 pascal - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->pascal, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_pressure_Scalar_1_0_deserialize_( - uavcan_si_sample_pressure_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 pascal - out_obj->pascal = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_pressure_Scalar_1_0_initialize_(uavcan_si_sample_pressure_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_pressure_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_PRESSURE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/temperature/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/temperature/Scalar_1_0.h deleted file mode 100644 index ab5d12356..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/temperature/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.720123 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.temperature.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_TEMPERATURE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_TEMPERATURE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_temperature_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_temperature_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.temperature.Scalar" -#define uavcan_si_sample_temperature_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.temperature.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_temperature_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_temperature_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 kelvin - float kelvin; -} uavcan_si_sample_temperature_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_temperature_Scalar_1_0_serialize_( - const uavcan_si_sample_temperature_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 kelvin - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->kelvin, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_temperature_Scalar_1_0_deserialize_( - uavcan_si_sample_temperature_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 kelvin - out_obj->kelvin = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_temperature_Scalar_1_0_initialize_(uavcan_si_sample_temperature_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_temperature_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_TEMPERATURE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Scalar_1_0.h deleted file mode 100644 index 481fe87a8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.704147 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.torque.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_TORQUE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_TORQUE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_torque_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_torque_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.torque.Scalar" -#define uavcan_si_sample_torque_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.torque.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_torque_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_torque_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 newton_meter - float newton_meter; -} uavcan_si_sample_torque_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_torque_Scalar_1_0_serialize_( - const uavcan_si_sample_torque_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 newton_meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->newton_meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_torque_Scalar_1_0_deserialize_( - uavcan_si_sample_torque_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 newton_meter - out_obj->newton_meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_torque_Scalar_1_0_initialize_(uavcan_si_sample_torque_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_torque_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_TORQUE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Vector3_1_0.h deleted file mode 100644 index 42d80123e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/torque/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.720123 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.torque.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_TORQUE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_TORQUE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_torque_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_torque_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.torque.Vector3" -#define uavcan_si_sample_torque_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.torque.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_torque_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_torque_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] newton_meter -#define uavcan_si_sample_torque_Vector3_1_0_newton_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_torque_Vector3_1_0_newton_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] newton_meter - float newton_meter[3]; -} uavcan_si_sample_torque_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_torque_Vector3_1_0_serialize_( - const uavcan_si_sample_torque_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] newton_meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->newton_meter[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_torque_Vector3_1_0_deserialize_( - uavcan_si_sample_torque_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] newton_meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->newton_meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_torque_Vector3_1_0_initialize_(uavcan_si_sample_torque_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_torque_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_TORQUE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Scalar_1_0.h deleted file mode 100644 index 6b867e47c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.688521 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.velocity.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_VELOCITY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_VELOCITY_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_velocity_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_velocity_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.velocity.Scalar" -#define uavcan_si_sample_velocity_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.velocity.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_velocity_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_velocity_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 meter_per_second - float meter_per_second; -} uavcan_si_sample_velocity_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_velocity_Scalar_1_0_serialize_( - const uavcan_si_sample_velocity_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 meter_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_velocity_Scalar_1_0_deserialize_( - uavcan_si_sample_velocity_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 meter_per_second - out_obj->meter_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_velocity_Scalar_1_0_initialize_(uavcan_si_sample_velocity_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_velocity_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_VELOCITY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Vector3_1_0.h deleted file mode 100644 index b2f3389ad..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/velocity/Vector3_1_0.h +++ /dev/null @@ -1,266 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.688521 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.velocity.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_VELOCITY_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_VELOCITY_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_velocity_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_velocity_Vector3_1_0_FULL_NAME_ "uavcan.si.sample.velocity.Vector3" -#define uavcan_si_sample_velocity_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.velocity.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_velocity_Vector3_1_0_EXTENT_BYTES_ 19UL -#define uavcan_si_sample_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 19UL -static_assert(uavcan_si_sample_velocity_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_sample_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter_per_second -#define uavcan_si_sample_velocity_Vector3_1_0_meter_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_sample_velocity_Vector3_1_0_meter_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32[3] meter_per_second - float meter_per_second[3]; -} uavcan_si_sample_velocity_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_velocity_Vector3_1_0_serialize_( - const uavcan_si_sample_velocity_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 152UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32[3] meter_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_velocity_Vector3_1_0_deserialize_( - uavcan_si_sample_velocity_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32[3] meter_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_velocity_Vector3_1_0_initialize_(uavcan_si_sample_velocity_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_velocity_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_VELOCITY_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/voltage/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/voltage/Scalar_1_0.h deleted file mode 100644 index d7c338ca5..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/voltage/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.767277 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.voltage.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_VOLTAGE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_VOLTAGE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_voltage_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_voltage_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.voltage.Scalar" -#define uavcan_si_sample_voltage_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.voltage.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_voltage_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_voltage_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 volt - float volt; -} uavcan_si_sample_voltage_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_voltage_Scalar_1_0_serialize_( - const uavcan_si_sample_voltage_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 volt - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->volt, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_voltage_Scalar_1_0_deserialize_( - uavcan_si_sample_voltage_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 volt - out_obj->volt = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_voltage_Scalar_1_0_initialize_(uavcan_si_sample_voltage_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_voltage_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_VOLTAGE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/volume/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/volume/Scalar_1_0.h deleted file mode 100644 index b9033534a..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/volume/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.751544 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.volume.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_VOLUME_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_VOLUME_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_volume_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_volume_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.volume.Scalar" -#define uavcan_si_sample_volume_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.volume.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_volume_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_volume_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 cubic_meter - float cubic_meter; -} uavcan_si_sample_volume_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_volume_Scalar_1_0_serialize_( - const uavcan_si_sample_volume_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 cubic_meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->cubic_meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_volume_Scalar_1_0_deserialize_( - uavcan_si_sample_volume_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 cubic_meter - out_obj->cubic_meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_volume_Scalar_1_0_initialize_(uavcan_si_sample_volume_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_volume_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_VOLUME_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/sample/volumetric_flow_rate/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/sample/volumetric_flow_rate/Scalar_1_0.h deleted file mode 100644 index 426390b9b..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/sample/volumetric_flow_rate/Scalar_1_0.h +++ /dev/null @@ -1,260 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.704147 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.sample.volumetric_flow_rate.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_SAMPLE_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_SAMPLE_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/sample/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_FULL_NAME_ "uavcan.si.sample.volumetric_flow_rate.Scalar" -#define uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.sample.volumetric_flow_rate.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_EXTENT_BYTES_ 11UL -#define uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 11UL -static_assert(uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// uavcan.time.SynchronizedTimestamp.1.0 timestamp - uavcan_time_SynchronizedTimestamp_1_0 timestamp; - - /// saturated float32 cubic_meter_per_second - float cubic_meter_per_second; -} uavcan_si_sample_volumetric_flow_rate_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_serialize_( - const uavcan_si_sample_volumetric_flow_rate_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 88UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // uavcan.time.SynchronizedTimestamp.1.0 timestamp - size_t _size_bytes0_ = 7UL; // Nested object (max) size, in bytes. - int8_t _err0_ = uavcan_time_SynchronizedTimestamp_1_0_serialize_( - &obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err0_ < 0) - { - return _err0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - - - { // saturated float32 cubic_meter_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->cubic_meter_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err1_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err1_ < 0) - { - return _err1_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_deserialize_( - uavcan_si_sample_volumetric_flow_rate_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // uavcan.time.SynchronizedTimestamp.1.0 timestamp - { - size_t _size_bytes1_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err2_ = uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - &out_obj->timestamp, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested serialized representation. - } - - - - - // saturated float32 cubic_meter_per_second - out_obj->cubic_meter_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_initialize_(uavcan_si_sample_volumetric_flow_rate_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_sample_volumetric_flow_rate_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_SAMPLE_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Scalar_1_0.h deleted file mode 100644 index 9f7d9e707..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.594722 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.acceleration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ACCELERATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ACCELERATION_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_acceleration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_acceleration_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.acceleration.Scalar" -#define uavcan_si_unit_acceleration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.acceleration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_acceleration_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_acceleration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 meter_per_second_per_second - float meter_per_second_per_second; -} uavcan_si_unit_acceleration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_acceleration_Scalar_1_0_serialize_( - const uavcan_si_unit_acceleration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 meter_per_second_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter_per_second_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_acceleration_Scalar_1_0_deserialize_( - uavcan_si_unit_acceleration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 meter_per_second_per_second - out_obj->meter_per_second_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_acceleration_Scalar_1_0_initialize_(uavcan_si_unit_acceleration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_acceleration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ACCELERATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Vector3_1_0.h deleted file mode 100644 index a79340d7f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/acceleration/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.594722 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.acceleration.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ACCELERATION_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ACCELERATION_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_acceleration_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_acceleration_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.acceleration.Vector3" -#define uavcan_si_unit_acceleration_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.acceleration.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_acceleration_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_acceleration_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter_per_second_per_second -#define uavcan_si_unit_acceleration_Vector3_1_0_meter_per_second_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_acceleration_Vector3_1_0_meter_per_second_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] meter_per_second_per_second - float meter_per_second_per_second[3]; -} uavcan_si_unit_acceleration_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_acceleration_Vector3_1_0_serialize_( - const uavcan_si_unit_acceleration_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] meter_per_second_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter_per_second_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_acceleration_Vector3_1_0_deserialize_( - uavcan_si_unit_acceleration_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] meter_per_second_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter_per_second_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_acceleration_Vector3_1_0_initialize_(uavcan_si_unit_acceleration_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_acceleration_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ACCELERATION_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Quaternion_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Quaternion_1_0.h deleted file mode 100644 index 6e8644299..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Quaternion_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.657275 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angle.Quaternion -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGLE_QUATERNION_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGLE_QUATERNION_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Quaternion.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angle_Quaternion_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angle_Quaternion_1_0_FULL_NAME_ "uavcan.si.unit.angle.Quaternion" -#define uavcan_si_unit_angle_Quaternion_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angle.Quaternion.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angle_Quaternion_1_0_EXTENT_BYTES_ 16UL -#define uavcan_si_unit_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 16UL -static_assert(uavcan_si_unit_angle_Quaternion_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[4] wxyz -#define uavcan_si_unit_angle_Quaternion_1_0_wxyz_ARRAY_CAPACITY_ 4U -#define uavcan_si_unit_angle_Quaternion_1_0_wxyz_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[4] wxyz - float wxyz[4]; -} uavcan_si_unit_angle_Quaternion_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angle_Quaternion_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angle_Quaternion_1_0_serialize_( - const uavcan_si_unit_angle_Quaternion_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 128UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[4] wxyz - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 4UL * 32UL, &obj->wxyz[0], 0U); - offset_bits += 4UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angle_Quaternion_1_0_deserialize_( - uavcan_si_unit_angle_Quaternion_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[4] wxyz - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->wxyz[0], &buffer[0], capacity_bytes, offset_bits, 4UL * 32U); - offset_bits += 4UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angle_Quaternion_1_0_initialize_(uavcan_si_unit_angle_Quaternion_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angle_Quaternion_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGLE_QUATERNION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Scalar_1_0.h deleted file mode 100644 index 5f0ab0a41..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angle/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.657275 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angle.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGLE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGLE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angle/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angle_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angle_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.angle.Scalar" -#define uavcan_si_unit_angle_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angle.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angle_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_angle_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 radian - float radian; -} uavcan_si_unit_angle_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angle_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angle_Scalar_1_0_serialize_( - const uavcan_si_unit_angle_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 radian - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angle_Scalar_1_0_deserialize_( - uavcan_si_unit_angle_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 radian - out_obj->radian = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angle_Scalar_1_0_initialize_(uavcan_si_unit_angle_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angle_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGLE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Scalar_1_0.h deleted file mode 100644 index c0c5a7354..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.547576 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angular_acceleration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angular_acceleration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angular_acceleration_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.angular_acceleration.Scalar" -#define uavcan_si_unit_angular_acceleration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angular_acceleration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angular_acceleration_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_angular_acceleration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 radian_per_second_per_second - float radian_per_second_per_second; -} uavcan_si_unit_angular_acceleration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angular_acceleration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_acceleration_Scalar_1_0_serialize_( - const uavcan_si_unit_angular_acceleration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 radian_per_second_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian_per_second_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_acceleration_Scalar_1_0_deserialize_( - uavcan_si_unit_angular_acceleration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 radian_per_second_per_second - out_obj->radian_per_second_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angular_acceleration_Scalar_1_0_initialize_(uavcan_si_unit_angular_acceleration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angular_acceleration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Vector3_1_0.h deleted file mode 100644 index ed6015073..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_acceleration/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.547576 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angular_acceleration.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_acceleration/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.angular_acceleration.Vector3" -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angular_acceleration.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_angular_acceleration_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] radian_per_second_per_second -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_radian_per_second_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_angular_acceleration_Vector3_1_0_radian_per_second_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] radian_per_second_per_second - float radian_per_second_per_second[3]; -} uavcan_si_unit_angular_acceleration_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angular_acceleration_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_acceleration_Vector3_1_0_serialize_( - const uavcan_si_unit_angular_acceleration_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] radian_per_second_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->radian_per_second_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_acceleration_Vector3_1_0_deserialize_( - uavcan_si_unit_angular_acceleration_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] radian_per_second_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->radian_per_second_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angular_acceleration_Vector3_1_0_initialize_(uavcan_si_unit_angular_acceleration_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angular_acceleration_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGULAR_ACCELERATION_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Scalar_1_0.h deleted file mode 100644 index c781bd32c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.610574 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angular_velocity.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angular_velocity_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angular_velocity_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.angular_velocity.Scalar" -#define uavcan_si_unit_angular_velocity_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angular_velocity.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angular_velocity_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_angular_velocity_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 radian_per_second - float radian_per_second; -} uavcan_si_unit_angular_velocity_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angular_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_velocity_Scalar_1_0_serialize_( - const uavcan_si_unit_angular_velocity_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 radian_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->radian_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_velocity_Scalar_1_0_deserialize_( - uavcan_si_unit_angular_velocity_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 radian_per_second - out_obj->radian_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angular_velocity_Scalar_1_0_initialize_(uavcan_si_unit_angular_velocity_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angular_velocity_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGULAR_VELOCITY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Vector3_1_0.h deleted file mode 100644 index b52cb17eb..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/angular_velocity/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.610574 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.angular_velocity.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/angular_velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_angular_velocity_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_angular_velocity_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.angular_velocity.Vector3" -#define uavcan_si_unit_angular_velocity_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.angular_velocity.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_angular_velocity_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_angular_velocity_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] radian_per_second -#define uavcan_si_unit_angular_velocity_Vector3_1_0_radian_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_angular_velocity_Vector3_1_0_radian_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] radian_per_second - float radian_per_second[3]; -} uavcan_si_unit_angular_velocity_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_angular_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_velocity_Vector3_1_0_serialize_( - const uavcan_si_unit_angular_velocity_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] radian_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->radian_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_angular_velocity_Vector3_1_0_deserialize_( - uavcan_si_unit_angular_velocity_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] radian_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->radian_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_angular_velocity_Vector3_1_0_initialize_(uavcan_si_unit_angular_velocity_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_angular_velocity_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ANGULAR_VELOCITY_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/Scalar_1_0.h deleted file mode 100644 index c31ab0b7e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.672893 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.duration.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_DURATION_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_DURATION_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_duration_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_duration_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.duration.Scalar" -#define uavcan_si_unit_duration_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.duration.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_duration_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_duration_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 second - float second; -} uavcan_si_unit_duration_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_duration_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_duration_Scalar_1_0_serialize_( - const uavcan_si_unit_duration_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_duration_Scalar_1_0_deserialize_( - uavcan_si_unit_duration_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 second - out_obj->second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_duration_Scalar_1_0_initialize_(uavcan_si_unit_duration_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_duration_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_DURATION_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/WideScalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/WideScalar_1_0.h deleted file mode 100644 index a1f4699fa..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/duration/WideScalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.688521 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.duration.WideScalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_DURATION_WIDE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_DURATION_WIDE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/duration/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_duration_WideScalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_duration_WideScalar_1_0_FULL_NAME_ "uavcan.si.unit.duration.WideScalar" -#define uavcan_si_unit_duration_WideScalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.duration.WideScalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_duration_WideScalar_1_0_EXTENT_BYTES_ 8UL -#define uavcan_si_unit_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(uavcan_si_unit_duration_WideScalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float64 second - double second; -} uavcan_si_unit_duration_WideScalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_duration_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_duration_WideScalar_1_0_serialize_( - const uavcan_si_unit_duration_WideScalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float64 second - // Saturation code not emitted -- assume the native representation of float64 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->second, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_duration_WideScalar_1_0_deserialize_( - uavcan_si_unit_duration_WideScalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float64 second - out_obj->second = nunavutGetF64(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_duration_WideScalar_1_0_initialize_(uavcan_si_unit_duration_WideScalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_duration_WideScalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_DURATION_WIDE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_charge/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_charge/Scalar_1_0.h deleted file mode 100644 index 69c42b575..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_charge/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.641825 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.electric_charge.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_charge/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_electric_charge_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_electric_charge_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.electric_charge.Scalar" -#define uavcan_si_unit_electric_charge_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.electric_charge.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_electric_charge_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_electric_charge_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 coulomb - float coulomb; -} uavcan_si_unit_electric_charge_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_electric_charge_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_electric_charge_Scalar_1_0_serialize_( - const uavcan_si_unit_electric_charge_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 coulomb - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->coulomb, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_electric_charge_Scalar_1_0_deserialize_( - uavcan_si_unit_electric_charge_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 coulomb - out_obj->coulomb = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_electric_charge_Scalar_1_0_initialize_(uavcan_si_unit_electric_charge_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_electric_charge_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ELECTRIC_CHARGE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_current/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_current/Scalar_1_0.h deleted file mode 100644 index 262bd3e4e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/electric_current/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.641825 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.electric_current.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/electric_current/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_electric_current_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_electric_current_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.electric_current.Scalar" -#define uavcan_si_unit_electric_current_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.electric_current.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_electric_current_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_electric_current_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 ampere - float ampere; -} uavcan_si_unit_electric_current_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_electric_current_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_electric_current_Scalar_1_0_serialize_( - const uavcan_si_unit_electric_current_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 ampere - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->ampere, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_electric_current_Scalar_1_0_deserialize_( - uavcan_si_unit_electric_current_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 ampere - out_obj->ampere = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_electric_current_Scalar_1_0_initialize_(uavcan_si_unit_electric_current_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_electric_current_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ELECTRIC_CURRENT_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/energy/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/energy/Scalar_1_0.h deleted file mode 100644 index eff5a1f1e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/energy/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.626014 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.energy.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_ENERGY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_ENERGY_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/energy/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_energy_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_energy_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.energy.Scalar" -#define uavcan_si_unit_energy_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.energy.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_energy_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_energy_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 joule - float joule; -} uavcan_si_unit_energy_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_energy_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_energy_Scalar_1_0_serialize_( - const uavcan_si_unit_energy_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 joule - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->joule, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_energy_Scalar_1_0_deserialize_( - uavcan_si_unit_energy_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 joule - out_obj->joule = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_energy_Scalar_1_0_initialize_(uavcan_si_unit_energy_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_energy_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_ENERGY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Scalar_1_0.h deleted file mode 100644 index e29d877ce..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.579066 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.force.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_FORCE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_FORCE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_force_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_force_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.force.Scalar" -#define uavcan_si_unit_force_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.force.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_force_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_force_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 newton - float newton; -} uavcan_si_unit_force_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_force_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_force_Scalar_1_0_serialize_( - const uavcan_si_unit_force_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 newton - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->newton, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_force_Scalar_1_0_deserialize_( - uavcan_si_unit_force_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 newton - out_obj->newton = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_force_Scalar_1_0_initialize_(uavcan_si_unit_force_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_force_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_FORCE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Vector3_1_0.h deleted file mode 100644 index d7a612bb1..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/force/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.594722 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.force.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_FORCE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_FORCE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/force/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_force_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_force_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.force.Vector3" -#define uavcan_si_unit_force_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.force.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_force_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_force_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] newton -#define uavcan_si_unit_force_Vector3_1_0_newton_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_force_Vector3_1_0_newton_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] newton - float newton[3]; -} uavcan_si_unit_force_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_force_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_force_Vector3_1_0_serialize_( - const uavcan_si_unit_force_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] newton - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->newton[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_force_Vector3_1_0_deserialize_( - uavcan_si_unit_force_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] newton - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->newton[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_force_Vector3_1_0_initialize_(uavcan_si_unit_force_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_force_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_FORCE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/frequency/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/frequency/Scalar_1_0.h deleted file mode 100644 index f4d9dc241..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/frequency/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.641825 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.frequency.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_FREQUENCY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_FREQUENCY_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/frequency/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_frequency_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_frequency_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.frequency.Scalar" -#define uavcan_si_unit_frequency_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.frequency.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_frequency_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_frequency_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 hertz - float hertz; -} uavcan_si_unit_frequency_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_frequency_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_frequency_Scalar_1_0_serialize_( - const uavcan_si_unit_frequency_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 hertz - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->hertz, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_frequency_Scalar_1_0_deserialize_( - uavcan_si_unit_frequency_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 hertz - out_obj->hertz = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_frequency_Scalar_1_0_initialize_(uavcan_si_unit_frequency_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_frequency_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_FREQUENCY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Scalar_1_0.h deleted file mode 100644 index 54b062f0e..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.563267 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.length.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_LENGTH_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_LENGTH_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_length_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_length_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.length.Scalar" -#define uavcan_si_unit_length_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.length.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_length_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_length_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 meter - float meter; -} uavcan_si_unit_length_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_length_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_Scalar_1_0_serialize_( - const uavcan_si_unit_length_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_Scalar_1_0_deserialize_( - uavcan_si_unit_length_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 meter - out_obj->meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_length_Scalar_1_0_initialize_(uavcan_si_unit_length_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_length_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_LENGTH_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Vector3_1_0.h deleted file mode 100644 index ca7827bac..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.563267 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.length.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_LENGTH_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_LENGTH_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_length_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_length_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.length.Vector3" -#define uavcan_si_unit_length_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.length.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_length_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_length_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter -#define uavcan_si_unit_length_Vector3_1_0_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_length_Vector3_1_0_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] meter - float meter[3]; -} uavcan_si_unit_length_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_length_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_Vector3_1_0_serialize_( - const uavcan_si_unit_length_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_Vector3_1_0_deserialize_( - uavcan_si_unit_length_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_length_Vector3_1_0_initialize_(uavcan_si_unit_length_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_length_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_LENGTH_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideScalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideScalar_1_0.h deleted file mode 100644 index 2e1fc7f61..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideScalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.579066 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.length.WideScalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideScalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_length_WideScalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_length_WideScalar_1_0_FULL_NAME_ "uavcan.si.unit.length.WideScalar" -#define uavcan_si_unit_length_WideScalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.length.WideScalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_length_WideScalar_1_0_EXTENT_BYTES_ 8UL -#define uavcan_si_unit_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 8UL -static_assert(uavcan_si_unit_length_WideScalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float64 meter - double meter; -} uavcan_si_unit_length_WideScalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_length_WideScalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_WideScalar_1_0_serialize_( - const uavcan_si_unit_length_WideScalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 64UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float64 meter - // Saturation code not emitted -- assume the native representation of float64 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter, 8U); - offset_bits += 64U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_WideScalar_1_0_deserialize_( - uavcan_si_unit_length_WideScalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float64 meter - out_obj->meter = nunavutGetF64(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_length_WideScalar_1_0_initialize_(uavcan_si_unit_length_WideScalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_length_WideScalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_LENGTH_WIDE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideVector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideVector3_1_0.h deleted file mode 100644 index 3feac7d10..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/length/WideVector3_1_0.h +++ /dev/null @@ -1,234 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.579066 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.length.WideVector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/length/WideVector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_length_WideVector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_length_WideVector3_1_0_FULL_NAME_ "uavcan.si.unit.length.WideVector3" -#define uavcan_si_unit_length_WideVector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.length.WideVector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_length_WideVector3_1_0_EXTENT_BYTES_ 24UL -#define uavcan_si_unit_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 24UL -static_assert(uavcan_si_unit_length_WideVector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float64[3] meter -#define uavcan_si_unit_length_WideVector3_1_0_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_length_WideVector3_1_0_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float64[3] meter - double meter[3]; -} uavcan_si_unit_length_WideVector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_length_WideVector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_WideVector3_1_0_serialize_( - const uavcan_si_unit_length_WideVector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 192UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float64[3] meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 64UL, &obj->meter[0], 0U); - offset_bits += 3UL * 64UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_length_WideVector3_1_0_deserialize_( - uavcan_si_unit_length_WideVector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float64[3] meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_DOUBLE, "Native IEEE754 binary64 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 64U); - offset_bits += 3UL * 64U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_length_WideVector3_1_0_initialize_(uavcan_si_unit_length_WideVector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_length_WideVector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_LENGTH_WIDE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Scalar_1_0.h deleted file mode 100644 index 64a57f4a9..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.672893 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.magnetic_field_strength.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_magnetic_field_strength_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_magnetic_field_strength_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.magnetic_field_strength.Scalar" -#define uavcan_si_unit_magnetic_field_strength_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.magnetic_field_strength.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_magnetic_field_strength_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_magnetic_field_strength_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 tesla - float tesla; -} uavcan_si_unit_magnetic_field_strength_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_magnetic_field_strength_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_magnetic_field_strength_Scalar_1_0_serialize_( - const uavcan_si_unit_magnetic_field_strength_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 tesla - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->tesla, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_magnetic_field_strength_Scalar_1_0_deserialize_( - uavcan_si_unit_magnetic_field_strength_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 tesla - out_obj->tesla = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_magnetic_field_strength_Scalar_1_0_initialize_(uavcan_si_unit_magnetic_field_strength_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_magnetic_field_strength_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Vector3_1_0.h deleted file mode 100644 index 194ea992f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/magnetic_field_strength/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.672893 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.magnetic_field_strength.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/magnetic_field_strength/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.magnetic_field_strength.Vector3" -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.magnetic_field_strength.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_magnetic_field_strength_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] tesla -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_tesla_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_magnetic_field_strength_Vector3_1_0_tesla_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] tesla - float tesla[3]; -} uavcan_si_unit_magnetic_field_strength_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_magnetic_field_strength_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_magnetic_field_strength_Vector3_1_0_serialize_( - const uavcan_si_unit_magnetic_field_strength_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] tesla - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->tesla[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_magnetic_field_strength_Vector3_1_0_deserialize_( - uavcan_si_unit_magnetic_field_strength_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] tesla - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->tesla[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_magnetic_field_strength_Vector3_1_0_initialize_(uavcan_si_unit_magnetic_field_strength_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_magnetic_field_strength_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_MAGNETIC_FIELD_STRENGTH_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/mass/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/mass/Scalar_1_0.h deleted file mode 100644 index 68ff35ad9..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/mass/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.626014 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.mass.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_MASS_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_MASS_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/mass/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_mass_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_mass_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.mass.Scalar" -#define uavcan_si_unit_mass_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.mass.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_mass_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_mass_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 kilogram - float kilogram; -} uavcan_si_unit_mass_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_mass_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_mass_Scalar_1_0_serialize_( - const uavcan_si_unit_mass_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 kilogram - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->kilogram, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_mass_Scalar_1_0_deserialize_( - uavcan_si_unit_mass_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 kilogram - out_obj->kilogram = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_mass_Scalar_1_0_initialize_(uavcan_si_unit_mass_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_mass_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_MASS_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/power/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/power/Scalar_1_0.h deleted file mode 100644 index d6383d185..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/power/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.610574 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.power.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_POWER_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_POWER_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/power/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_power_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_power_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.power.Scalar" -#define uavcan_si_unit_power_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.power.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_power_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_power_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 watt - float watt; -} uavcan_si_unit_power_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_power_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_power_Scalar_1_0_serialize_( - const uavcan_si_unit_power_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 watt - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->watt, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_power_Scalar_1_0_deserialize_( - uavcan_si_unit_power_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 watt - out_obj->watt = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_power_Scalar_1_0_initialize_(uavcan_si_unit_power_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_power_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_POWER_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/pressure/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/pressure/Scalar_1_0.h deleted file mode 100644 index e4da50af7..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/pressure/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.626014 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.pressure.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_PRESSURE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_PRESSURE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/pressure/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_pressure_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_pressure_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.pressure.Scalar" -#define uavcan_si_unit_pressure_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.pressure.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_pressure_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_pressure_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 pascal - float pascal; -} uavcan_si_unit_pressure_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_pressure_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_pressure_Scalar_1_0_serialize_( - const uavcan_si_unit_pressure_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 pascal - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->pascal, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_pressure_Scalar_1_0_deserialize_( - uavcan_si_unit_pressure_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 pascal - out_obj->pascal = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_pressure_Scalar_1_0_initialize_(uavcan_si_unit_pressure_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_pressure_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_PRESSURE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/temperature/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/temperature/Scalar_1_0.h deleted file mode 100644 index b9bcad634..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/temperature/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.594722 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.temperature.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_TEMPERATURE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_TEMPERATURE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/temperature/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_temperature_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_temperature_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.temperature.Scalar" -#define uavcan_si_unit_temperature_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.temperature.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_temperature_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_temperature_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 kelvin - float kelvin; -} uavcan_si_unit_temperature_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_temperature_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_temperature_Scalar_1_0_serialize_( - const uavcan_si_unit_temperature_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 kelvin - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->kelvin, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_temperature_Scalar_1_0_deserialize_( - uavcan_si_unit_temperature_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 kelvin - out_obj->kelvin = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_temperature_Scalar_1_0_initialize_(uavcan_si_unit_temperature_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_temperature_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_TEMPERATURE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Scalar_1_0.h deleted file mode 100644 index 090479ada..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.657275 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.torque.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_TORQUE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_TORQUE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_torque_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_torque_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.torque.Scalar" -#define uavcan_si_unit_torque_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.torque.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_torque_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_torque_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 newton_meter - float newton_meter; -} uavcan_si_unit_torque_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_torque_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_torque_Scalar_1_0_serialize_( - const uavcan_si_unit_torque_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 newton_meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->newton_meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_torque_Scalar_1_0_deserialize_( - uavcan_si_unit_torque_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 newton_meter - out_obj->newton_meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_torque_Scalar_1_0_initialize_(uavcan_si_unit_torque_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_torque_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_TORQUE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Vector3_1_0.h deleted file mode 100644 index 44c8941c1..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/torque/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.657275 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.torque.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_TORQUE_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_TORQUE_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/torque/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_torque_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_torque_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.torque.Vector3" -#define uavcan_si_unit_torque_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.torque.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_torque_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_torque_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] newton_meter -#define uavcan_si_unit_torque_Vector3_1_0_newton_meter_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_torque_Vector3_1_0_newton_meter_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] newton_meter - float newton_meter[3]; -} uavcan_si_unit_torque_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_torque_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_torque_Vector3_1_0_serialize_( - const uavcan_si_unit_torque_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] newton_meter - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->newton_meter[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_torque_Vector3_1_0_deserialize_( - uavcan_si_unit_torque_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] newton_meter - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->newton_meter[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_torque_Vector3_1_0_initialize_(uavcan_si_unit_torque_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_torque_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_TORQUE_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Scalar_1_0.h deleted file mode 100644 index 72c3a96b1..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.547576 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.velocity.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_VELOCITY_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_VELOCITY_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_velocity_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_velocity_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.velocity.Scalar" -#define uavcan_si_unit_velocity_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.velocity.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_velocity_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_velocity_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 meter_per_second - float meter_per_second; -} uavcan_si_unit_velocity_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_velocity_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_velocity_Scalar_1_0_serialize_( - const uavcan_si_unit_velocity_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 meter_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->meter_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_velocity_Scalar_1_0_deserialize_( - uavcan_si_unit_velocity_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 meter_per_second - out_obj->meter_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_velocity_Scalar_1_0_initialize_(uavcan_si_unit_velocity_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_velocity_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_VELOCITY_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Vector3_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Vector3_1_0.h deleted file mode 100644 index 174ded068..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/velocity/Vector3_1_0.h +++ /dev/null @@ -1,232 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.563267 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.velocity.Vector3 -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_VELOCITY_VECTOR3_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_VELOCITY_VECTOR3_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/velocity/Vector3.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_velocity_Vector3_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_velocity_Vector3_1_0_FULL_NAME_ "uavcan.si.unit.velocity.Vector3" -#define uavcan_si_unit_velocity_Vector3_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.velocity.Vector3.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_velocity_Vector3_1_0_EXTENT_BYTES_ 12UL -#define uavcan_si_unit_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 12UL -static_assert(uavcan_si_unit_velocity_Vector3_1_0_EXTENT_BYTES_ >= uavcan_si_unit_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// Array metadata for: saturated float32[3] meter_per_second -#define uavcan_si_unit_velocity_Vector3_1_0_meter_per_second_ARRAY_CAPACITY_ 3U -#define uavcan_si_unit_velocity_Vector3_1_0_meter_per_second_ARRAY_IS_VARIABLE_LENGTH_ false - -typedef struct -{ - /// saturated float32[3] meter_per_second - float meter_per_second[3]; -} uavcan_si_unit_velocity_Vector3_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_velocity_Vector3_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_velocity_Vector3_1_0_serialize_( - const uavcan_si_unit_velocity_Vector3_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 96UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32[3] meter_per_second - // Saturation code not emitted -- assume the native representation is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - // Optimization prospect: this item is aligned at the byte boundary, so it is possible to use memmove(). - nunavutCopyBits(&buffer[0], offset_bits, 3UL * 32UL, &obj->meter_per_second[0], 0U); - offset_bits += 3UL * 32UL; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_velocity_Vector3_1_0_deserialize_( - uavcan_si_unit_velocity_Vector3_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32[3] meter_per_second - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - nunavutGetBits(&out_obj->meter_per_second[0], &buffer[0], capacity_bytes, offset_bits, 3UL * 32U); - offset_bits += 3UL * 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_velocity_Vector3_1_0_initialize_(uavcan_si_unit_velocity_Vector3_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_velocity_Vector3_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_VELOCITY_VECTOR3_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/voltage/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/voltage/Scalar_1_0.h deleted file mode 100644 index a255f9e0f..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/voltage/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.626014 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.voltage.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_VOLTAGE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_VOLTAGE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/voltage/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_voltage_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_voltage_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.voltage.Scalar" -#define uavcan_si_unit_voltage_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.voltage.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_voltage_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_voltage_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 volt - float volt; -} uavcan_si_unit_voltage_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_voltage_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_voltage_Scalar_1_0_serialize_( - const uavcan_si_unit_voltage_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 volt - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->volt, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_voltage_Scalar_1_0_deserialize_( - uavcan_si_unit_voltage_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 volt - out_obj->volt = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_voltage_Scalar_1_0_initialize_(uavcan_si_unit_voltage_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_voltage_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_VOLTAGE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/volume/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/volume/Scalar_1_0.h deleted file mode 100644 index 9f014d01c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/volume/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.641825 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.volume.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_VOLUME_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_VOLUME_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volume/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_volume_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_volume_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.volume.Scalar" -#define uavcan_si_unit_volume_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.volume.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_volume_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_volume_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 cubic_meter - float cubic_meter; -} uavcan_si_unit_volume_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_volume_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_volume_Scalar_1_0_serialize_( - const uavcan_si_unit_volume_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 cubic_meter - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->cubic_meter, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_volume_Scalar_1_0_deserialize_( - uavcan_si_unit_volume_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 cubic_meter - out_obj->cubic_meter = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_volume_Scalar_1_0_initialize_(uavcan_si_unit_volume_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_volume_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_VOLUME_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/si/unit/volumetric_flow_rate/Scalar_1_0.h b/platformio/stima_v4/libraries/include/uavcan/si/unit/volumetric_flow_rate/Scalar_1_0.h deleted file mode 100644 index 19c0998e8..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/si/unit/volumetric_flow_rate/Scalar_1_0.h +++ /dev/null @@ -1,226 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.563267 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.si.unit.volumetric_flow_rate.Scalar -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_SI_UNIT_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ -#define UAVCAN_SI_UNIT_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ - -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/si/unit/volumetric_flow_rate/Scalar.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_FULL_NAME_ "uavcan.si.unit.volumetric_flow_rate.Scalar" -#define uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_FULL_NAME_AND_VERSION_ "uavcan.si.unit.volumetric_flow_rate.Scalar.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_EXTENT_BYTES_ 4UL -#define uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 4UL -static_assert(uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_EXTENT_BYTES_ >= uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 cubic_meter_per_second - float cubic_meter_per_second; -} uavcan_si_unit_volumetric_flow_rate_Scalar_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_serialize_( - const uavcan_si_unit_volumetric_flow_rate_Scalar_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 32UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 cubic_meter_per_second - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->cubic_meter_per_second, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_deserialize_( - uavcan_si_unit_volumetric_flow_rate_Scalar_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 cubic_meter_per_second - out_obj->cubic_meter_per_second = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_initialize_(uavcan_si_unit_volumetric_flow_rate_Scalar_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_si_unit_volumetric_flow_rate_Scalar_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_SI_UNIT_VOLUMETRIC_FLOW_RATE_SCALAR_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/time/GetSynchronizationMasterInfo_0_1.h b/platformio/stima_v4/libraries/include/uavcan/time/GetSynchronizationMasterInfo_0_1.h deleted file mode 100644 index b897d2df2..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/time/GetSynchronizationMasterInfo_0_1.h +++ /dev/null @@ -1,418 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.091986 UTC -// Is deprecated: no -// Fixed port-ID: 510 -// Full name: uavcan.time.GetSynchronizationMasterInfo -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_TIME_GET_SYNCHRONIZATION_MASTER_INFO_0_1_INCLUDED_ -#define UAVCAN_TIME_GET_SYNCHRONIZATION_MASTER_INFO_0_1_INCLUDED_ - -#include -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/510.GetSynchronizationMasterInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_time_GetSynchronizationMasterInfo_0_1_HAS_FIXED_PORT_ID_ true -#define uavcan_time_GetSynchronizationMasterInfo_0_1_FIXED_PORT_ID_ 510U - -#define uavcan_time_GetSynchronizationMasterInfo_0_1_FULL_NAME_ "uavcan.time.GetSynchronizationMasterInfo" -#define uavcan_time_GetSynchronizationMasterInfo_0_1_FULL_NAME_AND_VERSION_ "uavcan.time.GetSynchronizationMasterInfo.0.1" - -#define uavcan_time_GetSynchronizationMasterInfo_Request_0_1_FULL_NAME_ "uavcan.time.GetSynchronizationMasterInfo.Request" -#define uavcan_time_GetSynchronizationMasterInfo_Request_0_1_FULL_NAME_AND_VERSION_ "uavcan.time.GetSynchronizationMasterInfo.Request.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_GetSynchronizationMasterInfo_Request_0_1_EXTENT_BYTES_ 48UL -#define uavcan_time_GetSynchronizationMasterInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 0UL -static_assert(uavcan_time_GetSynchronizationMasterInfo_Request_0_1_EXTENT_BYTES_ >= uavcan_time_GetSynchronizationMasterInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - uint8_t _dummy_; -} uavcan_time_GetSynchronizationMasterInfo_Request_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_GetSynchronizationMasterInfo_Request_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_GetSynchronizationMasterInfo_Request_0_1_serialize_( - const uavcan_time_GetSynchronizationMasterInfo_Request_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_GetSynchronizationMasterInfo_Request_0_1_deserialize_( - uavcan_time_GetSynchronizationMasterInfo_Request_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - *inout_buffer_size_bytes = 0U; - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_GetSynchronizationMasterInfo_Request_0_1_initialize_(uavcan_time_GetSynchronizationMasterInfo_Request_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_GetSynchronizationMasterInfo_Request_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#define uavcan_time_GetSynchronizationMasterInfo_Response_0_1_FULL_NAME_ "uavcan.time.GetSynchronizationMasterInfo.Response" -#define uavcan_time_GetSynchronizationMasterInfo_Response_0_1_FULL_NAME_AND_VERSION_ "uavcan.time.GetSynchronizationMasterInfo.Response.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_GetSynchronizationMasterInfo_Response_0_1_EXTENT_BYTES_ 192UL -#define uavcan_time_GetSynchronizationMasterInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 7UL -static_assert(uavcan_time_GetSynchronizationMasterInfo_Response_0_1_EXTENT_BYTES_ >= uavcan_time_GetSynchronizationMasterInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -typedef struct -{ - /// saturated float32 error_variance - float error_variance; - - /// uavcan.time.TimeSystem.0.1 time_system - uavcan_time_TimeSystem_0_1 time_system; - - /// uavcan.time.TAIInfo.0.1 tai_info - uavcan_time_TAIInfo_0_1 tai_info; -} uavcan_time_GetSynchronizationMasterInfo_Response_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_GetSynchronizationMasterInfo_Response_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_GetSynchronizationMasterInfo_Response_0_1_serialize_( - const uavcan_time_GetSynchronizationMasterInfo_Response_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 56UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated float32 error_variance - // Saturation code not emitted -- assume the native representation of float32 is conformant. - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - static_assert(NUNAVUT_PLATFORM_IEEE754_FLOAT, "Native IEEE754 binary32 required. TODO: relax constraint"); - (void) memmove(&buffer[offset_bits / 8U], &obj->error_variance, 4U); - offset_bits += 32U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - - { // uavcan.time.TimeSystem.0.1 time_system - size_t _size_bytes0_ = 1UL; // Nested object (max) size, in bytes. - int8_t _err1_ = uavcan_time_TimeSystem_0_1_serialize_( - &obj->time_system, &buffer[offset_bits / 8U], &_size_bytes0_); - if (_err1_ < 0) - { - return _err1_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes0_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad1_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err2_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad1_); // Optimize? - if (_err2_ < 0) - { - return _err2_; - } - offset_bits += _pad1_; - } - - { // uavcan.time.TAIInfo.0.1 tai_info - size_t _size_bytes1_ = 2UL; // Nested object (max) size, in bytes. - int8_t _err3_ = uavcan_time_TAIInfo_0_1_serialize_( - &obj->tai_info, &buffer[offset_bits / 8U], &_size_bytes1_); - if (_err3_ < 0) - { - return _err3_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - offset_bits += _size_bytes1_ * 8U; // Advance by the size of the nested object. - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad2_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err4_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad2_); // Optimize? - if (_err4_ < 0) - { - return _err4_; - } - offset_bits += _pad2_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_GetSynchronizationMasterInfo_Response_0_1_deserialize_( - uavcan_time_GetSynchronizationMasterInfo_Response_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated float32 error_variance - out_obj->error_variance = nunavutGetF32(&buffer[0], capacity_bytes, offset_bits); - offset_bits += 32U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.time.TimeSystem.0.1 time_system - { - size_t _size_bytes2_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err5_ = uavcan_time_TimeSystem_0_1_deserialize_( - &out_obj->time_system, &buffer[offset_bits / 8U], &_size_bytes2_); - if (_err5_ < 0) - { - return _err5_; - } - offset_bits += _size_bytes2_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - // uavcan.time.TAIInfo.0.1 tai_info - { - size_t _size_bytes3_ = (size_t)(capacity_bytes - nunavutChooseMin((offset_bits / 8U), capacity_bytes)); - const int8_t _err6_ = uavcan_time_TAIInfo_0_1_deserialize_( - &out_obj->tai_info, &buffer[offset_bits / 8U], &_size_bytes3_); - if (_err6_ < 0) - { - return _err6_; - } - offset_bits += _size_bytes3_ * 8U; // Advance by the size of the nested serialized representation. - } - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_GetSynchronizationMasterInfo_Response_0_1_initialize_(uavcan_time_GetSynchronizationMasterInfo_Response_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_GetSynchronizationMasterInfo_Response_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_TIME_GET_SYNCHRONIZATION_MASTER_INFO_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/time/Synchronization_1_0.h b/platformio/stima_v4/libraries/include/uavcan/time/Synchronization_1_0.h deleted file mode 100644 index a2058a5b1..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/time/Synchronization_1_0.h +++ /dev/null @@ -1,229 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.281022 UTC -// Is deprecated: no -// Fixed port-ID: 7168 -// Full name: uavcan.time.Synchronization -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_TIME_SYNCHRONIZATION_1_0_INCLUDED_ -#define UAVCAN_TIME_SYNCHRONIZATION_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/7168.Synchronization.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -#define uavcan_time_Synchronization_1_0_HAS_FIXED_PORT_ID_ true -#define uavcan_time_Synchronization_1_0_FIXED_PORT_ID_ 7168U - -#define uavcan_time_Synchronization_1_0_FULL_NAME_ "uavcan.time.Synchronization" -#define uavcan_time_Synchronization_1_0_FULL_NAME_AND_VERSION_ "uavcan.time.Synchronization.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_Synchronization_1_0_EXTENT_BYTES_ 7UL -#define uavcan_time_Synchronization_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 7UL -static_assert(uavcan_time_Synchronization_1_0_EXTENT_BYTES_ >= uavcan_time_Synchronization_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 MAX_PUBLICATION_PERIOD = 1 -#define uavcan_time_Synchronization_1_0_MAX_PUBLICATION_PERIOD (1U) -/// saturated uint8 PUBLISHER_TIMEOUT_PERIOD_MULTIPLIER = 3 -#define uavcan_time_Synchronization_1_0_PUBLISHER_TIMEOUT_PERIOD_MULTIPLIER (3U) - -typedef struct -{ - /// truncated uint56 previous_transmission_timestamp_microsecond - uint64_t previous_transmission_timestamp_microsecond; -} uavcan_time_Synchronization_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_Synchronization_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_Synchronization_1_0_serialize_( - const uavcan_time_Synchronization_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 56UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint56 previous_transmission_timestamp_microsecond - (void) memmove(&buffer[offset_bits / 8U], &obj->previous_transmission_timestamp_microsecond, 7U); - offset_bits += 56U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_Synchronization_1_0_deserialize_( - uavcan_time_Synchronization_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint56 previous_transmission_timestamp_microsecond - out_obj->previous_transmission_timestamp_microsecond = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 56); - offset_bits += 56U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_Synchronization_1_0_initialize_(uavcan_time_Synchronization_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_Synchronization_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_TIME_SYNCHRONIZATION_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/time/SynchronizedTimestamp_1_0.h b/platformio/stima_v4/libraries/include/uavcan/time/SynchronizedTimestamp_1_0.h deleted file mode 100644 index 93dd5b85c..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/time/SynchronizedTimestamp_1_0.h +++ /dev/null @@ -1,227 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl -// Generated at: 2023-07-11 16:47:49.296641 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.time.SynchronizedTimestamp -// Version: 1.0 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_TIME_SYNCHRONIZED_TIMESTAMP_1_0_INCLUDED_ -#define UAVCAN_TIME_SYNCHRONIZED_TIMESTAMP_1_0_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/SynchronizedTimestamp.1.0.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_time_SynchronizedTimestamp_1_0_HAS_FIXED_PORT_ID_ false - -#define uavcan_time_SynchronizedTimestamp_1_0_FULL_NAME_ "uavcan.time.SynchronizedTimestamp" -#define uavcan_time_SynchronizedTimestamp_1_0_FULL_NAME_AND_VERSION_ "uavcan.time.SynchronizedTimestamp.1.0" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_SynchronizedTimestamp_1_0_EXTENT_BYTES_ 7UL -#define uavcan_time_SynchronizedTimestamp_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ 7UL -static_assert(uavcan_time_SynchronizedTimestamp_1_0_EXTENT_BYTES_ >= uavcan_time_SynchronizedTimestamp_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint56 UNKNOWN = 0 -#define uavcan_time_SynchronizedTimestamp_1_0_UNKNOWN (0ULL) - -typedef struct -{ - /// truncated uint56 microsecond - uint64_t microsecond; -} uavcan_time_SynchronizedTimestamp_1_0; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_SynchronizedTimestamp_1_0_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_SynchronizedTimestamp_1_0_serialize_( - const uavcan_time_SynchronizedTimestamp_1_0* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 56UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint56 microsecond - (void) memmove(&buffer[offset_bits / 8U], &obj->microsecond, 7U); - offset_bits += 56U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_SynchronizedTimestamp_1_0_deserialize_( - uavcan_time_SynchronizedTimestamp_1_0* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint56 microsecond - out_obj->microsecond = nunavutGetU64(&buffer[0], capacity_bytes, offset_bits, 56); - offset_bits += 56U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_SynchronizedTimestamp_1_0_initialize_(uavcan_time_SynchronizedTimestamp_1_0* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_SynchronizedTimestamp_1_0_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_TIME_SYNCHRONIZED_TIMESTAMP_1_0_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/time/TAIInfo_0_1.h b/platformio/stima_v4/libraries/include/uavcan/time/TAIInfo_0_1.h deleted file mode 100644 index 091453292..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/time/TAIInfo_0_1.h +++ /dev/null @@ -1,234 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.296641 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.time.TAIInfo -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_TIME_TAI_INFO_0_1_INCLUDED_ -#define UAVCAN_TIME_TAI_INFO_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TAIInfo.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_time_TAIInfo_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_time_TAIInfo_0_1_FULL_NAME_ "uavcan.time.TAIInfo" -#define uavcan_time_TAIInfo_0_1_FULL_NAME_AND_VERSION_ "uavcan.time.TAIInfo.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_TAIInfo_0_1_EXTENT_BYTES_ 2UL -#define uavcan_time_TAIInfo_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 2UL -static_assert(uavcan_time_TAIInfo_0_1_EXTENT_BYTES_ >= uavcan_time_TAIInfo_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint8 DIFFERENCE_TAI_MINUS_GPS = 19 -#define uavcan_time_TAIInfo_0_1_DIFFERENCE_TAI_MINUS_GPS (19U) -/// saturated uint10 DIFFERENCE_TAI_MINUS_UTC_UNKNOWN = 0 -#define uavcan_time_TAIInfo_0_1_DIFFERENCE_TAI_MINUS_UTC_UNKNOWN (0U) - -typedef struct -{ - /// saturated uint10 difference_tai_minus_utc - uint16_t difference_tai_minus_utc; -} uavcan_time_TAIInfo_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_TAIInfo_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_TAIInfo_0_1_serialize_( - const uavcan_time_TAIInfo_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 16UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // saturated uint10 difference_tai_minus_utc - uint16_t _sat0_ = obj->difference_tai_minus_utc; - if (_sat0_ > 1023U) - { - _sat0_ = 1023U; - } - (void) memmove(&buffer[offset_bits / 8U], &_sat0_, 2U); - offset_bits += 10U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_TAIInfo_0_1_deserialize_( - uavcan_time_TAIInfo_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // saturated uint10 difference_tai_minus_utc - out_obj->difference_tai_minus_utc = nunavutGetU16(&buffer[0], capacity_bytes, offset_bits, 10); - offset_bits += 10U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_TAIInfo_0_1_initialize_(uavcan_time_TAIInfo_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_TAIInfo_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_TIME_TAI_INFO_0_1_INCLUDED_ diff --git a/platformio/stima_v4/libraries/include/uavcan/time/TimeSystem_0_1.h b/platformio/stima_v4/libraries/include/uavcan/time/TimeSystem_0_1.h deleted file mode 100644 index 5bc696e5d..000000000 --- a/platformio/stima_v4/libraries/include/uavcan/time/TimeSystem_0_1.h +++ /dev/null @@ -1,238 +0,0 @@ -// This is an AUTO-GENERATED UAVCAN DSDL data type implementation. Curious? See https://opencyphal.org. -// You shouldn't attempt to edit this file. -// -// Checking this file under version control is not recommended unless it is used as part of a high-SIL -// safety-critical codebase. The typical usage scenario is to generate it as part of the build process. -// -// To avoid conflicts with definitions given in the source DSDL file, all entities created by the code generator -// are named with an underscore at the end, like foo_bar_(). -// -// Generator: nunavut-1.8.3 (serialization was enabled) -// Source file: C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl -// Generated at: 2023-07-11 16:47:49.296641 UTC -// Is deprecated: no -// Fixed port-ID: None -// Full name: uavcan.time.TimeSystem -// Version: 0.1 -// -// Platform -// python_implementation: CPython -// python_version: 3.10.5 -// python_release_level: final -// python_build: ('tags/v3.10.5:f377153', 'Jun 6 2022 16:14:13') -// python_compiler: MSC v.1929 64 bit (AMD64) -// python_revision: f377153 -// python_xoptions: {} -// runtime_platform: Windows-10-10.0.22621-SP0 -// -// Language Options -// target_endianness: little -// omit_float_serialization_support: False -// enable_serialization_asserts: False -// enable_override_variable_array_capacity: False -// cast_format: (({type}) {value}) - -#ifndef UAVCAN_TIME_TIME_SYSTEM_0_1_INCLUDED_ -#define UAVCAN_TIME_TIME_SYSTEM_0_1_INCLUDED_ - -#include -#include -#include - -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_TARGET_ENDIANNESS == 434322821, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_OMIT_FLOAT_SERIALIZATION_SUPPORT == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_SERIALIZATION_ASSERTS == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_ENABLE_OVERRIDE_VARIABLE_ARRAY_CAPACITY == 0, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); -static_assert( NUNAVUT_SUPPORT_LANGUAGE_OPTION_CAST_FORMAT == 2368206204, - "C:/Dati/rmap_orig/rmap/platformio/stima_v4/libraries/data_types/uavcan/time/TimeSystem.0.1.dsdl is trying to use a serialization library that was compiled with " - "different language options. This is dangerous and therefore not allowed." ); - -#ifdef __cplusplus -extern "C" { -#endif - -/// This type does not have a fixed port-ID. See https://forum.opencyphal.org/t/choosing-message-and-service-ids/889 -#define uavcan_time_TimeSystem_0_1_HAS_FIXED_PORT_ID_ false - -#define uavcan_time_TimeSystem_0_1_FULL_NAME_ "uavcan.time.TimeSystem" -#define uavcan_time_TimeSystem_0_1_FULL_NAME_AND_VERSION_ "uavcan.time.TimeSystem.0.1" - -/// Extent is the minimum amount of memory required to hold any serialized representation of any compatible -/// version of the data type; or, on other words, it is the the maximum possible size of received objects of this type. -/// The size is specified in bytes (rather than bits) because by definition, extent is an integer number of bytes long. -/// When allocating a deserialization (RX) buffer for this data type, it should be at least extent bytes large. -/// When allocating a serialization (TX) buffer, it is safe to use the size of the largest serialized representation -/// instead of the extent because it provides a tighter bound of the object size; it is safe because the concrete type -/// is always known during serialization (unlike deserialization). If not sure, use extent everywhere. -#define uavcan_time_TimeSystem_0_1_EXTENT_BYTES_ 1UL -#define uavcan_time_TimeSystem_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ 1UL -static_assert(uavcan_time_TimeSystem_0_1_EXTENT_BYTES_ >= uavcan_time_TimeSystem_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_, - "Internal constraint violation"); - -/// saturated uint4 MONOTONIC_SINCE_BOOT = 0 -#define uavcan_time_TimeSystem_0_1_MONOTONIC_SINCE_BOOT (0U) -/// saturated uint4 TAI = 1 -#define uavcan_time_TimeSystem_0_1_TAI (1U) -/// saturated uint4 APPLICATION_SPECIFIC = 15 -#define uavcan_time_TimeSystem_0_1_APPLICATION_SPECIFIC (15U) - -typedef struct -{ - /// truncated uint4 value - uint8_t value; -} uavcan_time_TimeSystem_0_1; - -/// Serialize an instance into the provided buffer. -/// The lifetime of the resulting serialized representation is independent of the original instance. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original object where possible. -/// -/// @param obj The object to serialize. -/// -/// @param buffer The destination buffer. There are no alignment requirements. -/// @see uavcan_time_TimeSystem_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_ -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the buffer in bytes. -/// Upon return this value will be updated with the size of the constructed serialized -/// representation (in bytes); this value is then to be passed over to the transport -/// layer. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_TimeSystem_0_1_serialize_( - const uavcan_time_TimeSystem_0_1* const obj, uint8_t* const buffer, size_t* const inout_buffer_size_bytes) -{ - if ((obj == NULL) || (buffer == NULL) || (inout_buffer_size_bytes == NULL)) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - if ((8U * (size_t) capacity_bytes) < 8UL) - { - return -NUNAVUT_ERROR_SERIALIZATION_BUFFER_TOO_SMALL; - } - // Notice that fields that are not an integer number of bytes long may overrun the space allocated for them - // in the serialization buffer up to the next byte boundary. This is by design and is guaranteed to be safe. - size_t offset_bits = 0U; - - - - - - { // truncated uint4 value - buffer[offset_bits / 8U] = (uint8_t)(obj->value); // C std, 6.3.1.3 Signed and unsigned integers - offset_bits += 4U; - } - - - if (offset_bits % 8U != 0U) // Pad to 8 bits. TODO: Eliminate redundant padding checks. - { - const uint8_t _pad0_ = (uint8_t)(8U - offset_bits % 8U); - const int8_t _err0_ = nunavutSetUxx(&buffer[0], capacity_bytes, offset_bits, 0U, _pad0_); // Optimize? - if (_err0_ < 0) - { - return _err0_; - } - offset_bits += _pad0_; - } - // It is assumed that we know the exact type of the serialized entity, hence we expect the size to match. - - - - - *inout_buffer_size_bytes = (size_t) (offset_bits / 8U); - - return NUNAVUT_SUCCESS; -} - -/// Deserialize an instance from the provided buffer. -/// The lifetime of the resulting object is independent of the original buffer. -/// This method may be slow for large objects (e.g., images, point clouds, radar samples), so in a later revision -/// we may define a zero-copy alternative that keeps references to the original buffer where possible. -/// -/// @param obj The object to update from the provided serialized representation. -/// -/// @param buffer The source buffer containing the serialized representation. There are no alignment requirements. -/// If the buffer is shorter or longer than expected, it will be implicitly zero-extended or truncated, -/// respectively; see Specification for "implicit zero extension" and "implicit truncation" rules. -/// -/// @param inout_buffer_size_bytes When calling, this is a pointer to the size of the supplied serialized -/// representation, in bytes. Upon return this value will be updated with the -/// size of the consumed fragment of the serialized representation (in bytes), -/// which may be smaller due to the implicit truncation rule, but it is guaranteed -/// to never exceed the original buffer size even if the implicit zero extension rule -/// was activated. In case of error this value is undefined. -/// -/// @returns Negative on error, zero on success. -static inline int8_t uavcan_time_TimeSystem_0_1_deserialize_( - uavcan_time_TimeSystem_0_1* const out_obj, const uint8_t* buffer, size_t* const inout_buffer_size_bytes) -{ - if ((out_obj == NULL) || (inout_buffer_size_bytes == NULL) || ((buffer == NULL) && (0 != *inout_buffer_size_bytes))) - { - return -NUNAVUT_ERROR_INVALID_ARGUMENT; - } - if (buffer == NULL) - { - buffer = (const uint8_t*)""; - } - - - const size_t capacity_bytes = *inout_buffer_size_bytes; - const size_t capacity_bits = capacity_bytes * (size_t) 8U; - size_t offset_bits = 0U; - - - - - - // truncated uint4 value - if ((offset_bits + 4U) <= capacity_bits) - { - out_obj->value = buffer[offset_bits / 8U] & 15U; - } - else - { - out_obj->value = 0U; - } - offset_bits += 4U; - - - offset_bits = (offset_bits + 7U) & ~(size_t) 7U; // Align on 8 bits. - - *inout_buffer_size_bytes = (size_t) (nunavutChooseMin(offset_bits, capacity_bits) / 8U); - - - return NUNAVUT_SUCCESS; -} - -/// Initialize an instance to default values. Does nothing if @param out_obj is NULL. -/// This function intentionally leaves inactive elements uninitialized; for example, members of a variable-length -/// array beyond its length are left uninitialized; aliased union memory that is not used by the first union field -/// is left uninitialized, etc. If full zero-initialization is desired, just use memset(&obj, 0, sizeof(obj)). -static inline void uavcan_time_TimeSystem_0_1_initialize_(uavcan_time_TimeSystem_0_1* const out_obj) -{ - if (out_obj != NULL) - { - size_t size_bytes = 0; - const uint8_t buf = 0; - const int8_t err = uavcan_time_TimeSystem_0_1_deserialize_(out_obj, &buf, &size_bytes); - - (void) err; - } -} - - - -#ifdef __cplusplus -} -#endif -#endif // UAVCAN_TIME_TIME_SYSTEM_0_1_INCLUDED_ diff --git a/platformio/stima_v4/master/include/canard_class_master.hpp b/platformio/stima_v4/master/include/canard_class_master.hpp index 81e649c91..0395b1f4a 100644 --- a/platformio/stima_v4/master/include/canard_class_master.hpp +++ b/platformio/stima_v4/master/include/canard_class_master.hpp @@ -49,16 +49,16 @@ // Namespace RMAP #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #ifndef _CANARD_CLASS_H #define _CANARD_CLASS_H @@ -616,4 +616,4 @@ class canardClass { uint8_t _rxSubscriptionIdx; }; -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/master/include/tasks/mqtt_task.h b/platformio/stima_v4/master/include/tasks/mqtt_task.h index 203c85867..d72b467e8 100644 --- a/platformio/stima_v4/master/include/tasks/mqtt_task.h +++ b/platformio/stima_v4/master/include/tasks/mqtt_task.h @@ -72,16 +72,16 @@ // Canard Type data #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include +#include #if (MODULE_TYPE == STIMA_MODULE_TYPE_MASTER_ETH) // #include "drivers/spi/arduino_spi_driver.h" @@ -268,4 +268,4 @@ class MqttTask : public cpp_freertos::Thread { }; #endif -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/master/platformio.ini b/platformio/stima_v4/master/platformio.ini index cce6d1fcf..a1fe6934b 100644 --- a/platformio/stima_v4/master/platformio.ini +++ b/platformio/stima_v4/master/platformio.ini @@ -20,6 +20,9 @@ lib_ldf_mode = deep lib_archive = no monitor_speed = 115200 board_build.variants_dir = ../../custom_variants +extra_scripts = + pre:../cyphal/nnvg_piovenv_compile.py + [env:stimav4_master] board = stimav4_master @@ -54,5 +57,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 diff --git a/platformio/stima_v4/slave-mppt/include/canard_class_mppt.hpp b/platformio/stima_v4/slave-mppt/include/canard_class_mppt.hpp index f3c223667..4db6e443c 100644 --- a/platformio/stima_v4/slave-mppt/include/canard_class_mppt.hpp +++ b/platformio/stima_v4/slave-mppt/include/canard_class_mppt.hpp @@ -46,8 +46,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include #ifndef _CANARD_CLASS_H #define _CANARD_CLASS_H @@ -419,4 +419,4 @@ class canardClass { uint8_t _rxSubscriptionIdx; }; -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/slave-mppt/include/tasks/can_task.h b/platformio/stima_v4/slave-mppt/include/tasks/can_task.h index fec3d4d24..2934c4dd3 100644 --- a/platformio/stima_v4/slave-mppt/include/tasks/can_task.h +++ b/platformio/stima_v4/slave-mppt/include/tasks/can_task.h @@ -70,8 +70,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include // Standard Library #include #include diff --git a/platformio/stima_v4/slave-mppt/platformio.ini b/platformio/stima_v4/slave-mppt/platformio.ini index 8d6150474..07b8393df 100644 --- a/platformio/stima_v4/slave-mppt/platformio.ini +++ b/platformio/stima_v4/slave-mppt/platformio.ini @@ -46,5 +46,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file diff --git a/platformio/stima_v4/slave-radiation/include/canard_class_solar_radiation.hpp b/platformio/stima_v4/slave-radiation/include/canard_class_solar_radiation.hpp index b440c1439..0142aee33 100644 --- a/platformio/stima_v4/slave-radiation/include/canard_class_solar_radiation.hpp +++ b/platformio/stima_v4/slave-radiation/include/canard_class_solar_radiation.hpp @@ -46,8 +46,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include #ifndef _CANARD_CLASS_H #define _CANARD_CLASS_H @@ -419,4 +419,4 @@ class canardClass { uint8_t _rxSubscriptionIdx; }; -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/slave-radiation/include/tasks/can_task.h b/platformio/stima_v4/slave-radiation/include/tasks/can_task.h index 0e173cb47..153ea9a70 100644 --- a/platformio/stima_v4/slave-radiation/include/tasks/can_task.h +++ b/platformio/stima_v4/slave-radiation/include/tasks/can_task.h @@ -70,8 +70,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include // Standard Library #include #include diff --git a/platformio/stima_v4/slave-radiation/platformio.ini b/platformio/stima_v4/slave-radiation/platformio.ini index a2ab66753..dfe89172b 100644 --- a/platformio/stima_v4/slave-radiation/platformio.ini +++ b/platformio/stima_v4/slave-radiation/platformio.ini @@ -46,5 +46,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file diff --git a/platformio/stima_v4/slave-rain/include/canard_class_rain.hpp b/platformio/stima_v4/slave-rain/include/canard_class_rain.hpp index 64cd16d4a..59d972af9 100644 --- a/platformio/stima_v4/slave-rain/include/canard_class_rain.hpp +++ b/platformio/stima_v4/slave-rain/include/canard_class_rain.hpp @@ -46,8 +46,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include #ifndef _CANARD_CLASS_H #define _CANARD_CLASS_H @@ -422,4 +422,4 @@ class canardClass { uint8_t _rxSubscriptionIdx; }; -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/slave-rain/include/tasks/can_task.h b/platformio/stima_v4/slave-rain/include/tasks/can_task.h index bd55fb4da..fdcb1732f 100644 --- a/platformio/stima_v4/slave-rain/include/tasks/can_task.h +++ b/platformio/stima_v4/slave-rain/include/tasks/can_task.h @@ -70,8 +70,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include // Standard Library #include #include diff --git a/platformio/stima_v4/slave-rain/platformio.ini b/platformio/stima_v4/slave-rain/platformio.ini index 8d6150474..07b8393df 100644 --- a/platformio/stima_v4/slave-rain/platformio.ini +++ b/platformio/stima_v4/slave-rain/platformio.ini @@ -46,5 +46,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file diff --git a/platformio/stima_v4/slave-th/platformio.ini b/platformio/stima_v4/slave-th/platformio.ini index 9a891558a..60eed2679 100644 --- a/platformio/stima_v4/slave-th/platformio.ini +++ b/platformio/stima_v4/slave-th/platformio.ini @@ -45,5 +45,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file diff --git a/platformio/stima_v4/slave-vwc/platformio.ini b/platformio/stima_v4/slave-vwc/platformio.ini index a2ab66753..dfe89172b 100644 --- a/platformio/stima_v4/slave-vwc/platformio.ini +++ b/platformio/stima_v4/slave-vwc/platformio.ini @@ -46,5 +46,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file diff --git a/platformio/stima_v4/slave-wind/include/canard_class_wind.hpp b/platformio/stima_v4/slave-wind/include/canard_class_wind.hpp index 110e6adaf..7ccb55904 100644 --- a/platformio/stima_v4/slave-wind/include/canard_class_wind.hpp +++ b/platformio/stima_v4/slave-wind/include/canard_class_wind.hpp @@ -46,8 +46,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include #ifndef _CANARD_CLASS_H #define _CANARD_CLASS_H @@ -424,4 +424,4 @@ class canardClass { uint8_t _rxSubscriptionIdx; }; -#endif \ No newline at end of file +#endif diff --git a/platformio/stima_v4/slave-wind/include/tasks/can_task.h b/platformio/stima_v4/slave-wind/include/tasks/can_task.h index bec49c505..0d71bcc33 100644 --- a/platformio/stima_v4/slave-wind/include/tasks/can_task.h +++ b/platformio/stima_v4/slave-wind/include/tasks/can_task.h @@ -70,8 +70,8 @@ #include #include // Namespace RMAP -#include -#include +#include +#include // Standard Library #include #include diff --git a/platformio/stima_v4/slave-wind/platformio.ini b/platformio/stima_v4/slave-wind/platformio.ini index eb5b69ece..db8359cfb 100644 --- a/platformio/stima_v4/slave-wind/platformio.ini +++ b/platformio/stima_v4/slave-wind/platformio.ini @@ -47,5 +47,6 @@ build_flags = -DUSE_HAL_DRIVER=1 -DBXCAN_MAX_IFACE_INDEX=0 -w + -I ../cyphal/include -I include -std=c++11 \ No newline at end of file