uavcan.protocol.enumeration.Begin_res.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <canard.h>
  5. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_MAX_SIZE 1
  6. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_SIGNATURE (0x196AE06426A3B5D8ULL)
  7. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ID 15
  8. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ERROR_OK 0
  9. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ERROR_INVALID_MODE 1
  10. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ERROR_INVALID_PARAMETER 2
  11. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ERROR_UNSUPPORTED 3
  12. #define UAVCAN_PROTOCOL_ENUMERATION_BEGIN_RESPONSE_ERROR_UNKNOWN 255
  13. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  14. class uavcan_protocol_enumeration_Begin_cxx_iface;
  15. #endif
  16. struct uavcan_protocol_enumeration_BeginResponse {
  17. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  18. using cxx_iface = uavcan_protocol_enumeration_Begin_cxx_iface;
  19. #endif
  20. uint8_t error;
  21. };
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. uint32_t _uavcan_protocol_enumeration_BeginResponse_encode(struct uavcan_protocol_enumeration_BeginResponse* msg, uint8_t* buffer
  27. #if CANARD_ENABLE_TAO_OPTION
  28. , bool tao
  29. #endif
  30. );
  31. bool _uavcan_protocol_enumeration_BeginResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_enumeration_BeginResponse* msg);
  32. static inline uint32_t uavcan_protocol_enumeration_BeginResponse_encode(struct uavcan_protocol_enumeration_BeginResponse* msg, uint8_t* buffer
  33. #if CANARD_ENABLE_TAO_OPTION
  34. , bool tao
  35. #endif
  36. ) {
  37. return _uavcan_protocol_enumeration_BeginResponse_encode(msg, buffer
  38. #if CANARD_ENABLE_TAO_OPTION
  39. , tao
  40. #endif
  41. );
  42. }
  43. static inline bool uavcan_protocol_enumeration_BeginResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_enumeration_BeginResponse* msg) {
  44. return _uavcan_protocol_enumeration_BeginResponse_decode(transfer, msg);
  45. }
  46. #if defined(CANARD_DSDLC_INTERNAL)
  47. static inline void __uavcan_protocol_enumeration_BeginResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_enumeration_BeginResponse* msg, bool tao);
  48. static inline bool __uavcan_protocol_enumeration_BeginResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_enumeration_BeginResponse* msg, bool tao);
  49. void __uavcan_protocol_enumeration_BeginResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_enumeration_BeginResponse* msg, bool tao) {
  50. (void)buffer;
  51. (void)bit_ofs;
  52. (void)msg;
  53. (void)tao;
  54. canardEncodeScalar(buffer, *bit_ofs, 8, &msg->error);
  55. *bit_ofs += 8;
  56. }
  57. /*
  58. decode uavcan_protocol_enumeration_BeginResponse, return true on failure, false on success
  59. */
  60. bool __uavcan_protocol_enumeration_BeginResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_enumeration_BeginResponse* msg, bool tao) {
  61. (void)transfer;
  62. (void)bit_ofs;
  63. (void)msg;
  64. (void)tao;
  65. canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->error);
  66. *bit_ofs += 8;
  67. return false; /* success */
  68. }
  69. #endif
  70. #ifdef CANARD_DSDLC_TEST_BUILD
  71. struct uavcan_protocol_enumeration_BeginResponse sample_uavcan_protocol_enumeration_BeginResponse_msg(void);
  72. #endif
  73. #ifdef __cplusplus
  74. } // extern "C"
  75. #ifdef DRONECAN_CXX_WRAPPERS
  76. #include <canard/cxx_wrappers.h>
  77. #endif
  78. #endif