diff --git a/src/ArduinoUAVCANTypes.h b/src/ArduinoUAVCANTypes.h index 277d8a50..4e3e3c8b 100644 --- a/src/ArduinoUAVCANTypes.h +++ b/src/ArduinoUAVCANTypes.h @@ -12,6 +12,9 @@ * INCLUDE **************************************************************************************/ +#include "types/reg/drone/physics/electricity/Power_0_1.hpp" +#include "types/reg/drone/physics/electricity/PowerTs_0_1.hpp" +#include "types/reg/drone/physics/electricity/Source_0_1.hpp" #include "types/reg/drone/physics/electricity/SourceTs_0_1.hpp" #include "types/reg/drone/service/battery/Parameters_0_1.hpp" diff --git a/src/types/reg/drone/physics/electricity/PowerTs_0_1.hpp b/src/types/reg/drone/physics/electricity/PowerTs_0_1.hpp new file mode 100644 index 00000000..d1848bd8 --- /dev/null +++ b/src/types/reg/drone/physics/electricity/PowerTs_0_1.hpp @@ -0,0 +1,79 @@ +/** + * This software is distributed under the terms of the MIT License. + * Copyright (c) 2020 LXRobotics. + * Author: Alexander Entinger + * Contributors: https://github.com/107-systems/107-Arduino-UAVCAN/graphs/contributors. + */ + +#ifndef ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWERTS_0_1_H_ +#define ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWERTS_0_1_H_ + +/************************************************************************************** + * INCLUDE + **************************************************************************************/ + +#include + +#include "PowerTs_0_1.h" + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace physics { +namespace electricity { + +/************************************************************************************** + * CLASS DECLARATION + **************************************************************************************/ + +template +class PowerTs_0_1 +{ + +public: + + reg_drone_physics_electricity_PowerTs_0_1 data; + + static constexpr CanardPortID PORT_ID = ID; + static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_physics_electricity_PowerTs_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; + static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; + + + PowerTs_0_1() + { + reg_drone_physics_electricity_PowerTs_0_1_initialize_(&data); + } + + PowerTs_0_1(PowerTs_0_1 const & other) + { + memcpy(&data, &other.data, sizeof(data)); + } + + static PowerTs_0_1 deserialize(CanardTransfer const & transfer) + { + PowerTs_0_1 b; + size_t inout_buffer_size_bytes = transfer.payload_size; + reg_drone_physics_electricity_PowerTs_0_1_deserialize_(&b.data, (uint8_t *)(transfer.payload), &inout_buffer_size_bytes); + return b; + } + + size_t serialize(uint8_t * payload) const + { + size_t inout_buffer_size_bytes = PowerTs_0_1::MAX_PAYLOAD_SIZE; + return (reg_drone_physics_electricity_PowerTs_0_1_serialize_(&data, payload, &inout_buffer_size_bytes) < NUNAVUT_SUCCESS) ? 0 : inout_buffer_size_bytes; + } +}; + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* physics */ +} /* electricity */ + +#endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWERTS_0_1_H_ */ diff --git a/src/types/reg/drone/physics/electricity/Power_0_1.hpp b/src/types/reg/drone/physics/electricity/Power_0_1.hpp new file mode 100644 index 00000000..9cd5c8ce --- /dev/null +++ b/src/types/reg/drone/physics/electricity/Power_0_1.hpp @@ -0,0 +1,79 @@ +/** + * This software is distributed under the terms of the MIT License. + * Copyright (c) 2020 LXRobotics. + * Author: Alexander Entinger + * Contributors: https://github.com/107-systems/107-Arduino-UAVCAN/graphs/contributors. + */ + +#ifndef ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWER_0_1_H_ +#define ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWER_0_1_H_ + +/************************************************************************************** + * INCLUDE + **************************************************************************************/ + +#include + +#include "Power_0_1.h" + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace physics { +namespace electricity { + +/************************************************************************************** + * CLASS DECLARATION + **************************************************************************************/ + +template +class Power_0_1 +{ + +public: + + reg_drone_physics_electricity_Power_0_1 data; + + static constexpr CanardPortID PORT_ID = ID; + static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_physics_electricity_Power_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; + static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; + + + Power_0_1() + { + reg_drone_physics_electricity_Power_0_1_initialize_(&data); + } + + Power_0_1(Power_0_1 const & other) + { + memcpy(&data, &other.data, sizeof(data)); + } + + static Power_0_1 deserialize(CanardTransfer const & transfer) + { + Power_0_1 b; + size_t inout_buffer_size_bytes = transfer.payload_size; + reg_drone_physics_electricity_Power_0_1_deserialize_(&b.data, (uint8_t *)(transfer.payload), &inout_buffer_size_bytes); + return b; + } + + size_t serialize(uint8_t * payload) const + { + size_t inout_buffer_size_bytes = Power_0_1::MAX_PAYLOAD_SIZE; + return (reg_drone_physics_electricity_Power_0_1_serialize_(&data, payload, &inout_buffer_size_bytes) < NUNAVUT_SUCCESS) ? 0 : inout_buffer_size_bytes; + } +}; + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* physics */ +} /* electricity */ + +#endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_POWER_0_1_H_ */ diff --git a/src/types/reg/drone/physics/electricity/SourceTs_0_1.hpp b/src/types/reg/drone/physics/electricity/SourceTs_0_1.hpp index e71cc5bf..5152548e 100644 --- a/src/types/reg/drone/physics/electricity/SourceTs_0_1.hpp +++ b/src/types/reg/drone/physics/electricity/SourceTs_0_1.hpp @@ -16,6 +16,15 @@ #include "SourceTs_0_1.h" +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace physics { +namespace electricity { + /************************************************************************************** * CLASS DECLARATION **************************************************************************************/ @@ -32,7 +41,7 @@ class SourceTs_0_1 static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_physics_electricity_SourceTs_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; - + SourceTs_0_1() { reg_drone_physics_electricity_SourceTs_0_1_initialize_(&data); @@ -58,4 +67,13 @@ class SourceTs_0_1 } }; +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* physics */ +} /* electricity */ + #endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_SOURCETS_0_1_H_ */ diff --git a/src/types/reg/drone/physics/electricity/Source_0_1.hpp b/src/types/reg/drone/physics/electricity/Source_0_1.hpp new file mode 100644 index 00000000..bb01a2cc --- /dev/null +++ b/src/types/reg/drone/physics/electricity/Source_0_1.hpp @@ -0,0 +1,79 @@ +/** + * This software is distributed under the terms of the MIT License. + * Copyright (c) 2020 LXRobotics. + * Author: Alexander Entinger + * Contributors: https://github.com/107-systems/107-Arduino-UAVCAN/graphs/contributors. + */ + +#ifndef ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_SOURCE_0_1_H_ +#define ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_SOURCE_0_1_H_ + +/************************************************************************************** + * INCLUDE + **************************************************************************************/ + +#include + +#include "Source_0_1.h" + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace physics { +namespace electricity { + +/************************************************************************************** + * CLASS DECLARATION + **************************************************************************************/ + +template +class Source_0_1 +{ + +public: + + reg_drone_physics_electricity_Source_0_1 data; + + static constexpr CanardPortID PORT_ID = ID; + static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_physics_electricity_Source_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; + static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; + + + Source_0_1() + { + reg_drone_physics_electricity_Source_0_1_initialize_(&data); + } + + Source_0_1(Source_0_1 const & other) + { + memcpy(&data, &other.data, sizeof(data)); + } + + static Source_0_1 deserialize(CanardTransfer const & transfer) + { + Source_0_1 b; + size_t inout_buffer_size_bytes = transfer.payload_size; + reg_drone_physics_electricity_Source_0_1_deserialize_(&b.data, (uint8_t *)(transfer.payload), &inout_buffer_size_bytes); + return b; + } + + size_t serialize(uint8_t * payload) const + { + size_t inout_buffer_size_bytes = Source_0_1::MAX_PAYLOAD_SIZE; + return (reg_drone_physics_electricity_Source_0_1_serialize_(&data, payload, &inout_buffer_size_bytes) < NUNAVUT_SUCCESS) ? 0 : inout_buffer_size_bytes; + } +}; + +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* physics */ +} /* electricity */ + +#endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_PHYSICS_ELECTRICITY_SOURCE_0_1_H_ */ diff --git a/src/types/reg/drone/service/battery/Parameters_0_1.h b/src/types/reg/drone/service/battery/Parameters_0_1.h index 307fa2bd..2def4a71 100644 --- a/src/types/reg/drone/service/battery/Parameters_0_1.h +++ b/src/types/reg/drone/service/battery/Parameters_0_1.h @@ -862,4 +862,3 @@ static inline void reg_drone_service_battery_Parameters_0_1_initialize_(reg_dron } #endif #endif // REG_DRONE_SERVICE_BATTERY_PARAMETERS_0_1_INCLUDED_ - diff --git a/src/types/reg/drone/service/battery/Parameters_0_1.hpp b/src/types/reg/drone/service/battery/Parameters_0_1.hpp index b7f34bd6..06cf0505 100644 --- a/src/types/reg/drone/service/battery/Parameters_0_1.hpp +++ b/src/types/reg/drone/service/battery/Parameters_0_1.hpp @@ -16,6 +16,15 @@ #include "Parameters_0_1.h" +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace service { +namespace battery { + /************************************************************************************** * CLASS DECLARATION **************************************************************************************/ @@ -32,7 +41,7 @@ class Parameters_0_1 static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_service_battery_Parameters_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; - + Parameters_0_1() { reg_drone_service_battery_Parameters_0_1_initialize_(&data); @@ -58,4 +67,13 @@ class Parameters_0_1 } }; +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* service */ +} /* battery */ + #endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_SERVICE_BATTERY_PARAMETERS_0_1_HPP_ */ diff --git a/src/types/reg/drone/service/battery/Status_0_1.h b/src/types/reg/drone/service/battery/Status_0_1.h index 7265ea55..71d03b04 100644 --- a/src/types/reg/drone/service/battery/Status_0_1.h +++ b/src/types/reg/drone/service/battery/Status_0_1.h @@ -520,4 +520,3 @@ static inline void reg_drone_service_battery_Status_0_1_initialize_(reg_drone_se } #endif #endif // REG_DRONE_SERVICE_BATTERY_STATUS_0_1_INCLUDED_ - diff --git a/src/types/reg/drone/service/battery/Status_0_1.hpp b/src/types/reg/drone/service/battery/Status_0_1.hpp index 8c6eb442..26f51df6 100644 --- a/src/types/reg/drone/service/battery/Status_0_1.hpp +++ b/src/types/reg/drone/service/battery/Status_0_1.hpp @@ -16,6 +16,15 @@ #include "Status_0_1.h" +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +namespace reg { +namespace drone { +namespace service { +namespace battery { + /************************************************************************************** * CLASS DECLARATION **************************************************************************************/ @@ -32,7 +41,7 @@ class Status_0_1 static constexpr size_t MAX_PAYLOAD_SIZE = reg_drone_service_battery_Status_0_1_SERIALIZATION_BUFFER_SIZE_BYTES_; static constexpr CanardTransferKind TRANSFER_KIND = CanardTransferKindMessage; - + Status_0_1() { reg_drone_service_battery_Status_0_1_initialize_(&data); @@ -58,4 +67,13 @@ class Status_0_1 } }; +/************************************************************************************** + * NAMESPACE + **************************************************************************************/ + +} /* reg */ +} /* drone */ +} /* service */ +} /* battery */ + #endif /* ARDUINO_UAVCAN_TYPES_REG_DRONE_SERVICE_BATTERY_STATUS_0_1_HPP_ */