flipper.pb.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* Automatically generated nanopb header */
  2. /* Generated by nanopb-0.4.5 */
  3. #ifndef PB_PB_FLIPPER_PB_H_INCLUDED
  4. #define PB_PB_FLIPPER_PB_H_INCLUDED
  5. #include <pb.h>
  6. #include "storage.pb.h"
  7. #include "status.pb.h"
  8. #if PB_PROTO_HEADER_VERSION != 40
  9. #error Regenerate this file with the current version of nanopb generator.
  10. #endif
  11. /* Enum definitions */
  12. typedef enum _PB_CommandStatus {
  13. PB_CommandStatus_OK = 0,
  14. PB_CommandStatus_ERROR = 1, /* *< Unknown error */
  15. PB_CommandStatus_ERROR_DECODE = 2, /* *< Command can't be decoded successfully - command_id in response may be wrong! */
  16. PB_CommandStatus_ERROR_NOT_IMPLEMENTED = 3, /* *< Command succesfully decoded, but not implemented (deprecated or not yet implemented) */
  17. PB_CommandStatus_ERROR_BUSY = 4, /* *< Somebody took global lock, so not all commands are available */
  18. PB_CommandStatus_ERROR_CONTINUOUS_COMMAND_INTERRUPTED = 14, /* *< Not received has_next == 0 */
  19. PB_CommandStatus_ERROR_INVALID_PARAMETERS = 15, /* *< not provided (or provided invalid) crucial parameters to perform rpc */
  20. PB_CommandStatus_ERROR_STORAGE_NOT_READY = 5, /* *< FS not ready */
  21. PB_CommandStatus_ERROR_STORAGE_EXIST = 6, /* *< File/Dir alrady exist */
  22. PB_CommandStatus_ERROR_STORAGE_NOT_EXIST = 7, /* *< File/Dir does not exist */
  23. PB_CommandStatus_ERROR_STORAGE_INVALID_PARAMETER = 8, /* *< Invalid API parameter */
  24. PB_CommandStatus_ERROR_STORAGE_DENIED = 9, /* *< Access denied */
  25. PB_CommandStatus_ERROR_STORAGE_INVALID_NAME = 10, /* *< Invalid name/path */
  26. PB_CommandStatus_ERROR_STORAGE_INTERNAL = 11, /* *< Internal error */
  27. PB_CommandStatus_ERROR_STORAGE_NOT_IMPLEMENTED = 12, /* *< Functon not implemented */
  28. PB_CommandStatus_ERROR_STORAGE_ALREADY_OPEN = 13 /* *< File/Dir already opened */
  29. } PB_CommandStatus;
  30. /* Struct definitions */
  31. /* There are Server commands (e.g. Storage_write), which have no body message
  32. in response. But 'oneof' obligate to have at least 1 encoded message
  33. in scope. For this needs Empty message is implemented. */
  34. typedef struct _PB_Empty {
  35. char dummy_field;
  36. } PB_Empty;
  37. typedef struct _PB_Main {
  38. uint32_t command_id;
  39. PB_CommandStatus command_status;
  40. bool has_next;
  41. pb_callback_t cb_content;
  42. pb_size_t which_content;
  43. union {
  44. PB_Empty empty;
  45. PB_Status_PingRequest ping_request;
  46. PB_Status_PingResponse ping_response;
  47. PB_Storage_ListRequest storage_list_request;
  48. PB_Storage_ListResponse storage_list_response;
  49. PB_Storage_ReadRequest storage_read_request;
  50. PB_Storage_ReadResponse storage_read_response;
  51. PB_Storage_WriteRequest storage_write_request;
  52. PB_Storage_DeleteRequest storage_delete_request;
  53. PB_Storage_MkdirRequest storage_mkdir_request;
  54. PB_Storage_Md5sumRequest storage_md5sum_request;
  55. PB_Storage_Md5sumResponse storage_md5sum_response;
  56. } content;
  57. } PB_Main;
  58. /* Helper constants for enums */
  59. #define _PB_CommandStatus_MIN PB_CommandStatus_OK
  60. #define _PB_CommandStatus_MAX PB_CommandStatus_ERROR_INVALID_PARAMETERS
  61. #define _PB_CommandStatus_ARRAYSIZE ((PB_CommandStatus)(PB_CommandStatus_ERROR_INVALID_PARAMETERS+1))
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65. /* Initializer values for message structs */
  66. #define PB_Empty_init_default {0}
  67. #define PB_Main_init_default {0, _PB_CommandStatus_MIN, 0, {{NULL}, NULL}, 0, {PB_Empty_init_default}}
  68. #define PB_Empty_init_zero {0}
  69. #define PB_Main_init_zero {0, _PB_CommandStatus_MIN, 0, {{NULL}, NULL}, 0, {PB_Empty_init_zero}}
  70. /* Field tags (for use in manual encoding/decoding) */
  71. #define PB_Main_command_id_tag 1
  72. #define PB_Main_command_status_tag 2
  73. #define PB_Main_has_next_tag 3
  74. #define PB_Main_empty_tag 4
  75. #define PB_Main_ping_request_tag 5
  76. #define PB_Main_ping_response_tag 6
  77. #define PB_Main_storage_list_request_tag 7
  78. #define PB_Main_storage_list_response_tag 8
  79. #define PB_Main_storage_read_request_tag 9
  80. #define PB_Main_storage_read_response_tag 10
  81. #define PB_Main_storage_write_request_tag 11
  82. #define PB_Main_storage_delete_request_tag 12
  83. #define PB_Main_storage_mkdir_request_tag 13
  84. #define PB_Main_storage_md5sum_request_tag 14
  85. #define PB_Main_storage_md5sum_response_tag 15
  86. /* Struct field encoding specification for nanopb */
  87. #define PB_Empty_FIELDLIST(X, a) \
  88. #define PB_Empty_CALLBACK NULL
  89. #define PB_Empty_DEFAULT NULL
  90. #define PB_Main_FIELDLIST(X, a) \
  91. X(a, STATIC, SINGULAR, UINT32, command_id, 1) \
  92. X(a, STATIC, SINGULAR, UENUM, command_status, 2) \
  93. X(a, STATIC, SINGULAR, BOOL, has_next, 3) \
  94. X(a, STATIC, ONEOF, MSG_W_CB, (content,empty,content.empty), 4) \
  95. X(a, STATIC, ONEOF, MSG_W_CB, (content,ping_request,content.ping_request), 5) \
  96. X(a, STATIC, ONEOF, MSG_W_CB, (content,ping_response,content.ping_response), 6) \
  97. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_list_request,content.storage_list_request), 7) \
  98. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_list_response,content.storage_list_response), 8) \
  99. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_read_request,content.storage_read_request), 9) \
  100. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_read_response,content.storage_read_response), 10) \
  101. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_write_request,content.storage_write_request), 11) \
  102. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_delete_request,content.storage_delete_request), 12) \
  103. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_mkdir_request,content.storage_mkdir_request), 13) \
  104. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_md5sum_request,content.storage_md5sum_request), 14) \
  105. X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_md5sum_response,content.storage_md5sum_response), 15)
  106. #define PB_Main_CALLBACK NULL
  107. #define PB_Main_DEFAULT NULL
  108. #define PB_Main_content_empty_MSGTYPE PB_Empty
  109. #define PB_Main_content_ping_request_MSGTYPE PB_Status_PingRequest
  110. #define PB_Main_content_ping_response_MSGTYPE PB_Status_PingResponse
  111. #define PB_Main_content_storage_list_request_MSGTYPE PB_Storage_ListRequest
  112. #define PB_Main_content_storage_list_response_MSGTYPE PB_Storage_ListResponse
  113. #define PB_Main_content_storage_read_request_MSGTYPE PB_Storage_ReadRequest
  114. #define PB_Main_content_storage_read_response_MSGTYPE PB_Storage_ReadResponse
  115. #define PB_Main_content_storage_write_request_MSGTYPE PB_Storage_WriteRequest
  116. #define PB_Main_content_storage_delete_request_MSGTYPE PB_Storage_DeleteRequest
  117. #define PB_Main_content_storage_mkdir_request_MSGTYPE PB_Storage_MkdirRequest
  118. #define PB_Main_content_storage_md5sum_request_MSGTYPE PB_Storage_Md5sumRequest
  119. #define PB_Main_content_storage_md5sum_response_MSGTYPE PB_Storage_Md5sumResponse
  120. extern const pb_msgdesc_t PB_Empty_msg;
  121. extern const pb_msgdesc_t PB_Main_msg;
  122. /* Defines for backwards compatibility with code written before nanopb-0.4.0 */
  123. #define PB_Empty_fields &PB_Empty_msg
  124. #define PB_Main_fields &PB_Main_msg
  125. /* Maximum encoded size of messages (where known) */
  126. #define PB_Empty_size 0
  127. #if defined(PB_Storage_ListRequest_size) && defined(PB_Storage_ListResponse_size) && defined(PB_Storage_ReadRequest_size) && defined(PB_Storage_ReadResponse_size) && defined(PB_Storage_WriteRequest_size) && defined(PB_Storage_DeleteRequest_size) && defined(PB_Storage_MkdirRequest_size) && defined(PB_Storage_Md5sumRequest_size)
  128. #define PB_Main_size (10 + sizeof(union PB_Main_content_size_union))
  129. union PB_Main_content_size_union {char f7[(6 + PB_Storage_ListRequest_size)]; char f8[(6 + PB_Storage_ListResponse_size)]; char f9[(6 + PB_Storage_ReadRequest_size)]; char f10[(6 + PB_Storage_ReadResponse_size)]; char f11[(6 + PB_Storage_WriteRequest_size)]; char f12[(6 + PB_Storage_DeleteRequest_size)]; char f13[(6 + PB_Storage_MkdirRequest_size)]; char f14[(6 + PB_Storage_Md5sumRequest_size)]; char f0[36];};
  130. #endif
  131. #ifdef __cplusplus
  132. } /* extern "C" */
  133. #endif
  134. #endif