uavcan.protocol.file.GetInfo_res.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <canard.h>
  5. #include <uavcan.protocol.file.EntryType.h>
  6. #include <uavcan.protocol.file.Error.h>
  7. #define UAVCAN_PROTOCOL_FILE_GETINFO_RESPONSE_MAX_SIZE 8
  8. #define UAVCAN_PROTOCOL_FILE_GETINFO_RESPONSE_SIGNATURE (0x5004891EE8A27531ULL)
  9. #define UAVCAN_PROTOCOL_FILE_GETINFO_RESPONSE_ID 45
  10. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  11. class uavcan_protocol_file_GetInfo_cxx_iface;
  12. #endif
  13. struct uavcan_protocol_file_GetInfoResponse {
  14. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  15. using cxx_iface = uavcan_protocol_file_GetInfo_cxx_iface;
  16. #endif
  17. uint64_t size;
  18. struct uavcan_protocol_file_Error error;
  19. struct uavcan_protocol_file_EntryType entry_type;
  20. };
  21. #ifdef __cplusplus
  22. extern "C"
  23. {
  24. #endif
  25. uint32_t _uavcan_protocol_file_GetInfoResponse_encode(struct uavcan_protocol_file_GetInfoResponse* msg, uint8_t* buffer
  26. #if CANARD_ENABLE_TAO_OPTION
  27. , bool tao
  28. #endif
  29. );
  30. bool _uavcan_protocol_file_GetInfoResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_file_GetInfoResponse* msg);
  31. static inline uint32_t uavcan_protocol_file_GetInfoResponse_encode(struct uavcan_protocol_file_GetInfoResponse* msg, uint8_t* buffer
  32. #if CANARD_ENABLE_TAO_OPTION
  33. , bool tao
  34. #endif
  35. ) {
  36. return _uavcan_protocol_file_GetInfoResponse_encode(msg, buffer
  37. #if CANARD_ENABLE_TAO_OPTION
  38. , tao
  39. #endif
  40. );
  41. }
  42. static inline bool uavcan_protocol_file_GetInfoResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_file_GetInfoResponse* msg) {
  43. return _uavcan_protocol_file_GetInfoResponse_decode(transfer, msg);
  44. }
  45. #if defined(CANARD_DSDLC_INTERNAL)
  46. static inline void __uavcan_protocol_file_GetInfoResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_file_GetInfoResponse* msg, bool tao);
  47. static inline bool __uavcan_protocol_file_GetInfoResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_file_GetInfoResponse* msg, bool tao);
  48. void __uavcan_protocol_file_GetInfoResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_file_GetInfoResponse* msg, bool tao) {
  49. (void)buffer;
  50. (void)bit_ofs;
  51. (void)msg;
  52. (void)tao;
  53. canardEncodeScalar(buffer, *bit_ofs, 40, &msg->size);
  54. *bit_ofs += 40;
  55. __uavcan_protocol_file_Error_encode(buffer, bit_ofs, &msg->error, false);
  56. __uavcan_protocol_file_EntryType_encode(buffer, bit_ofs, &msg->entry_type, tao);
  57. }
  58. /*
  59. decode uavcan_protocol_file_GetInfoResponse, return true on failure, false on success
  60. */
  61. bool __uavcan_protocol_file_GetInfoResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_file_GetInfoResponse* msg, bool tao) {
  62. (void)transfer;
  63. (void)bit_ofs;
  64. (void)msg;
  65. (void)tao;
  66. canardDecodeScalar(transfer, *bit_ofs, 40, false, &msg->size);
  67. *bit_ofs += 40;
  68. if (__uavcan_protocol_file_Error_decode(transfer, bit_ofs, &msg->error, false)) {return true;}
  69. if (__uavcan_protocol_file_EntryType_decode(transfer, bit_ofs, &msg->entry_type, tao)) {return true;}
  70. return false; /* success */
  71. }
  72. #endif
  73. #ifdef CANARD_DSDLC_TEST_BUILD
  74. struct uavcan_protocol_file_GetInfoResponse sample_uavcan_protocol_file_GetInfoResponse_msg(void);
  75. #endif
  76. #ifdef __cplusplus
  77. } // extern "C"
  78. #ifdef DRONECAN_CXX_WRAPPERS
  79. #include <canard/cxx_wrappers.h>
  80. #endif
  81. #endif