uavcan.protocol.file.Write_res.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <canard.h>
  5. #include <uavcan.protocol.file.Error.h>
  6. #define UAVCAN_PROTOCOL_FILE_WRITE_RESPONSE_MAX_SIZE 2
  7. #define UAVCAN_PROTOCOL_FILE_WRITE_RESPONSE_SIGNATURE (0x515AA1DC77E58429ULL)
  8. #define UAVCAN_PROTOCOL_FILE_WRITE_RESPONSE_ID 49
  9. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  10. class uavcan_protocol_file_Write_cxx_iface;
  11. #endif
  12. struct uavcan_protocol_file_WriteResponse {
  13. #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
  14. using cxx_iface = uavcan_protocol_file_Write_cxx_iface;
  15. #endif
  16. struct uavcan_protocol_file_Error error;
  17. };
  18. #ifdef __cplusplus
  19. extern "C"
  20. {
  21. #endif
  22. uint32_t _uavcan_protocol_file_WriteResponse_encode(struct uavcan_protocol_file_WriteResponse* msg, uint8_t* buffer
  23. #if CANARD_ENABLE_TAO_OPTION
  24. , bool tao
  25. #endif
  26. );
  27. bool _uavcan_protocol_file_WriteResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_file_WriteResponse* msg);
  28. static inline uint32_t uavcan_protocol_file_WriteResponse_encode(struct uavcan_protocol_file_WriteResponse* msg, uint8_t* buffer
  29. #if CANARD_ENABLE_TAO_OPTION
  30. , bool tao
  31. #endif
  32. ) {
  33. return _uavcan_protocol_file_WriteResponse_encode(msg, buffer
  34. #if CANARD_ENABLE_TAO_OPTION
  35. , tao
  36. #endif
  37. );
  38. }
  39. static inline bool uavcan_protocol_file_WriteResponse_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_file_WriteResponse* msg) {
  40. return _uavcan_protocol_file_WriteResponse_decode(transfer, msg);
  41. }
  42. #if defined(CANARD_DSDLC_INTERNAL)
  43. static inline void __uavcan_protocol_file_WriteResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_file_WriteResponse* msg, bool tao);
  44. static inline bool __uavcan_protocol_file_WriteResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_file_WriteResponse* msg, bool tao);
  45. void __uavcan_protocol_file_WriteResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_file_WriteResponse* msg, bool tao) {
  46. (void)buffer;
  47. (void)bit_ofs;
  48. (void)msg;
  49. (void)tao;
  50. __uavcan_protocol_file_Error_encode(buffer, bit_ofs, &msg->error, tao);
  51. }
  52. /*
  53. decode uavcan_protocol_file_WriteResponse, return true on failure, false on success
  54. */
  55. bool __uavcan_protocol_file_WriteResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_file_WriteResponse* msg, bool tao) {
  56. (void)transfer;
  57. (void)bit_ofs;
  58. (void)msg;
  59. (void)tao;
  60. if (__uavcan_protocol_file_Error_decode(transfer, bit_ofs, &msg->error, tao)) {return true;}
  61. return false; /* success */
  62. }
  63. #endif
  64. #ifdef CANARD_DSDLC_TEST_BUILD
  65. struct uavcan_protocol_file_WriteResponse sample_uavcan_protocol_file_WriteResponse_msg(void);
  66. #endif
  67. #ifdef __cplusplus
  68. } // extern "C"
  69. #ifdef DRONECAN_CXX_WRAPPERS
  70. #include <canard/cxx_wrappers.h>
  71. #endif
  72. #endif