ota_send_file.pb-c.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /* Generated by the protocol buffer compiler. DO NOT EDIT! */
  2. /* Generated from: ota_send_file.proto */
  3. #ifndef PROTOBUF_C_ota_5fsend_5ffile_2eproto__INCLUDED
  4. #define PROTOBUF_C_ota_5fsend_5ffile_2eproto__INCLUDED
  5. #include <protobuf-c/protobuf-c.h>
  6. PROTOBUF_C__BEGIN_DECLS
  7. #if PROTOBUF_C_VERSION_NUMBER < 1003000
  8. # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
  9. #elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
  10. # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
  11. #endif
  12. #include "constants.pb-c.h"
  13. typedef struct _CmdSendFile CmdSendFile;
  14. typedef struct _RespSendFile RespSendFile;
  15. typedef struct _CmdStartOTA CmdStartOTA;
  16. typedef struct _RespStartOTA RespStartOTA;
  17. typedef struct _CmdFinishOTA CmdFinishOTA;
  18. typedef struct _RespFinishOTA RespFinishOTA;
  19. typedef struct _SendFilePayload SendFilePayload;
  20. /* --- enums --- */
  21. typedef enum _SendFileMsgType {
  22. SEND_FILE_MSG_TYPE__TypeReserved = 0,
  23. SEND_FILE_MSG_TYPE__TypeCmdSendFile = 1,
  24. SEND_FILE_MSG_TYPE__TypeRespSendFile = 2,
  25. SEND_FILE_MSG_TYPE__TypeCmdStartOTA = 3,
  26. SEND_FILE_MSG_TYPE__TypeRespStartOTA = 4,
  27. SEND_FILE_MSG_TYPE__TypeCmdFinishOTA = 5,
  28. SEND_FILE_MSG_TYPE__TypeRespFinishOTA = 6
  29. PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEND_FILE_MSG_TYPE)
  30. } SendFileMsgType;
  31. /* --- messages --- */
  32. struct _CmdSendFile {
  33. ProtobufCMessage base;
  34. ProtobufCBinaryData data;
  35. };
  36. #define CMD_SEND_FILE__INIT \
  37. { PROTOBUF_C_MESSAGE_INIT (&cmd_send_file__descriptor) \
  38. , {0,NULL} }
  39. struct _RespSendFile {
  40. ProtobufCMessage base;
  41. };
  42. #define RESP_SEND_FILE__INIT \
  43. { PROTOBUF_C_MESSAGE_INIT (&resp_send_file__descriptor) \
  44. }
  45. struct _CmdStartOTA {
  46. ProtobufCMessage base;
  47. uint64_t file_size;
  48. uint64_t block_size;
  49. char *partition_name;
  50. };
  51. #define CMD_START_OTA__INIT \
  52. { PROTOBUF_C_MESSAGE_INIT (&cmd_start_ota__descriptor) \
  53. , 0, 0, (char *)protobuf_c_empty_string }
  54. struct _RespStartOTA {
  55. ProtobufCMessage base;
  56. };
  57. #define RESP_START_OTA__INIT \
  58. { PROTOBUF_C_MESSAGE_INIT (&resp_start_ota__descriptor) \
  59. }
  60. struct _CmdFinishOTA {
  61. ProtobufCMessage base;
  62. };
  63. #define CMD_FINISH_OTA__INIT \
  64. { PROTOBUF_C_MESSAGE_INIT (&cmd_finish_ota__descriptor) \
  65. }
  66. struct _RespFinishOTA {
  67. ProtobufCMessage base;
  68. };
  69. #define RESP_FINISH_OTA__INIT \
  70. { PROTOBUF_C_MESSAGE_INIT (&resp_finish_ota__descriptor) \
  71. }
  72. typedef enum {
  73. SEND_FILE_PAYLOAD__PAYLOAD__NOT_SET = 0,
  74. SEND_FILE_PAYLOAD__PAYLOAD_CMD_SEND_FILE = 10,
  75. SEND_FILE_PAYLOAD__PAYLOAD_RESP_SEND_FILE = 11,
  76. SEND_FILE_PAYLOAD__PAYLOAD_CMD_START_OTA = 12,
  77. SEND_FILE_PAYLOAD__PAYLOAD_RESP_START_OTA = 13,
  78. SEND_FILE_PAYLOAD__PAYLOAD_CMD_FINISH_OTA = 14,
  79. SEND_FILE_PAYLOAD__PAYLOAD_RESP_FINISH_OTA = 15
  80. PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SEND_FILE_PAYLOAD__PAYLOAD)
  81. } SendFilePayload__PayloadCase;
  82. struct _SendFilePayload {
  83. ProtobufCMessage base;
  84. SendFileMsgType msg;
  85. Status status;
  86. SendFilePayload__PayloadCase payload_case;
  87. union {
  88. CmdSendFile *cmd_send_file;
  89. RespSendFile *resp_send_file;
  90. CmdStartOTA *cmd_start_ota;
  91. RespStartOTA *resp_start_ota;
  92. CmdFinishOTA *cmd_finish_ota;
  93. RespFinishOTA *resp_finish_ota;
  94. };
  95. };
  96. #define SEND_FILE_PAYLOAD__INIT \
  97. { PROTOBUF_C_MESSAGE_INIT (&send_file_payload__descriptor) \
  98. , SEND_FILE_MSG_TYPE__TypeReserved, STATUS__Success, SEND_FILE_PAYLOAD__PAYLOAD__NOT_SET, {0} }
  99. /* CmdSendFile methods */
  100. void cmd_send_file__init
  101. (CmdSendFile *message);
  102. size_t cmd_send_file__get_packed_size
  103. (const CmdSendFile *message);
  104. size_t cmd_send_file__pack
  105. (const CmdSendFile *message,
  106. uint8_t *out);
  107. size_t cmd_send_file__pack_to_buffer
  108. (const CmdSendFile *message,
  109. ProtobufCBuffer *buffer);
  110. CmdSendFile *
  111. cmd_send_file__unpack
  112. (ProtobufCAllocator *allocator,
  113. size_t len,
  114. const uint8_t *data);
  115. void cmd_send_file__free_unpacked
  116. (CmdSendFile *message,
  117. ProtobufCAllocator *allocator);
  118. /* RespSendFile methods */
  119. void resp_send_file__init
  120. (RespSendFile *message);
  121. size_t resp_send_file__get_packed_size
  122. (const RespSendFile *message);
  123. size_t resp_send_file__pack
  124. (const RespSendFile *message,
  125. uint8_t *out);
  126. size_t resp_send_file__pack_to_buffer
  127. (const RespSendFile *message,
  128. ProtobufCBuffer *buffer);
  129. RespSendFile *
  130. resp_send_file__unpack
  131. (ProtobufCAllocator *allocator,
  132. size_t len,
  133. const uint8_t *data);
  134. void resp_send_file__free_unpacked
  135. (RespSendFile *message,
  136. ProtobufCAllocator *allocator);
  137. /* CmdStartOTA methods */
  138. void cmd_start_ota__init
  139. (CmdStartOTA *message);
  140. size_t cmd_start_ota__get_packed_size
  141. (const CmdStartOTA *message);
  142. size_t cmd_start_ota__pack
  143. (const CmdStartOTA *message,
  144. uint8_t *out);
  145. size_t cmd_start_ota__pack_to_buffer
  146. (const CmdStartOTA *message,
  147. ProtobufCBuffer *buffer);
  148. CmdStartOTA *
  149. cmd_start_ota__unpack
  150. (ProtobufCAllocator *allocator,
  151. size_t len,
  152. const uint8_t *data);
  153. void cmd_start_ota__free_unpacked
  154. (CmdStartOTA *message,
  155. ProtobufCAllocator *allocator);
  156. /* RespStartOTA methods */
  157. void resp_start_ota__init
  158. (RespStartOTA *message);
  159. size_t resp_start_ota__get_packed_size
  160. (const RespStartOTA *message);
  161. size_t resp_start_ota__pack
  162. (const RespStartOTA *message,
  163. uint8_t *out);
  164. size_t resp_start_ota__pack_to_buffer
  165. (const RespStartOTA *message,
  166. ProtobufCBuffer *buffer);
  167. RespStartOTA *
  168. resp_start_ota__unpack
  169. (ProtobufCAllocator *allocator,
  170. size_t len,
  171. const uint8_t *data);
  172. void resp_start_ota__free_unpacked
  173. (RespStartOTA *message,
  174. ProtobufCAllocator *allocator);
  175. /* CmdFinishOTA methods */
  176. void cmd_finish_ota__init
  177. (CmdFinishOTA *message);
  178. size_t cmd_finish_ota__get_packed_size
  179. (const CmdFinishOTA *message);
  180. size_t cmd_finish_ota__pack
  181. (const CmdFinishOTA *message,
  182. uint8_t *out);
  183. size_t cmd_finish_ota__pack_to_buffer
  184. (const CmdFinishOTA *message,
  185. ProtobufCBuffer *buffer);
  186. CmdFinishOTA *
  187. cmd_finish_ota__unpack
  188. (ProtobufCAllocator *allocator,
  189. size_t len,
  190. const uint8_t *data);
  191. void cmd_finish_ota__free_unpacked
  192. (CmdFinishOTA *message,
  193. ProtobufCAllocator *allocator);
  194. /* RespFinishOTA methods */
  195. void resp_finish_ota__init
  196. (RespFinishOTA *message);
  197. size_t resp_finish_ota__get_packed_size
  198. (const RespFinishOTA *message);
  199. size_t resp_finish_ota__pack
  200. (const RespFinishOTA *message,
  201. uint8_t *out);
  202. size_t resp_finish_ota__pack_to_buffer
  203. (const RespFinishOTA *message,
  204. ProtobufCBuffer *buffer);
  205. RespFinishOTA *
  206. resp_finish_ota__unpack
  207. (ProtobufCAllocator *allocator,
  208. size_t len,
  209. const uint8_t *data);
  210. void resp_finish_ota__free_unpacked
  211. (RespFinishOTA *message,
  212. ProtobufCAllocator *allocator);
  213. /* SendFilePayload methods */
  214. void send_file_payload__init
  215. (SendFilePayload *message);
  216. size_t send_file_payload__get_packed_size
  217. (const SendFilePayload *message);
  218. size_t send_file_payload__pack
  219. (const SendFilePayload *message,
  220. uint8_t *out);
  221. size_t send_file_payload__pack_to_buffer
  222. (const SendFilePayload *message,
  223. ProtobufCBuffer *buffer);
  224. SendFilePayload *
  225. send_file_payload__unpack
  226. (ProtobufCAllocator *allocator,
  227. size_t len,
  228. const uint8_t *data);
  229. void send_file_payload__free_unpacked
  230. (SendFilePayload *message,
  231. ProtobufCAllocator *allocator);
  232. /* --- per-message closures --- */
  233. typedef void (*CmdSendFile_Closure)
  234. (const CmdSendFile *message,
  235. void *closure_data);
  236. typedef void (*RespSendFile_Closure)
  237. (const RespSendFile *message,
  238. void *closure_data);
  239. typedef void (*CmdStartOTA_Closure)
  240. (const CmdStartOTA *message,
  241. void *closure_data);
  242. typedef void (*RespStartOTA_Closure)
  243. (const RespStartOTA *message,
  244. void *closure_data);
  245. typedef void (*CmdFinishOTA_Closure)
  246. (const CmdFinishOTA *message,
  247. void *closure_data);
  248. typedef void (*RespFinishOTA_Closure)
  249. (const RespFinishOTA *message,
  250. void *closure_data);
  251. typedef void (*SendFilePayload_Closure)
  252. (const SendFilePayload *message,
  253. void *closure_data);
  254. /* --- services --- */
  255. /* --- descriptors --- */
  256. extern const ProtobufCEnumDescriptor send_file_msg_type__descriptor;
  257. extern const ProtobufCMessageDescriptor cmd_send_file__descriptor;
  258. extern const ProtobufCMessageDescriptor resp_send_file__descriptor;
  259. extern const ProtobufCMessageDescriptor cmd_start_ota__descriptor;
  260. extern const ProtobufCMessageDescriptor resp_start_ota__descriptor;
  261. extern const ProtobufCMessageDescriptor cmd_finish_ota__descriptor;
  262. extern const ProtobufCMessageDescriptor resp_finish_ota__descriptor;
  263. extern const ProtobufCMessageDescriptor send_file_payload__descriptor;
  264. PROTOBUF_C__END_DECLS
  265. #endif /* PROTOBUF_C_ota_5fsend_5ffile_2eproto__INCLUDED */