uavcan.protocol.param.Empty.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. #include <stdbool.h>
  3. #include <stdint.h>
  4. #include <canard.h>
  5. #define UAVCAN_PROTOCOL_PARAM_EMPTY_MAX_SIZE 0
  6. #define UAVCAN_PROTOCOL_PARAM_EMPTY_SIGNATURE (0x6C4D0E8EF37361DFULL)
  7. struct uavcan_protocol_param_Empty {
  8. };
  9. #ifdef __cplusplus
  10. extern "C"
  11. {
  12. #endif
  13. uint32_t _uavcan_protocol_param_Empty_encode(struct uavcan_protocol_param_Empty* msg, uint8_t* buffer
  14. #if CANARD_ENABLE_TAO_OPTION
  15. , bool tao
  16. #endif
  17. );
  18. bool _uavcan_protocol_param_Empty_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_param_Empty* msg);
  19. static inline uint32_t uavcan_protocol_param_Empty_encode(struct uavcan_protocol_param_Empty* msg, uint8_t* buffer
  20. #if CANARD_ENABLE_TAO_OPTION
  21. , bool tao
  22. #endif
  23. ) {
  24. (void)msg;
  25. (void)buffer;
  26. #if CANARD_ENABLE_TAO_OPTION
  27. (void)tao;
  28. #endif
  29. return 0; // 0-length message encodes to 0 bytes
  30. }
  31. static inline bool uavcan_protocol_param_Empty_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_param_Empty* msg) {
  32. (void)msg;
  33. // all transports accurately convey a payload length of 0 bytes so any payload is an error
  34. return transfer->payload_len != 0;
  35. }
  36. #if defined(CANARD_DSDLC_INTERNAL)
  37. static inline void __uavcan_protocol_param_Empty_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_param_Empty* msg, bool tao);
  38. static inline bool __uavcan_protocol_param_Empty_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_param_Empty* msg, bool tao);
  39. void __uavcan_protocol_param_Empty_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_param_Empty* msg, bool tao) {
  40. (void)buffer;
  41. (void)bit_ofs;
  42. (void)msg;
  43. (void)tao;
  44. }
  45. /*
  46. decode uavcan_protocol_param_Empty, return true on failure, false on success
  47. */
  48. bool __uavcan_protocol_param_Empty_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_param_Empty* msg, bool tao) {
  49. (void)transfer;
  50. (void)bit_ofs;
  51. (void)msg;
  52. (void)tao;
  53. return false; /* success */
  54. }
  55. #endif
  56. #ifdef CANARD_DSDLC_TEST_BUILD
  57. struct uavcan_protocol_param_Empty sample_uavcan_protocol_param_Empty_msg(void);
  58. #endif
  59. #ifdef __cplusplus
  60. } // extern "C"
  61. #ifdef DRONECAN_CXX_WRAPPERS
  62. #include <canard/cxx_wrappers.h>
  63. #endif
  64. #endif