diff --git a/.gitmodules b/.gitmodules index f965d88e..6222c8a0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,7 @@ url = https://github.com/pbatard/libwdi.git [submodule "3rdparty/nanopb"] path = 3rdparty/nanopb - url = https://github.com/nanopb/nanopb.git + url = https://github.com/gsurkov/nanopb.git +[submodule "plugins/flipperproto0/flipperzero-protobuf"] + path = plugins/flipperproto0/flipperzero-protobuf + url = https://github.com/flipperdevices/flipperzero-protobuf.git diff --git a/3rdparty/nanopb b/3rdparty/nanopb index 13666952..1813a946 160000 --- a/3rdparty/nanopb +++ b/3rdparty/nanopb @@ -1 +1 @@ -Subproject commit 13666952914f3cf43a70c6b9738a7dc0dd06a6dc +Subproject commit 1813a946f867fbff7f9fa3b99358f73527becfa1 diff --git a/CMakeLists.txt b/CMakeLists.txt index d13d7846..c8e2cb40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,10 @@ cmake_minimum_required(VERSION 3.16) project("qFlipper" C CXX) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH + "${CMAKE_CURRENT_LIST_DIR}/cmake" + "${CMAKE_CURRENT_LIST_DIR}/3rdparty/nanopb/extra" +) include(FindCCache) include(VersionInfo) @@ -36,6 +39,8 @@ find_package(Qt6 Widgets REQUIRED CONFIG) +find_package(Nanopb REQUIRED) + if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") find_package(PkgConfig REQUIRED) pkg_check_modules(libusb REQUIRED IMPORTED_TARGET "libusb-1.0") diff --git a/plugins/flipperproto0/CMakeLists.txt b/plugins/flipperproto0/CMakeLists.txt index e69de29b..7fb3d61d 100644 --- a/plugins/flipperproto0/CMakeLists.txt +++ b/plugins/flipperproto0/CMakeLists.txt @@ -0,0 +1,45 @@ +qt_add_plugin(flipperproto0 + CLASS_NAME "ProtobufPlugin" +) + +file(GLOB PLUGIN_CXX_SOURCES + "*.cpp" +) + +file(GLOB PLUGIN_PROTO_FILES + "flipperzero-protobuf/*.proto" +) + +nanopb_generate_cpp( + PLUGIN_PROTO_SOURCES + PLUGIN_PROTO_HEADERS + ${PLUGIN_PROTO_FILES} +) + +set_source_files_properties( + ${PLUGIN_PROTO_SOURCES} + ${PLUGIN_PROTO_HEADERS} + PROPERTIES GENERATED TRUE) + +target_sources(flipperproto0 + PRIVATE + ${PLUGIN_CXX_SOURCES} + ${PLUGIN_PROTO_SOURCES} +) + +target_include_directories(flipperproto0 + PRIVATE + ${NANOPB_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} +) + +target_compile_definitions(flipperproto0 + PRIVATE + "-DPB_ENABLE_MALLOC" +) + +target_link_libraries(flipperproto0 + PRIVATE + protobufinterface + Qt::Core +) diff --git a/plugins/flipperproto0/flipperproto0.pro b/plugins/flipperproto0/flipperproto0.pro index 64848402..a6ec9aee 100644 --- a/plugins/flipperproto0/flipperproto0.pro +++ b/plugins/flipperproto0/flipperproto0.pro @@ -13,20 +13,22 @@ CONFIG += plugin c++11 VERSION = 0.0.0 INCLUDEPATH += $$PWD/../protobufinterface \ - $$PWD/../../3rdparty/nanopb + $$PWD/../../3rdparty/nanopb \ + $$PWD/flipperzero-protobuf-compiled HEADERS += \ + flipperzero-protobuf-compiled/application.pb.h \ + flipperzero-protobuf-compiled/desktop.pb.h \ + flipperzero-protobuf-compiled/flipper.pb.h \ + flipperzero-protobuf-compiled/gui.pb.h \ + flipperzero-protobuf-compiled/property.pb.h \ + flipperzero-protobuf-compiled/status.pb.h \ + flipperzero-protobuf-compiled/storage.pb.h \ + flipperzero-protobuf-compiled/system.pb.h \ guirequest.h \ guiresponse.h \ mainrequest.h \ mainresponse.h \ - messages/application.pb.h \ - messages/flipper.pb.h \ - messages/gui.pb.h \ - messages/property.pb.h \ - messages/status.pb.h \ - messages/storage.pb.h \ - messages/system.pb.h \ messagewrapper.h \ propertyrequest.h \ propertyresponse.h \ @@ -40,18 +42,19 @@ HEADERS += \ systemresponse.h SOURCES += \ + flipperzero-protobuf-compiled/application.pb.c \ + flipperzero-protobuf-compiled/desktop.pb.c \ + flipperzero-protobuf-compiled/flipper.pb.c \ + flipperzero-protobuf-compiled/gpio.pb.c \ + flipperzero-protobuf-compiled/gui.pb.c \ + flipperzero-protobuf-compiled/property.pb.c \ + flipperzero-protobuf-compiled/status.pb.c \ + flipperzero-protobuf-compiled/storage.pb.c \ + flipperzero-protobuf-compiled/system.pb.c \ guirequest.cpp \ guiresponse.cpp \ mainrequest.cpp \ mainresponse.cpp \ - messages/application.pb.c \ - messages/flipper.pb.c \ - messages/gpio.pb.c \ - messages/gui.pb.c \ - messages/property.pb.c \ - messages/status.pb.c \ - messages/storage.pb.c \ - messages/system.pb.c \ messagewrapper.cpp \ propertyrequest.cpp \ propertyresponse.cpp \ diff --git a/plugins/flipperproto0/flipperzero-protobuf b/plugins/flipperproto0/flipperzero-protobuf new file mode 160000 index 00000000..1956b83b --- /dev/null +++ b/plugins/flipperproto0/flipperzero-protobuf @@ -0,0 +1 @@ +Subproject commit 1956b83bba99313ee8d8386e5d35d0549341ca26 diff --git a/plugins/flipperproto0/messages/application.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.c similarity index 96% rename from plugins/flipperproto0/messages/application.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.c index b0c91d73..a9af949a 100644 --- a/plugins/flipperproto0/messages/application.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "application.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/application.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.h similarity index 84% rename from plugins/flipperproto0/messages/application.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.h index 10f94a16..4e240a55 100644 --- a/plugins/flipperproto0/messages/application.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/application.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_APP_APPLICATION_PB_H_INCLUDED #define PB_PB_APP_APPLICATION_PB_H_INCLUDED @@ -10,68 +10,81 @@ #endif /* Enum definitions */ -typedef enum _PB_App_AppState { - PB_App_AppState_APP_CLOSED = 0, - PB_App_AppState_APP_STARTED = 1 +typedef enum _PB_App_AppState { + PB_App_AppState_APP_CLOSED = 0, + PB_App_AppState_APP_STARTED = 1 } PB_App_AppState; /* Struct definitions */ -typedef struct _PB_App_AppButtonReleaseRequest { - char dummy_field; -} PB_App_AppButtonReleaseRequest; +typedef struct _PB_App_StartRequest { + char *name; + char *args; +} PB_App_StartRequest; -typedef struct _PB_App_AppExitRequest { +typedef struct _PB_App_LockStatusRequest { char dummy_field; -} PB_App_AppExitRequest; - -typedef struct _PB_App_DataExchangeRequest { - pb_bytes_array_t *data; -} PB_App_DataExchangeRequest; +} PB_App_LockStatusRequest; -typedef struct _PB_App_GetErrorRequest { - char dummy_field; -} PB_App_GetErrorRequest; +typedef struct _PB_App_LockStatusResponse { + bool locked; +} PB_App_LockStatusResponse; -typedef struct _PB_App_LockStatusRequest { +typedef struct _PB_App_AppExitRequest { char dummy_field; -} PB_App_LockStatusRequest; +} PB_App_AppExitRequest; -typedef struct _PB_App_StartRequest { - char *name; - char *args; -} PB_App_StartRequest; +typedef struct _PB_App_AppLoadFileRequest { + char path[513]; +} PB_App_AppLoadFileRequest; -typedef struct _PB_App_AppButtonPressRequest { - char args[513]; +typedef struct _PB_App_AppButtonPressRequest { + char args[513]; + int32_t index; } PB_App_AppButtonPressRequest; -typedef struct _PB_App_AppLoadFileRequest { - char path[513]; -} PB_App_AppLoadFileRequest; +typedef struct _PB_App_AppButtonReleaseRequest { + char dummy_field; +} PB_App_AppButtonReleaseRequest; -typedef struct _PB_App_AppStateResponse { - PB_App_AppState state; +typedef struct _PB_App_AppStateResponse { + PB_App_AppState state; } PB_App_AppStateResponse; -typedef struct _PB_App_GetErrorResponse { - uint32_t code; - char *text; +typedef struct _PB_App_GetErrorRequest { + char dummy_field; +} PB_App_GetErrorRequest; + +typedef struct _PB_App_GetErrorResponse { + uint32_t code; + char *text; } PB_App_GetErrorResponse; -typedef struct _PB_App_LockStatusResponse { - bool locked; -} PB_App_LockStatusResponse; +typedef struct _PB_App_DataExchangeRequest { + pb_bytes_array_t *data; +} PB_App_DataExchangeRequest; +#ifdef __cplusplus +extern "C" { +#endif + /* Helper constants for enums */ #define _PB_App_AppState_MIN PB_App_AppState_APP_CLOSED #define _PB_App_AppState_MAX PB_App_AppState_APP_STARTED #define _PB_App_AppState_ARRAYSIZE ((PB_App_AppState)(PB_App_AppState_APP_STARTED+1)) -#ifdef __cplusplus -extern "C" { -#endif + + + + + + +#define PB_App_AppStateResponse_state_ENUMTYPE PB_App_AppState + + + + /* Initializer values for message structs */ #define PB_App_StartRequest_init_default {NULL, NULL} @@ -79,7 +92,7 @@ extern "C" { #define PB_App_LockStatusResponse_init_default {0} #define PB_App_AppExitRequest_init_default {0} #define PB_App_AppLoadFileRequest_init_default {""} -#define PB_App_AppButtonPressRequest_init_default {""} +#define PB_App_AppButtonPressRequest_init_default {"", 0} #define PB_App_AppButtonReleaseRequest_init_default {0} #define PB_App_AppStateResponse_init_default {_PB_App_AppState_MIN} #define PB_App_GetErrorRequest_init_default {0} @@ -90,7 +103,7 @@ extern "C" { #define PB_App_LockStatusResponse_init_zero {0} #define PB_App_AppExitRequest_init_zero {0} #define PB_App_AppLoadFileRequest_init_zero {""} -#define PB_App_AppButtonPressRequest_init_zero {""} +#define PB_App_AppButtonPressRequest_init_zero {"", 0} #define PB_App_AppButtonReleaseRequest_init_zero {0} #define PB_App_AppStateResponse_init_zero {_PB_App_AppState_MIN} #define PB_App_GetErrorRequest_init_zero {0} @@ -98,15 +111,16 @@ extern "C" { #define PB_App_DataExchangeRequest_init_zero {NULL} /* Field tags (for use in manual encoding/decoding) */ -#define PB_App_DataExchangeRequest_data_tag 1 #define PB_App_StartRequest_name_tag 1 #define PB_App_StartRequest_args_tag 2 -#define PB_App_AppButtonPressRequest_args_tag 1 +#define PB_App_LockStatusResponse_locked_tag 1 #define PB_App_AppLoadFileRequest_path_tag 1 +#define PB_App_AppButtonPressRequest_args_tag 1 +#define PB_App_AppButtonPressRequest_index_tag 2 #define PB_App_AppStateResponse_state_tag 1 #define PB_App_GetErrorResponse_code_tag 1 #define PB_App_GetErrorResponse_text_tag 2 -#define PB_App_LockStatusResponse_locked_tag 1 +#define PB_App_DataExchangeRequest_data_tag 1 /* Struct field encoding specification for nanopb */ #define PB_App_StartRequest_FIELDLIST(X, a) \ @@ -136,7 +150,8 @@ X(a, STATIC, SINGULAR, STRING, path, 1) #define PB_App_AppLoadFileRequest_DEFAULT NULL #define PB_App_AppButtonPressRequest_FIELDLIST(X, a) \ -X(a, STATIC, SINGULAR, STRING, args, 1) +X(a, STATIC, SINGULAR, STRING, args, 1) \ +X(a, STATIC, SINGULAR, INT32, index, 2) #define PB_App_AppButtonPressRequest_CALLBACK NULL #define PB_App_AppButtonPressRequest_DEFAULT NULL @@ -195,7 +210,8 @@ extern const pb_msgdesc_t PB_App_DataExchangeRequest_msg; /* PB_App_StartRequest_size depends on runtime parameters */ /* PB_App_GetErrorResponse_size depends on runtime parameters */ /* PB_App_DataExchangeRequest_size depends on runtime parameters */ -#define PB_App_AppButtonPressRequest_size 515 +#define PB_APP_APPLICATION_PB_H_MAX_SIZE PB_App_AppButtonPressRequest_size +#define PB_App_AppButtonPressRequest_size 526 #define PB_App_AppButtonReleaseRequest_size 0 #define PB_App_AppExitRequest_size 0 #define PB_App_AppLoadFileRequest_size 515 diff --git a/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.c new file mode 100644 index 00000000..c03989b7 --- /dev/null +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.c @@ -0,0 +1,24 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.9-dev */ + +#include "desktop.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(PB_Desktop_IsLockedRequest, PB_Desktop_IsLockedRequest, AUTO) + + +PB_BIND(PB_Desktop_UnlockRequest, PB_Desktop_UnlockRequest, AUTO) + + +PB_BIND(PB_Desktop_StatusSubscribeRequest, PB_Desktop_StatusSubscribeRequest, AUTO) + + +PB_BIND(PB_Desktop_StatusUnsubscribeRequest, PB_Desktop_StatusUnsubscribeRequest, AUTO) + + +PB_BIND(PB_Desktop_Status, PB_Desktop_Status, AUTO) + + + diff --git a/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.h new file mode 100644 index 00000000..ec918c5f --- /dev/null +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/desktop.pb.h @@ -0,0 +1,104 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.9-dev */ + +#ifndef PB_PB_DESKTOP_DESKTOP_PB_H_INCLUDED +#define PB_PB_DESKTOP_DESKTOP_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Struct definitions */ +typedef struct _PB_Desktop_IsLockedRequest { + char dummy_field; +} PB_Desktop_IsLockedRequest; + +typedef struct _PB_Desktop_UnlockRequest { + char dummy_field; +} PB_Desktop_UnlockRequest; + +typedef struct _PB_Desktop_StatusSubscribeRequest { + char dummy_field; +} PB_Desktop_StatusSubscribeRequest; + +typedef struct _PB_Desktop_StatusUnsubscribeRequest { + char dummy_field; +} PB_Desktop_StatusUnsubscribeRequest; + +typedef struct _PB_Desktop_Status { + bool locked; +} PB_Desktop_Status; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Initializer values for message structs */ +#define PB_Desktop_IsLockedRequest_init_default {0} +#define PB_Desktop_UnlockRequest_init_default {0} +#define PB_Desktop_StatusSubscribeRequest_init_default {0} +#define PB_Desktop_StatusUnsubscribeRequest_init_default {0} +#define PB_Desktop_Status_init_default {0} +#define PB_Desktop_IsLockedRequest_init_zero {0} +#define PB_Desktop_UnlockRequest_init_zero {0} +#define PB_Desktop_StatusSubscribeRequest_init_zero {0} +#define PB_Desktop_StatusUnsubscribeRequest_init_zero {0} +#define PB_Desktop_Status_init_zero {0} + +/* Field tags (for use in manual encoding/decoding) */ +#define PB_Desktop_Status_locked_tag 1 + +/* Struct field encoding specification for nanopb */ +#define PB_Desktop_IsLockedRequest_FIELDLIST(X, a) \ + +#define PB_Desktop_IsLockedRequest_CALLBACK NULL +#define PB_Desktop_IsLockedRequest_DEFAULT NULL + +#define PB_Desktop_UnlockRequest_FIELDLIST(X, a) \ + +#define PB_Desktop_UnlockRequest_CALLBACK NULL +#define PB_Desktop_UnlockRequest_DEFAULT NULL + +#define PB_Desktop_StatusSubscribeRequest_FIELDLIST(X, a) \ + +#define PB_Desktop_StatusSubscribeRequest_CALLBACK NULL +#define PB_Desktop_StatusSubscribeRequest_DEFAULT NULL + +#define PB_Desktop_StatusUnsubscribeRequest_FIELDLIST(X, a) \ + +#define PB_Desktop_StatusUnsubscribeRequest_CALLBACK NULL +#define PB_Desktop_StatusUnsubscribeRequest_DEFAULT NULL + +#define PB_Desktop_Status_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, BOOL, locked, 1) +#define PB_Desktop_Status_CALLBACK NULL +#define PB_Desktop_Status_DEFAULT NULL + +extern const pb_msgdesc_t PB_Desktop_IsLockedRequest_msg; +extern const pb_msgdesc_t PB_Desktop_UnlockRequest_msg; +extern const pb_msgdesc_t PB_Desktop_StatusSubscribeRequest_msg; +extern const pb_msgdesc_t PB_Desktop_StatusUnsubscribeRequest_msg; +extern const pb_msgdesc_t PB_Desktop_Status_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define PB_Desktop_IsLockedRequest_fields &PB_Desktop_IsLockedRequest_msg +#define PB_Desktop_UnlockRequest_fields &PB_Desktop_UnlockRequest_msg +#define PB_Desktop_StatusSubscribeRequest_fields &PB_Desktop_StatusSubscribeRequest_msg +#define PB_Desktop_StatusUnsubscribeRequest_fields &PB_Desktop_StatusUnsubscribeRequest_msg +#define PB_Desktop_Status_fields &PB_Desktop_Status_msg + +/* Maximum encoded size of messages (where known) */ +#define PB_DESKTOP_DESKTOP_PB_H_MAX_SIZE PB_Desktop_Status_size +#define PB_Desktop_IsLockedRequest_size 0 +#define PB_Desktop_StatusSubscribeRequest_size 0 +#define PB_Desktop_StatusUnsubscribeRequest_size 0 +#define PB_Desktop_Status_size 2 +#define PB_Desktop_UnlockRequest_size 0 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/plugins/flipperproto0/messages/flipper.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.c similarity index 91% rename from plugins/flipperproto0/messages/flipper.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.c index 31177f56..7fe49ef9 100644 --- a/plugins/flipperproto0/messages/flipper.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "flipper.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/flipper.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.h similarity index 91% rename from plugins/flipperproto0/messages/flipper.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.h index 63ade943..a60a7bba 100644 --- a/plugins/flipperproto0/messages/flipper.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/flipper.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_FLIPPER_PB_H_INCLUDED #define PB_PB_FLIPPER_PB_H_INCLUDED @@ -10,30 +10,31 @@ #include "gui.pb.h" #include "gpio.pb.h" #include "property.pb.h" +#include "desktop.pb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif /* Enum definitions */ -typedef enum _PB_CommandStatus { - PB_CommandStatus_OK = 0, +typedef enum _PB_CommandStatus { + PB_CommandStatus_OK = 0, /* *< Common Errors */ PB_CommandStatus_ERROR = 1, /* *< Unknown error */ PB_CommandStatus_ERROR_DECODE = 2, /* *< Command can't be decoded successfully - command_id in response may be wrong! */ - PB_CommandStatus_ERROR_NOT_IMPLEMENTED = 3, /* *< Command succesfully decoded, but not implemented (deprecated or not yet implemented) */ + PB_CommandStatus_ERROR_NOT_IMPLEMENTED = 3, /* *< Command successfully decoded, but not implemented (deprecated or not yet implemented) */ PB_CommandStatus_ERROR_BUSY = 4, /* *< Somebody took global lock, so not all commands are available */ PB_CommandStatus_ERROR_CONTINUOUS_COMMAND_INTERRUPTED = 14, /* *< Not received has_next == 0 */ - PB_CommandStatus_ERROR_INVALID_PARAMETERS = 15, /* *< not provided (or provided invalid) crucial parameters to perform rpc */ + PB_CommandStatus_ERROR_INVALID_PARAMETERS = 15, /* *< not provided (or provided invalid) crucial parameters to perform RPC */ /* *< Storage Errors */ PB_CommandStatus_ERROR_STORAGE_NOT_READY = 5, /* *< FS not ready */ - PB_CommandStatus_ERROR_STORAGE_EXIST = 6, /* *< File/Dir alrady exist */ + PB_CommandStatus_ERROR_STORAGE_EXIST = 6, /* *< File/Dir already exist */ PB_CommandStatus_ERROR_STORAGE_NOT_EXIST = 7, /* *< File/Dir does not exist */ PB_CommandStatus_ERROR_STORAGE_INVALID_PARAMETER = 8, /* *< Invalid API parameter */ PB_CommandStatus_ERROR_STORAGE_DENIED = 9, /* *< Access denied */ PB_CommandStatus_ERROR_STORAGE_INVALID_NAME = 10, /* *< Invalid name/path */ PB_CommandStatus_ERROR_STORAGE_INTERNAL = 11, /* *< Internal error */ - PB_CommandStatus_ERROR_STORAGE_NOT_IMPLEMENTED = 12, /* *< Functon not implemented */ + PB_CommandStatus_ERROR_STORAGE_NOT_IMPLEMENTED = 12, /* *< Function is not implemented */ PB_CommandStatus_ERROR_STORAGE_ALREADY_OPEN = 13, /* *< File/Dir already opened */ PB_CommandStatus_ERROR_STORAGE_DIR_NOT_EMPTY = 18, /* *< Directory, you're going to remove is not empty */ /* *< Application Errors */ @@ -45,31 +46,26 @@ typedef enum _PB_CommandStatus { PB_CommandStatus_ERROR_VIRTUAL_DISPLAY_ALREADY_STARTED = 19, /* *< Virtual Display session can't be started twice */ PB_CommandStatus_ERROR_VIRTUAL_DISPLAY_NOT_STARTED = 20, /* *< Virtual Display session can't be stopped when it's not started */ /* *< GPIO Errors */ - PB_CommandStatus_ERROR_GPIO_MODE_INCORRECT = 58, - PB_CommandStatus_ERROR_GPIO_UNKNOWN_PIN_MODE = 59 + PB_CommandStatus_ERROR_GPIO_MODE_INCORRECT = 58, + PB_CommandStatus_ERROR_GPIO_UNKNOWN_PIN_MODE = 59 } PB_CommandStatus; /* Struct definitions */ /* There are Server commands (e.g. Storage_write), which have no body message in response. But 'oneof' obligate to have at least 1 encoded message in scope. For this needs Empty message is implemented. */ -typedef struct _PB_Empty { +typedef struct _PB_Empty { char dummy_field; } PB_Empty; -typedef struct _PB_Region { - pb_bytes_array_t *country_code; - pb_callback_t bands; -} PB_Region; - -typedef struct _PB_StopSession { +typedef struct _PB_StopSession { char dummy_field; } PB_StopSession; -typedef struct _PB_Main { - uint32_t command_id; - PB_CommandStatus command_status; - bool has_next; +typedef struct _PB_Main { + uint32_t command_id; + PB_CommandStatus command_status; + bool has_next; pb_callback_t cb_content; pb_size_t which_content; union { @@ -135,26 +131,42 @@ typedef struct _PB_Main { PB_App_GetErrorRequest app_get_error_request; PB_App_GetErrorResponse app_get_error_response; PB_App_DataExchangeRequest app_data_exchange_request; - } content; + PB_Desktop_IsLockedRequest desktop_is_locked_request; + PB_Desktop_UnlockRequest desktop_unlock_request; + PB_Desktop_StatusSubscribeRequest desktop_status_subscribe_request; + PB_Desktop_StatusUnsubscribeRequest desktop_status_unsubscribe_request; + PB_Desktop_Status desktop_status; + } content; } PB_Main; -typedef struct _PB_Region_Band { - uint32_t start; - uint32_t end; - int8_t power_limit; - uint8_t duty_cycle; +typedef struct _PB_Region { + pb_bytes_array_t *country_code; + pb_callback_t bands; +} PB_Region; + +typedef struct _PB_Region_Band { + uint32_t start; + uint32_t end; + int8_t power_limit; + uint8_t duty_cycle; } PB_Region_Band; +#ifdef __cplusplus +extern "C" { +#endif + /* Helper constants for enums */ #define _PB_CommandStatus_MIN PB_CommandStatus_OK #define _PB_CommandStatus_MAX PB_CommandStatus_ERROR_GPIO_UNKNOWN_PIN_MODE #define _PB_CommandStatus_ARRAYSIZE ((PB_CommandStatus)(PB_CommandStatus_ERROR_GPIO_UNKNOWN_PIN_MODE+1)) -#ifdef __cplusplus -extern "C" { -#endif + +#define PB_Main_command_status_ENUMTYPE PB_CommandStatus + + + /* Initializer values for message structs */ #define PB_Empty_init_default {0} @@ -169,8 +181,6 @@ extern "C" { #define PB_Region_Band_init_zero {0, 0, 0, 0} /* Field tags (for use in manual encoding/decoding) */ -#define PB_Region_country_code_tag 1 -#define PB_Region_bands_tag 2 #define PB_Main_command_id_tag 1 #define PB_Main_command_status_tag 2 #define PB_Main_has_next_tag 3 @@ -236,6 +246,13 @@ extern "C" { #define PB_Main_app_get_error_request_tag 63 #define PB_Main_app_get_error_response_tag 64 #define PB_Main_app_data_exchange_request_tag 65 +#define PB_Main_desktop_is_locked_request_tag 66 +#define PB_Main_desktop_unlock_request_tag 67 +#define PB_Main_desktop_status_subscribe_request_tag 68 +#define PB_Main_desktop_status_unsubscribe_request_tag 69 +#define PB_Main_desktop_status_tag 70 +#define PB_Region_country_code_tag 1 +#define PB_Region_bands_tag 2 #define PB_Region_Band_start_tag 1 #define PB_Region_Band_end_tag 2 #define PB_Region_Band_power_limit_tag 3 @@ -317,7 +334,12 @@ X(a, STATIC, ONEOF, MSG_W_CB, (content,property_get_request,content.propert X(a, STATIC, ONEOF, MSG_W_CB, (content,property_get_response,content.property_get_response), 62) \ X(a, STATIC, ONEOF, MSG_W_CB, (content,app_get_error_request,content.app_get_error_request), 63) \ X(a, STATIC, ONEOF, MSG_W_CB, (content,app_get_error_response,content.app_get_error_response), 64) \ -X(a, STATIC, ONEOF, MSG_W_CB, (content,app_data_exchange_request,content.app_data_exchange_request), 65) +X(a, STATIC, ONEOF, MSG_W_CB, (content,app_data_exchange_request,content.app_data_exchange_request), 65) \ +X(a, STATIC, ONEOF, MSG_W_CB, (content,desktop_is_locked_request,content.desktop_is_locked_request), 66) \ +X(a, STATIC, ONEOF, MSG_W_CB, (content,desktop_unlock_request,content.desktop_unlock_request), 67) \ +X(a, STATIC, ONEOF, MSG_W_CB, (content,desktop_status_subscribe_request,content.desktop_status_subscribe_request), 68) \ +X(a, STATIC, ONEOF, MSG_W_CB, (content,desktop_status_unsubscribe_request,content.desktop_status_unsubscribe_request), 69) \ +X(a, STATIC, ONEOF, MSG_W_CB, (content,desktop_status,content.desktop_status), 70) #define PB_Main_CALLBACK NULL #define PB_Main_DEFAULT NULL #define PB_Main_content_empty_MSGTYPE PB_Empty @@ -382,6 +404,11 @@ X(a, STATIC, ONEOF, MSG_W_CB, (content,app_data_exchange_request,content.ap #define PB_Main_content_app_get_error_request_MSGTYPE PB_App_GetErrorRequest #define PB_Main_content_app_get_error_response_MSGTYPE PB_App_GetErrorResponse #define PB_Main_content_app_data_exchange_request_MSGTYPE PB_App_DataExchangeRequest +#define PB_Main_content_desktop_is_locked_request_MSGTYPE PB_Desktop_IsLockedRequest +#define PB_Main_content_desktop_unlock_request_MSGTYPE PB_Desktop_UnlockRequest +#define PB_Main_content_desktop_status_subscribe_request_MSGTYPE PB_Desktop_StatusSubscribeRequest +#define PB_Main_content_desktop_status_unsubscribe_request_MSGTYPE PB_Desktop_StatusUnsubscribeRequest +#define PB_Main_content_desktop_status_MSGTYPE PB_Desktop_Status #define PB_Region_FIELDLIST(X, a) \ X(a, POINTER, SINGULAR, BYTES, country_code, 1) \ @@ -413,10 +440,11 @@ extern const pb_msgdesc_t PB_Region_Band_msg; /* Maximum encoded size of messages (where known) */ #if defined(PB_System_PingRequest_size) && defined(PB_System_PingResponse_size) && 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) && defined(PB_App_StartRequest_size) && defined(PB_Gui_ScreenFrame_size) && defined(PB_Storage_StatRequest_size) && defined(PB_Storage_StatResponse_size) && defined(PB_Gui_StartVirtualDisplayRequest_size) && defined(PB_Storage_InfoRequest_size) && defined(PB_Storage_RenameRequest_size) && defined(PB_System_DeviceInfoResponse_size) && defined(PB_System_UpdateRequest_size) && defined(PB_Storage_BackupCreateRequest_size) && defined(PB_Storage_BackupRestoreRequest_size) && defined(PB_System_PowerInfoResponse_size) && defined(PB_Storage_TimestampRequest_size) && defined(PB_Property_GetRequest_size) && defined(PB_Property_GetResponse_size) && defined(PB_App_GetErrorResponse_size) && defined(PB_App_DataExchangeRequest_size) -union PB_Main_content_size_union {char f5[(6 + PB_System_PingRequest_size)]; char f6[(6 + PB_System_PingResponse_size)]; 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 f16[(7 + PB_App_StartRequest_size)]; char f22[(7 + PB_Gui_ScreenFrame_size)]; char f24[(7 + PB_Storage_StatRequest_size)]; char f25[(7 + PB_Storage_StatResponse_size)]; char f26[(7 + PB_Gui_StartVirtualDisplayRequest_size)]; char f28[(7 + PB_Storage_InfoRequest_size)]; char f30[(7 + PB_Storage_RenameRequest_size)]; char f33[(7 + PB_System_DeviceInfoResponse_size)]; char f41[(7 + PB_System_UpdateRequest_size)]; char f42[(7 + PB_Storage_BackupCreateRequest_size)]; char f43[(7 + PB_Storage_BackupRestoreRequest_size)]; char f45[(7 + PB_System_PowerInfoResponse_size)]; char f59[(7 + PB_Storage_TimestampRequest_size)]; char f61[(7 + PB_Property_GetRequest_size)]; char f62[(7 + PB_Property_GetResponse_size)]; char f64[(7 + PB_App_GetErrorResponse_size)]; char f65[(7 + PB_App_DataExchangeRequest_size)]; char f0[519];}; +union PB_Main_content_size_union {char f5[(6 + PB_System_PingRequest_size)]; char f6[(6 + PB_System_PingResponse_size)]; 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 f16[(7 + PB_App_StartRequest_size)]; char f22[(7 + PB_Gui_ScreenFrame_size)]; char f24[(7 + PB_Storage_StatRequest_size)]; char f25[(7 + PB_Storage_StatResponse_size)]; char f26[(7 + PB_Gui_StartVirtualDisplayRequest_size)]; char f28[(7 + PB_Storage_InfoRequest_size)]; char f30[(7 + PB_Storage_RenameRequest_size)]; char f33[(7 + PB_System_DeviceInfoResponse_size)]; char f41[(7 + PB_System_UpdateRequest_size)]; char f42[(7 + PB_Storage_BackupCreateRequest_size)]; char f43[(7 + PB_Storage_BackupRestoreRequest_size)]; char f45[(7 + PB_System_PowerInfoResponse_size)]; char f59[(7 + PB_Storage_TimestampRequest_size)]; char f61[(7 + PB_Property_GetRequest_size)]; char f62[(7 + PB_Property_GetResponse_size)]; char f64[(7 + PB_App_GetErrorResponse_size)]; char f65[(7 + PB_App_DataExchangeRequest_size)]; char f0[530];}; #endif /* PB_Region_size depends on runtime parameters */ #define PB_Empty_size 0 +#define PB_FLIPPER_PB_H_MAX_SIZE PB_Region_Band_size #define PB_Region_Band_size 26 #define PB_StopSession_size 0 #if defined(PB_System_PingRequest_size) && defined(PB_System_PingResponse_size) && 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) && defined(PB_App_StartRequest_size) && defined(PB_Gui_ScreenFrame_size) && defined(PB_Storage_StatRequest_size) && defined(PB_Storage_StatResponse_size) && defined(PB_Gui_StartVirtualDisplayRequest_size) && defined(PB_Storage_InfoRequest_size) && defined(PB_Storage_RenameRequest_size) && defined(PB_System_DeviceInfoResponse_size) && defined(PB_System_UpdateRequest_size) && defined(PB_Storage_BackupCreateRequest_size) && defined(PB_Storage_BackupRestoreRequest_size) && defined(PB_System_PowerInfoResponse_size) && defined(PB_Storage_TimestampRequest_size) && defined(PB_Property_GetRequest_size) && defined(PB_Property_GetResponse_size) && defined(PB_App_GetErrorResponse_size) && defined(PB_App_DataExchangeRequest_size) diff --git a/plugins/flipperproto0/messages/gpio.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.c similarity index 94% rename from plugins/flipperproto0/messages/gpio.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.c index 121ead0b..c20c16a8 100644 --- a/plugins/flipperproto0/messages/gpio.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "gpio.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/gpio.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.h similarity index 78% rename from plugins/flipperproto0/messages/gpio.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.h index fa6d419f..d439b1ff 100644 --- a/plugins/flipperproto0/messages/gpio.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/gpio.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_GPIO_GPIO_PB_H_INCLUDED #define PB_PB_GPIO_GPIO_PB_H_INCLUDED @@ -10,61 +10,65 @@ #endif /* Enum definitions */ -typedef enum _PB_Gpio_GpioPin { - PB_Gpio_GpioPin_PC0 = 0, - PB_Gpio_GpioPin_PC1 = 1, - PB_Gpio_GpioPin_PC3 = 2, - PB_Gpio_GpioPin_PB2 = 3, - PB_Gpio_GpioPin_PB3 = 4, - PB_Gpio_GpioPin_PA4 = 5, - PB_Gpio_GpioPin_PA6 = 6, - PB_Gpio_GpioPin_PA7 = 7 +typedef enum _PB_Gpio_GpioPin { + PB_Gpio_GpioPin_PC0 = 0, + PB_Gpio_GpioPin_PC1 = 1, + PB_Gpio_GpioPin_PC3 = 2, + PB_Gpio_GpioPin_PB2 = 3, + PB_Gpio_GpioPin_PB3 = 4, + PB_Gpio_GpioPin_PA4 = 5, + PB_Gpio_GpioPin_PA6 = 6, + PB_Gpio_GpioPin_PA7 = 7 } PB_Gpio_GpioPin; -typedef enum _PB_Gpio_GpioPinMode { - PB_Gpio_GpioPinMode_OUTPUT = 0, - PB_Gpio_GpioPinMode_INPUT = 1 +typedef enum _PB_Gpio_GpioPinMode { + PB_Gpio_GpioPinMode_OUTPUT = 0, + PB_Gpio_GpioPinMode_INPUT = 1 } PB_Gpio_GpioPinMode; -typedef enum _PB_Gpio_GpioInputPull { - PB_Gpio_GpioInputPull_NO = 0, - PB_Gpio_GpioInputPull_UP = 1, - PB_Gpio_GpioInputPull_DOWN = 2 +typedef enum _PB_Gpio_GpioInputPull { + PB_Gpio_GpioInputPull_NO = 0, + PB_Gpio_GpioInputPull_UP = 1, + PB_Gpio_GpioInputPull_DOWN = 2 } PB_Gpio_GpioInputPull; /* Struct definitions */ -typedef struct _PB_Gpio_GetPinMode { - PB_Gpio_GpioPin pin; +typedef struct _PB_Gpio_SetPinMode { + PB_Gpio_GpioPin pin; + PB_Gpio_GpioPinMode mode; +} PB_Gpio_SetPinMode; + +typedef struct _PB_Gpio_SetInputPull { + PB_Gpio_GpioPin pin; + PB_Gpio_GpioInputPull pull_mode; +} PB_Gpio_SetInputPull; + +typedef struct _PB_Gpio_GetPinMode { + PB_Gpio_GpioPin pin; } PB_Gpio_GetPinMode; -typedef struct _PB_Gpio_GetPinModeResponse { - PB_Gpio_GpioPinMode mode; +typedef struct _PB_Gpio_GetPinModeResponse { + PB_Gpio_GpioPinMode mode; } PB_Gpio_GetPinModeResponse; -typedef struct _PB_Gpio_ReadPin { - PB_Gpio_GpioPin pin; +typedef struct _PB_Gpio_ReadPin { + PB_Gpio_GpioPin pin; } PB_Gpio_ReadPin; -typedef struct _PB_Gpio_ReadPinResponse { - uint32_t value; +typedef struct _PB_Gpio_ReadPinResponse { + uint32_t value; } PB_Gpio_ReadPinResponse; -typedef struct _PB_Gpio_SetInputPull { - PB_Gpio_GpioPin pin; - PB_Gpio_GpioInputPull pull_mode; -} PB_Gpio_SetInputPull; - -typedef struct _PB_Gpio_SetPinMode { - PB_Gpio_GpioPin pin; - PB_Gpio_GpioPinMode mode; -} PB_Gpio_SetPinMode; - -typedef struct _PB_Gpio_WritePin { - PB_Gpio_GpioPin pin; - uint32_t value; +typedef struct _PB_Gpio_WritePin { + PB_Gpio_GpioPin pin; + uint32_t value; } PB_Gpio_WritePin; +#ifdef __cplusplus +extern "C" { +#endif + /* Helper constants for enums */ #define _PB_Gpio_GpioPin_MIN PB_Gpio_GpioPin_PC0 #define _PB_Gpio_GpioPin_MAX PB_Gpio_GpioPin_PA7 @@ -78,10 +82,21 @@ typedef struct _PB_Gpio_WritePin { #define _PB_Gpio_GpioInputPull_MAX PB_Gpio_GpioInputPull_DOWN #define _PB_Gpio_GpioInputPull_ARRAYSIZE ((PB_Gpio_GpioInputPull)(PB_Gpio_GpioInputPull_DOWN+1)) +#define PB_Gpio_SetPinMode_pin_ENUMTYPE PB_Gpio_GpioPin +#define PB_Gpio_SetPinMode_mode_ENUMTYPE PB_Gpio_GpioPinMode + +#define PB_Gpio_SetInputPull_pin_ENUMTYPE PB_Gpio_GpioPin +#define PB_Gpio_SetInputPull_pull_mode_ENUMTYPE PB_Gpio_GpioInputPull + +#define PB_Gpio_GetPinMode_pin_ENUMTYPE PB_Gpio_GpioPin + +#define PB_Gpio_GetPinModeResponse_mode_ENUMTYPE PB_Gpio_GpioPinMode + +#define PB_Gpio_ReadPin_pin_ENUMTYPE PB_Gpio_GpioPin + + +#define PB_Gpio_WritePin_pin_ENUMTYPE PB_Gpio_GpioPin -#ifdef __cplusplus -extern "C" { -#endif /* Initializer values for message structs */ #define PB_Gpio_SetPinMode_init_default {_PB_Gpio_GpioPin_MIN, _PB_Gpio_GpioPinMode_MIN} @@ -100,14 +115,14 @@ extern "C" { #define PB_Gpio_WritePin_init_zero {_PB_Gpio_GpioPin_MIN, 0} /* Field tags (for use in manual encoding/decoding) */ +#define PB_Gpio_SetPinMode_pin_tag 1 +#define PB_Gpio_SetPinMode_mode_tag 2 +#define PB_Gpio_SetInputPull_pin_tag 1 +#define PB_Gpio_SetInputPull_pull_mode_tag 2 #define PB_Gpio_GetPinMode_pin_tag 1 #define PB_Gpio_GetPinModeResponse_mode_tag 1 #define PB_Gpio_ReadPin_pin_tag 1 #define PB_Gpio_ReadPinResponse_value_tag 2 -#define PB_Gpio_SetInputPull_pin_tag 1 -#define PB_Gpio_SetInputPull_pull_mode_tag 2 -#define PB_Gpio_SetPinMode_pin_tag 1 -#define PB_Gpio_SetPinMode_mode_tag 2 #define PB_Gpio_WritePin_pin_tag 1 #define PB_Gpio_WritePin_value_tag 2 @@ -168,6 +183,7 @@ extern const pb_msgdesc_t PB_Gpio_WritePin_msg; #define PB_Gpio_WritePin_fields &PB_Gpio_WritePin_msg /* Maximum encoded size of messages (where known) */ +#define PB_GPIO_GPIO_PB_H_MAX_SIZE PB_Gpio_WritePin_size #define PB_Gpio_GetPinModeResponse_size 2 #define PB_Gpio_GetPinMode_size 2 #define PB_Gpio_ReadPinResponse_size 6 diff --git a/plugins/flipperproto0/messages/gui.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.c similarity index 94% rename from plugins/flipperproto0/messages/gui.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.c index 3cfebaa4..4a0ced39 100644 --- a/plugins/flipperproto0/messages/gui.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "gui.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/gui.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.h similarity index 78% rename from plugins/flipperproto0/messages/gui.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.h index d5fde849..85d97f53 100644 --- a/plugins/flipperproto0/messages/gui.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/gui.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_GUI_GUI_PB_H_INCLUDED #define PB_PB_GUI_GUI_PB_H_INCLUDED @@ -10,58 +10,63 @@ #endif /* Enum definitions */ -typedef enum _PB_Gui_InputKey { - PB_Gui_InputKey_UP = 0, - PB_Gui_InputKey_DOWN = 1, - PB_Gui_InputKey_RIGHT = 2, - PB_Gui_InputKey_LEFT = 3, - PB_Gui_InputKey_OK = 4, - PB_Gui_InputKey_BACK = 5 +typedef enum _PB_Gui_InputKey { + PB_Gui_InputKey_UP = 0, + PB_Gui_InputKey_DOWN = 1, + PB_Gui_InputKey_RIGHT = 2, + PB_Gui_InputKey_LEFT = 3, + PB_Gui_InputKey_OK = 4, + PB_Gui_InputKey_BACK = 5 } PB_Gui_InputKey; -typedef enum _PB_Gui_InputType { - PB_Gui_InputType_PRESS = 0, /* *< Press event, emitted after debounce */ - PB_Gui_InputType_RELEASE = 1, /* *< Release event, emitted after debounce */ +typedef enum _PB_Gui_InputType { + PB_Gui_InputType_PRESS = 0, /* *< Press event, emitted after de-bounce */ + PB_Gui_InputType_RELEASE = 1, /* *< Release event, emitted after de-bounce */ PB_Gui_InputType_SHORT = 2, /* *< Short event, emitted after InputTypeRelease done withing INPUT_LONG_PRESS interval */ - PB_Gui_InputType_LONG = 3, /* *< Long event, emmited after INPUT_LONG_PRESS interval, asynchronouse to InputTypeRelease */ - PB_Gui_InputType_REPEAT = 4 /* *< Repeat event, emmited with INPUT_REPEATE_PRESS period after InputTypeLong event */ + PB_Gui_InputType_LONG = 3, /* *< Long event, emitted after INPUT_LONG_PRESS interval, asynchronous to InputTypeRelease */ + PB_Gui_InputType_REPEAT = 4 /* *< Repeat event, emitted with INPUT_REPEATE_PRESS period after InputTypeLong event */ } PB_Gui_InputType; -typedef enum _PB_Gui_ScreenOrientation { +typedef enum _PB_Gui_ScreenOrientation { PB_Gui_ScreenOrientation_HORIZONTAL = 0, /* *< Horizontal */ PB_Gui_ScreenOrientation_HORIZONTAL_FLIP = 1, /* *< Horizontal flipped (180) */ PB_Gui_ScreenOrientation_VERTICAL = 2, /* *< Vertical (90) */ - PB_Gui_ScreenOrientation_VERTICAL_FLIP = 3 /* *< Vertical flipped */ + PB_Gui_ScreenOrientation_VERTICAL_FLIP = 3 /* *< Vertical flipped (270) */ } PB_Gui_ScreenOrientation; /* Struct definitions */ -typedef struct _PB_Gui_StartScreenStreamRequest { +typedef struct _PB_Gui_ScreenFrame { + pb_bytes_array_t *data; + PB_Gui_ScreenOrientation orientation; +} PB_Gui_ScreenFrame; + +typedef struct _PB_Gui_StartScreenStreamRequest { char dummy_field; } PB_Gui_StartScreenStreamRequest; -typedef struct _PB_Gui_StopScreenStreamRequest { +typedef struct _PB_Gui_StopScreenStreamRequest { char dummy_field; } PB_Gui_StopScreenStreamRequest; -typedef struct _PB_Gui_StopVirtualDisplayRequest { - char dummy_field; -} PB_Gui_StopVirtualDisplayRequest; - -typedef struct _PB_Gui_ScreenFrame { - pb_bytes_array_t *data; - PB_Gui_ScreenOrientation orientation; -} PB_Gui_ScreenFrame; - -typedef struct _PB_Gui_SendInputEventRequest { - PB_Gui_InputKey key; - PB_Gui_InputType type; +typedef struct _PB_Gui_SendInputEventRequest { + PB_Gui_InputKey key; + PB_Gui_InputType type; } PB_Gui_SendInputEventRequest; -typedef struct _PB_Gui_StartVirtualDisplayRequest { +typedef struct _PB_Gui_StartVirtualDisplayRequest { bool has_first_frame; - PB_Gui_ScreenFrame first_frame; /* optional */ + PB_Gui_ScreenFrame first_frame; /* *< Optional: screen frame to show */ + bool send_input; /* *< Optional: send flipper input */ } PB_Gui_StartVirtualDisplayRequest; +typedef struct _PB_Gui_StopVirtualDisplayRequest { + char dummy_field; +} PB_Gui_StopVirtualDisplayRequest; + + +#ifdef __cplusplus +extern "C" { +#endif /* Helper constants for enums */ #define _PB_Gui_InputKey_MIN PB_Gui_InputKey_UP @@ -76,23 +81,28 @@ typedef struct _PB_Gui_StartVirtualDisplayRequest { #define _PB_Gui_ScreenOrientation_MAX PB_Gui_ScreenOrientation_VERTICAL_FLIP #define _PB_Gui_ScreenOrientation_ARRAYSIZE ((PB_Gui_ScreenOrientation)(PB_Gui_ScreenOrientation_VERTICAL_FLIP+1)) +#define PB_Gui_ScreenFrame_orientation_ENUMTYPE PB_Gui_ScreenOrientation + + + +#define PB_Gui_SendInputEventRequest_key_ENUMTYPE PB_Gui_InputKey +#define PB_Gui_SendInputEventRequest_type_ENUMTYPE PB_Gui_InputType + + -#ifdef __cplusplus -extern "C" { -#endif /* Initializer values for message structs */ #define PB_Gui_ScreenFrame_init_default {NULL, _PB_Gui_ScreenOrientation_MIN} #define PB_Gui_StartScreenStreamRequest_init_default {0} #define PB_Gui_StopScreenStreamRequest_init_default {0} #define PB_Gui_SendInputEventRequest_init_default {_PB_Gui_InputKey_MIN, _PB_Gui_InputType_MIN} -#define PB_Gui_StartVirtualDisplayRequest_init_default {false, PB_Gui_ScreenFrame_init_default} +#define PB_Gui_StartVirtualDisplayRequest_init_default {false, PB_Gui_ScreenFrame_init_default, 0} #define PB_Gui_StopVirtualDisplayRequest_init_default {0} #define PB_Gui_ScreenFrame_init_zero {NULL, _PB_Gui_ScreenOrientation_MIN} #define PB_Gui_StartScreenStreamRequest_init_zero {0} #define PB_Gui_StopScreenStreamRequest_init_zero {0} #define PB_Gui_SendInputEventRequest_init_zero {_PB_Gui_InputKey_MIN, _PB_Gui_InputType_MIN} -#define PB_Gui_StartVirtualDisplayRequest_init_zero {false, PB_Gui_ScreenFrame_init_zero} +#define PB_Gui_StartVirtualDisplayRequest_init_zero {false, PB_Gui_ScreenFrame_init_zero, 0} #define PB_Gui_StopVirtualDisplayRequest_init_zero {0} /* Field tags (for use in manual encoding/decoding) */ @@ -101,6 +111,7 @@ extern "C" { #define PB_Gui_SendInputEventRequest_key_tag 1 #define PB_Gui_SendInputEventRequest_type_tag 2 #define PB_Gui_StartVirtualDisplayRequest_first_frame_tag 1 +#define PB_Gui_StartVirtualDisplayRequest_send_input_tag 2 /* Struct field encoding specification for nanopb */ #define PB_Gui_ScreenFrame_FIELDLIST(X, a) \ @@ -126,7 +137,8 @@ X(a, STATIC, SINGULAR, UENUM, type, 2) #define PB_Gui_SendInputEventRequest_DEFAULT NULL #define PB_Gui_StartVirtualDisplayRequest_FIELDLIST(X, a) \ -X(a, STATIC, OPTIONAL, MESSAGE, first_frame, 1) +X(a, STATIC, OPTIONAL, MESSAGE, first_frame, 1) \ +X(a, STATIC, SINGULAR, BOOL, send_input, 2) #define PB_Gui_StartVirtualDisplayRequest_CALLBACK NULL #define PB_Gui_StartVirtualDisplayRequest_DEFAULT NULL #define PB_Gui_StartVirtualDisplayRequest_first_frame_MSGTYPE PB_Gui_ScreenFrame @@ -154,6 +166,7 @@ extern const pb_msgdesc_t PB_Gui_StopVirtualDisplayRequest_msg; /* Maximum encoded size of messages (where known) */ /* PB_Gui_ScreenFrame_size depends on runtime parameters */ /* PB_Gui_StartVirtualDisplayRequest_size depends on runtime parameters */ +#define PB_GUI_GUI_PB_H_MAX_SIZE PB_Gui_SendInputEventRequest_size #define PB_Gui_SendInputEventRequest_size 4 #define PB_Gui_StartScreenStreamRequest_size 0 #define PB_Gui_StopScreenStreamRequest_size 0 diff --git a/plugins/flipperproto0/messages/property.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.c similarity index 90% rename from plugins/flipperproto0/messages/property.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.c index 0668bac4..39cdf421 100644 --- a/plugins/flipperproto0/messages/property.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "property.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/property.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.h similarity index 91% rename from plugins/flipperproto0/messages/property.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.h index 14b47277..a746ef33 100644 --- a/plugins/flipperproto0/messages/property.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/property.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_PROPERTY_PROPERTY_PB_H_INCLUDED #define PB_PB_PROPERTY_PROPERTY_PB_H_INCLUDED @@ -10,13 +10,13 @@ #endif /* Struct definitions */ -typedef struct _PB_Property_GetRequest { - char *key; +typedef struct _PB_Property_GetRequest { + char *key; } PB_Property_GetRequest; -typedef struct _PB_Property_GetResponse { - char *key; - char *value; +typedef struct _PB_Property_GetResponse { + char *key; + char *value; } PB_Property_GetResponse; diff --git a/plugins/flipperproto0/messages/status.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/status.pb.c similarity index 100% rename from plugins/flipperproto0/messages/status.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/status.pb.c diff --git a/plugins/flipperproto0/messages/status.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/status.pb.h similarity index 100% rename from plugins/flipperproto0/messages/status.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/status.pb.h diff --git a/plugins/flipperproto0/messages/storage.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.c similarity index 93% rename from plugins/flipperproto0/messages/storage.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.c index bcb1e8b8..95abfc95 100644 --- a/plugins/flipperproto0/messages/storage.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "storage.pb.h" #if PB_PROTO_HEADER_VERSION != 40 @@ -30,7 +30,7 @@ PB_BIND(PB_Storage_StatResponse, PB_Storage_StatResponse, AUTO) PB_BIND(PB_Storage_ListRequest, PB_Storage_ListRequest, AUTO) -PB_BIND(PB_Storage_ListResponse, PB_Storage_ListResponse, AUTO) +PB_BIND(PB_Storage_ListResponse, PB_Storage_ListResponse, 2) PB_BIND(PB_Storage_ReadRequest, PB_Storage_ReadRequest, AUTO) diff --git a/plugins/flipperproto0/messages/storage.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.h similarity index 84% rename from plugins/flipperproto0/messages/storage.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.h index 9556096b..aac14ede 100644 --- a/plugins/flipperproto0/messages/storage.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/storage.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_STORAGE_STORAGE_PB_H_INCLUDED #define PB_PB_STORAGE_STORAGE_PB_H_INCLUDED @@ -10,119 +10,142 @@ #endif /* Enum definitions */ -typedef enum _PB_Storage_File_FileType { - PB_Storage_File_FileType_FILE = 0, - PB_Storage_File_FileType_DIR = 1 +typedef enum _PB_Storage_File_FileType { + PB_Storage_File_FileType_FILE = 0, /* default value */ + PB_Storage_File_FileType_DIR = 1 } PB_Storage_File_FileType; /* Struct definitions */ -typedef struct _PB_Storage_BackupCreateRequest { - char *archive_path; -} PB_Storage_BackupCreateRequest; - -typedef struct _PB_Storage_BackupRestoreRequest { - char *archive_path; -} PB_Storage_BackupRestoreRequest; +typedef struct _PB_Storage_File { + PB_Storage_File_FileType type; + char *name; + uint32_t size; + pb_bytes_array_t *data; + char md5sum[33]; +} PB_Storage_File; -typedef struct _PB_Storage_InfoRequest { - char *path; +typedef struct _PB_Storage_InfoRequest { + char *path; } PB_Storage_InfoRequest; -typedef struct _PB_Storage_ListRequest { - char *path; -} PB_Storage_ListRequest; +typedef struct _PB_Storage_InfoResponse { + uint64_t total_space; + uint64_t free_space; +} PB_Storage_InfoResponse; -typedef struct _PB_Storage_Md5sumRequest { - char *path; -} PB_Storage_Md5sumRequest; +typedef struct _PB_Storage_TimestampRequest { + char *path; +} PB_Storage_TimestampRequest; -typedef struct _PB_Storage_MkdirRequest { - char *path; -} PB_Storage_MkdirRequest; +typedef struct _PB_Storage_TimestampResponse { + uint32_t timestamp; +} PB_Storage_TimestampResponse; -typedef struct _PB_Storage_ReadRequest { - char *path; -} PB_Storage_ReadRequest; +typedef struct _PB_Storage_StatRequest { + char *path; +} PB_Storage_StatRequest; -typedef struct _PB_Storage_RenameRequest { - char *old_path; - char *new_path; -} PB_Storage_RenameRequest; +typedef struct _PB_Storage_StatResponse { + bool has_file; + PB_Storage_File file; +} PB_Storage_StatResponse; -typedef struct _PB_Storage_StatRequest { - char *path; -} PB_Storage_StatRequest; +typedef struct _PB_Storage_ListRequest { + char *path; + bool include_md5; + uint32_t filter_max_size; +} PB_Storage_ListRequest; -typedef struct _PB_Storage_TimestampRequest { - char *path; -} PB_Storage_TimestampRequest; +typedef struct _PB_Storage_ListResponse { + pb_size_t file_count; + PB_Storage_File file[8]; +} PB_Storage_ListResponse; -typedef struct _PB_Storage_DeleteRequest { - char *path; - bool recursive; +typedef struct _PB_Storage_ReadRequest { + char *path; +} PB_Storage_ReadRequest; + +typedef struct _PB_Storage_ReadResponse { + bool has_file; + PB_Storage_File file; +} PB_Storage_ReadResponse; + +typedef struct _PB_Storage_WriteRequest { + char *path; + bool has_file; + PB_Storage_File file; +} PB_Storage_WriteRequest; + +typedef struct _PB_Storage_DeleteRequest { + char *path; + bool recursive; } PB_Storage_DeleteRequest; -typedef struct _PB_Storage_File { - PB_Storage_File_FileType type; - char *name; - uint32_t size; - pb_bytes_array_t *data; -} PB_Storage_File; +typedef struct _PB_Storage_MkdirRequest { + char *path; +} PB_Storage_MkdirRequest; -typedef struct _PB_Storage_InfoResponse { - uint64_t total_space; - uint64_t free_space; -} PB_Storage_InfoResponse; +typedef struct _PB_Storage_Md5sumRequest { + char *path; +} PB_Storage_Md5sumRequest; -typedef struct _PB_Storage_Md5sumResponse { - char md5sum[33]; +typedef struct _PB_Storage_Md5sumResponse { + char md5sum[33]; } PB_Storage_Md5sumResponse; -typedef struct _PB_Storage_TimestampResponse { - uint32_t timestamp; -} PB_Storage_TimestampResponse; - -typedef struct _PB_Storage_ListResponse { - pb_size_t file_count; - PB_Storage_File file[8]; -} PB_Storage_ListResponse; +typedef struct _PB_Storage_RenameRequest { + char *old_path; + char *new_path; +} PB_Storage_RenameRequest; -typedef struct _PB_Storage_ReadResponse { - bool has_file; - PB_Storage_File file; -} PB_Storage_ReadResponse; +typedef struct _PB_Storage_BackupCreateRequest { + char *archive_path; +} PB_Storage_BackupCreateRequest; -typedef struct _PB_Storage_StatResponse { - bool has_file; - PB_Storage_File file; -} PB_Storage_StatResponse; +typedef struct _PB_Storage_BackupRestoreRequest { + char *archive_path; +} PB_Storage_BackupRestoreRequest; -typedef struct _PB_Storage_WriteRequest { - char *path; - bool has_file; - PB_Storage_File file; -} PB_Storage_WriteRequest; +#ifdef __cplusplus +extern "C" { +#endif /* Helper constants for enums */ #define _PB_Storage_File_FileType_MIN PB_Storage_File_FileType_FILE #define _PB_Storage_File_FileType_MAX PB_Storage_File_FileType_DIR #define _PB_Storage_File_FileType_ARRAYSIZE ((PB_Storage_File_FileType)(PB_Storage_File_FileType_DIR+1)) +#define PB_Storage_File_type_ENUMTYPE PB_Storage_File_FileType + + + + + + + + + + + + + + + + + + -#ifdef __cplusplus -extern "C" { -#endif /* Initializer values for message structs */ -#define PB_Storage_File_init_default {_PB_Storage_File_FileType_MIN, NULL, 0, NULL} +#define PB_Storage_File_init_default {_PB_Storage_File_FileType_MIN, NULL, 0, NULL, ""} #define PB_Storage_InfoRequest_init_default {NULL} #define PB_Storage_InfoResponse_init_default {0, 0} #define PB_Storage_TimestampRequest_init_default {NULL} #define PB_Storage_TimestampResponse_init_default {0} #define PB_Storage_StatRequest_init_default {NULL} #define PB_Storage_StatResponse_init_default {false, PB_Storage_File_init_default} -#define PB_Storage_ListRequest_init_default {NULL} +#define PB_Storage_ListRequest_init_default {NULL, 0, 0} #define PB_Storage_ListResponse_init_default {0, {PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default, PB_Storage_File_init_default}} #define PB_Storage_ReadRequest_init_default {NULL} #define PB_Storage_ReadResponse_init_default {false, PB_Storage_File_init_default} @@ -134,14 +157,14 @@ extern "C" { #define PB_Storage_RenameRequest_init_default {NULL, NULL} #define PB_Storage_BackupCreateRequest_init_default {NULL} #define PB_Storage_BackupRestoreRequest_init_default {NULL} -#define PB_Storage_File_init_zero {_PB_Storage_File_FileType_MIN, NULL, 0, NULL} +#define PB_Storage_File_init_zero {_PB_Storage_File_FileType_MIN, NULL, 0, NULL, ""} #define PB_Storage_InfoRequest_init_zero {NULL} #define PB_Storage_InfoResponse_init_zero {0, 0} #define PB_Storage_TimestampRequest_init_zero {NULL} #define PB_Storage_TimestampResponse_init_zero {0} #define PB_Storage_StatRequest_init_zero {NULL} #define PB_Storage_StatResponse_init_zero {false, PB_Storage_File_init_zero} -#define PB_Storage_ListRequest_init_zero {NULL} +#define PB_Storage_ListRequest_init_zero {NULL, 0, 0} #define PB_Storage_ListResponse_init_zero {0, {PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero, PB_Storage_File_init_zero}} #define PB_Storage_ReadRequest_init_zero {NULL} #define PB_Storage_ReadResponse_init_zero {false, PB_Storage_File_init_zero} @@ -155,39 +178,43 @@ extern "C" { #define PB_Storage_BackupRestoreRequest_init_zero {NULL} /* Field tags (for use in manual encoding/decoding) */ -#define PB_Storage_BackupCreateRequest_archive_path_tag 1 -#define PB_Storage_BackupRestoreRequest_archive_path_tag 1 -#define PB_Storage_InfoRequest_path_tag 1 -#define PB_Storage_ListRequest_path_tag 1 -#define PB_Storage_Md5sumRequest_path_tag 1 -#define PB_Storage_MkdirRequest_path_tag 1 -#define PB_Storage_ReadRequest_path_tag 1 -#define PB_Storage_RenameRequest_old_path_tag 1 -#define PB_Storage_RenameRequest_new_path_tag 2 -#define PB_Storage_StatRequest_path_tag 1 -#define PB_Storage_TimestampRequest_path_tag 1 -#define PB_Storage_DeleteRequest_path_tag 1 -#define PB_Storage_DeleteRequest_recursive_tag 2 #define PB_Storage_File_type_tag 1 #define PB_Storage_File_name_tag 2 #define PB_Storage_File_size_tag 3 #define PB_Storage_File_data_tag 4 +#define PB_Storage_File_md5sum_tag 5 +#define PB_Storage_InfoRequest_path_tag 1 #define PB_Storage_InfoResponse_total_space_tag 1 #define PB_Storage_InfoResponse_free_space_tag 2 -#define PB_Storage_Md5sumResponse_md5sum_tag 1 +#define PB_Storage_TimestampRequest_path_tag 1 #define PB_Storage_TimestampResponse_timestamp_tag 1 +#define PB_Storage_StatRequest_path_tag 1 +#define PB_Storage_StatResponse_file_tag 1 +#define PB_Storage_ListRequest_path_tag 1 +#define PB_Storage_ListRequest_include_md5_tag 2 +#define PB_Storage_ListRequest_filter_max_size_tag 3 #define PB_Storage_ListResponse_file_tag 1 +#define PB_Storage_ReadRequest_path_tag 1 #define PB_Storage_ReadResponse_file_tag 1 -#define PB_Storage_StatResponse_file_tag 1 #define PB_Storage_WriteRequest_path_tag 1 #define PB_Storage_WriteRequest_file_tag 2 +#define PB_Storage_DeleteRequest_path_tag 1 +#define PB_Storage_DeleteRequest_recursive_tag 2 +#define PB_Storage_MkdirRequest_path_tag 1 +#define PB_Storage_Md5sumRequest_path_tag 1 +#define PB_Storage_Md5sumResponse_md5sum_tag 1 +#define PB_Storage_RenameRequest_old_path_tag 1 +#define PB_Storage_RenameRequest_new_path_tag 2 +#define PB_Storage_BackupCreateRequest_archive_path_tag 1 +#define PB_Storage_BackupRestoreRequest_archive_path_tag 1 /* Struct field encoding specification for nanopb */ #define PB_Storage_File_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, type, 1) \ X(a, POINTER, SINGULAR, STRING, name, 2) \ X(a, STATIC, SINGULAR, UINT32, size, 3) \ -X(a, POINTER, SINGULAR, BYTES, data, 4) +X(a, POINTER, SINGULAR, BYTES, data, 4) \ +X(a, STATIC, SINGULAR, STRING, md5sum, 5) #define PB_Storage_File_CALLBACK NULL #define PB_Storage_File_DEFAULT NULL @@ -224,7 +251,9 @@ X(a, STATIC, OPTIONAL, MESSAGE, file, 1) #define PB_Storage_StatResponse_file_MSGTYPE PB_Storage_File #define PB_Storage_ListRequest_FIELDLIST(X, a) \ -X(a, POINTER, SINGULAR, STRING, path, 1) +X(a, POINTER, SINGULAR, STRING, path, 1) \ +X(a, STATIC, SINGULAR, BOOL, include_md5, 2) \ +X(a, STATIC, SINGULAR, UINT32, filter_max_size, 3) #define PB_Storage_ListRequest_CALLBACK NULL #define PB_Storage_ListRequest_DEFAULT NULL @@ -347,6 +376,7 @@ extern const pb_msgdesc_t PB_Storage_BackupRestoreRequest_msg; /* PB_Storage_RenameRequest_size depends on runtime parameters */ /* PB_Storage_BackupCreateRequest_size depends on runtime parameters */ /* PB_Storage_BackupRestoreRequest_size depends on runtime parameters */ +#define PB_STORAGE_STORAGE_PB_H_MAX_SIZE PB_Storage_Md5sumResponse_size #define PB_Storage_InfoResponse_size 22 #define PB_Storage_Md5sumResponse_size 34 #define PB_Storage_TimestampResponse_size 6 diff --git a/plugins/flipperproto0/messages/system.pb.c b/plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.c similarity index 97% rename from plugins/flipperproto0/messages/system.pb.c rename to plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.c index 3b71eded..1fc0b5b5 100644 --- a/plugins/flipperproto0/messages/system.pb.c +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.c @@ -1,5 +1,5 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #include "system.pb.h" #if PB_PROTO_HEADER_VERSION != 40 diff --git a/plugins/flipperproto0/messages/system.pb.h b/plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.h similarity index 87% rename from plugins/flipperproto0/messages/system.pb.h rename to plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.h index e90b2e55..b77ba1c8 100644 --- a/plugins/flipperproto0/messages/system.pb.h +++ b/plugins/flipperproto0/flipperzero-protobuf-compiled/system.pb.h @@ -1,5 +1,5 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.6-dev */ +/* Generated by nanopb-0.4.9-dev */ #ifndef PB_PB_SYSTEM_SYSTEM_PB_H_INCLUDED #define PB_PB_SYSTEM_SYSTEM_PB_H_INCLUDED @@ -10,74 +10,57 @@ #endif /* Enum definitions */ -typedef enum _PB_System_RebootRequest_RebootMode { - PB_System_RebootRequest_RebootMode_OS = 0, - PB_System_RebootRequest_RebootMode_DFU = 1, - PB_System_RebootRequest_RebootMode_UPDATE = 2 +typedef enum _PB_System_RebootRequest_RebootMode { + PB_System_RebootRequest_RebootMode_OS = 0, /* default value */ + PB_System_RebootRequest_RebootMode_DFU = 1, + PB_System_RebootRequest_RebootMode_UPDATE = 2 } PB_System_RebootRequest_RebootMode; -typedef enum _PB_System_UpdateResponse_UpdateResultCode { - PB_System_UpdateResponse_UpdateResultCode_OK = 0, - PB_System_UpdateResponse_UpdateResultCode_ManifestPathInvalid = 1, - PB_System_UpdateResponse_UpdateResultCode_ManifestFolderNotFound = 2, - PB_System_UpdateResponse_UpdateResultCode_ManifestInvalid = 3, - PB_System_UpdateResponse_UpdateResultCode_StageMissing = 4, - PB_System_UpdateResponse_UpdateResultCode_StageIntegrityError = 5, - PB_System_UpdateResponse_UpdateResultCode_ManifestPointerError = 6, - PB_System_UpdateResponse_UpdateResultCode_TargetMismatch = 7, - PB_System_UpdateResponse_UpdateResultCode_OutdatedManifestVersion = 8, - PB_System_UpdateResponse_UpdateResultCode_IntFull = 9, - PB_System_UpdateResponse_UpdateResultCode_UnspecifiedError = 10 +typedef enum _PB_System_UpdateResponse_UpdateResultCode { + PB_System_UpdateResponse_UpdateResultCode_OK = 0, + PB_System_UpdateResponse_UpdateResultCode_ManifestPathInvalid = 1, + PB_System_UpdateResponse_UpdateResultCode_ManifestFolderNotFound = 2, + PB_System_UpdateResponse_UpdateResultCode_ManifestInvalid = 3, + PB_System_UpdateResponse_UpdateResultCode_StageMissing = 4, + PB_System_UpdateResponse_UpdateResultCode_StageIntegrityError = 5, + PB_System_UpdateResponse_UpdateResultCode_ManifestPointerError = 6, + PB_System_UpdateResponse_UpdateResultCode_TargetMismatch = 7, + PB_System_UpdateResponse_UpdateResultCode_OutdatedManifestVersion = 8, + PB_System_UpdateResponse_UpdateResultCode_IntFull = 9, + PB_System_UpdateResponse_UpdateResultCode_UnspecifiedError = 10 } PB_System_UpdateResponse_UpdateResultCode; /* Struct definitions */ -typedef struct _PB_System_DeviceInfoRequest { - char dummy_field; -} PB_System_DeviceInfoRequest; - -typedef struct _PB_System_DeviceInfoResponse { - char *key; - char *value; -} PB_System_DeviceInfoResponse; - -typedef struct _PB_System_FactoryResetRequest { - char dummy_field; -} PB_System_FactoryResetRequest; - -typedef struct _PB_System_GetDateTimeRequest { - char dummy_field; -} PB_System_GetDateTimeRequest; - -typedef struct _PB_System_PingRequest { - pb_bytes_array_t *data; +typedef struct _PB_System_PingRequest { + pb_bytes_array_t *data; } PB_System_PingRequest; -typedef struct _PB_System_PingResponse { - pb_bytes_array_t *data; +typedef struct _PB_System_PingResponse { + pb_bytes_array_t *data; } PB_System_PingResponse; -typedef struct _PB_System_PlayAudiovisualAlertRequest { - char dummy_field; -} PB_System_PlayAudiovisualAlertRequest; +typedef struct _PB_System_RebootRequest { + PB_System_RebootRequest_RebootMode mode; +} PB_System_RebootRequest; -typedef struct _PB_System_PowerInfoRequest { +typedef struct _PB_System_DeviceInfoRequest { char dummy_field; -} PB_System_PowerInfoRequest; +} PB_System_DeviceInfoRequest; -typedef struct _PB_System_PowerInfoResponse { - char *key; - char *value; -} PB_System_PowerInfoResponse; +typedef struct _PB_System_DeviceInfoResponse { + char *key; + char *value; +} PB_System_DeviceInfoResponse; -typedef struct _PB_System_ProtobufVersionRequest { +typedef struct _PB_System_FactoryResetRequest { char dummy_field; -} PB_System_ProtobufVersionRequest; +} PB_System_FactoryResetRequest; -typedef struct _PB_System_UpdateRequest { - char *update_manifest; -} PB_System_UpdateRequest; +typedef struct _PB_System_GetDateTimeRequest { + char dummy_field; +} PB_System_GetDateTimeRequest; -typedef struct _PB_System_DateTime { +typedef struct _PB_System_DateTime { /* Time */ uint8_t hour; /* *< Hour in 24H format: 0-23 */ uint8_t minute; /* *< Minute: 0-59 */ @@ -89,29 +72,50 @@ typedef struct _PB_System_DateTime { uint8_t weekday; /* *< Current weekday: 1-7 */ } PB_System_DateTime; -typedef struct _PB_System_ProtobufVersionResponse { - uint32_t major; - uint32_t minor; +typedef struct _PB_System_GetDateTimeResponse { + bool has_datetime; + PB_System_DateTime datetime; +} PB_System_GetDateTimeResponse; + +typedef struct _PB_System_SetDateTimeRequest { + bool has_datetime; + PB_System_DateTime datetime; +} PB_System_SetDateTimeRequest; + +typedef struct _PB_System_PlayAudiovisualAlertRequest { + char dummy_field; +} PB_System_PlayAudiovisualAlertRequest; + +typedef struct _PB_System_ProtobufVersionRequest { + char dummy_field; +} PB_System_ProtobufVersionRequest; + +typedef struct _PB_System_ProtobufVersionResponse { + uint32_t major; + uint32_t minor; } PB_System_ProtobufVersionResponse; -typedef struct _PB_System_RebootRequest { - PB_System_RebootRequest_RebootMode mode; -} PB_System_RebootRequest; +typedef struct _PB_System_UpdateRequest { + char *update_manifest; +} PB_System_UpdateRequest; -typedef struct _PB_System_UpdateResponse { - PB_System_UpdateResponse_UpdateResultCode code; +typedef struct _PB_System_UpdateResponse { + PB_System_UpdateResponse_UpdateResultCode code; } PB_System_UpdateResponse; -typedef struct _PB_System_GetDateTimeResponse { - bool has_datetime; - PB_System_DateTime datetime; -} PB_System_GetDateTimeResponse; +typedef struct _PB_System_PowerInfoRequest { + char dummy_field; +} PB_System_PowerInfoRequest; + +typedef struct _PB_System_PowerInfoResponse { + char *key; + char *value; +} PB_System_PowerInfoResponse; -typedef struct _PB_System_SetDateTimeRequest { - bool has_datetime; - PB_System_DateTime datetime; -} PB_System_SetDateTimeRequest; +#ifdef __cplusplus +extern "C" { +#endif /* Helper constants for enums */ #define _PB_System_RebootRequest_RebootMode_MIN PB_System_RebootRequest_RebootMode_OS @@ -123,9 +127,24 @@ typedef struct _PB_System_SetDateTimeRequest { #define _PB_System_UpdateResponse_UpdateResultCode_ARRAYSIZE ((PB_System_UpdateResponse_UpdateResultCode)(PB_System_UpdateResponse_UpdateResultCode_UnspecifiedError+1)) -#ifdef __cplusplus -extern "C" { -#endif + +#define PB_System_RebootRequest_mode_ENUMTYPE PB_System_RebootRequest_RebootMode + + + + + + + + + + + + +#define PB_System_UpdateResponse_code_ENUMTYPE PB_System_UpdateResponse_UpdateResultCode + + + /* Initializer values for message structs */ #define PB_System_PingRequest_init_default {NULL} @@ -164,13 +183,11 @@ extern "C" { #define PB_System_PowerInfoResponse_init_zero {NULL, NULL} /* Field tags (for use in manual encoding/decoding) */ -#define PB_System_DeviceInfoResponse_key_tag 1 -#define PB_System_DeviceInfoResponse_value_tag 2 #define PB_System_PingRequest_data_tag 1 #define PB_System_PingResponse_data_tag 1 -#define PB_System_PowerInfoResponse_key_tag 1 -#define PB_System_PowerInfoResponse_value_tag 2 -#define PB_System_UpdateRequest_update_manifest_tag 1 +#define PB_System_RebootRequest_mode_tag 1 +#define PB_System_DeviceInfoResponse_key_tag 1 +#define PB_System_DeviceInfoResponse_value_tag 2 #define PB_System_DateTime_hour_tag 1 #define PB_System_DateTime_minute_tag 2 #define PB_System_DateTime_second_tag 3 @@ -178,12 +195,14 @@ extern "C" { #define PB_System_DateTime_month_tag 5 #define PB_System_DateTime_year_tag 6 #define PB_System_DateTime_weekday_tag 7 +#define PB_System_GetDateTimeResponse_datetime_tag 1 +#define PB_System_SetDateTimeRequest_datetime_tag 1 #define PB_System_ProtobufVersionResponse_major_tag 1 #define PB_System_ProtobufVersionResponse_minor_tag 2 -#define PB_System_RebootRequest_mode_tag 1 +#define PB_System_UpdateRequest_update_manifest_tag 1 #define PB_System_UpdateResponse_code_tag 1 -#define PB_System_GetDateTimeResponse_datetime_tag 1 -#define PB_System_SetDateTimeRequest_datetime_tag 1 +#define PB_System_PowerInfoResponse_key_tag 1 +#define PB_System_PowerInfoResponse_value_tag 2 /* Struct field encoding specification for nanopb */ #define PB_System_PingRequest_FIELDLIST(X, a) \ @@ -325,6 +344,7 @@ extern const pb_msgdesc_t PB_System_PowerInfoResponse_msg; /* PB_System_DeviceInfoResponse_size depends on runtime parameters */ /* PB_System_UpdateRequest_size depends on runtime parameters */ /* PB_System_PowerInfoResponse_size depends on runtime parameters */ +#define PB_SYSTEM_SYSTEM_PB_H_MAX_SIZE PB_System_GetDateTimeResponse_size #define PB_System_DateTime_size 22 #define PB_System_DeviceInfoRequest_size 0 #define PB_System_FactoryResetRequest_size 0 diff --git a/plugins/flipperproto0/guirequest.cpp b/plugins/flipperproto0/guirequest.cpp index acf89531..a7e769fc 100644 --- a/plugins/flipperproto0/guirequest.cpp +++ b/plugins/flipperproto0/guirequest.cpp @@ -1,6 +1,6 @@ #include "guirequest.h" -#include "pb_encode.h" +#include GuiStartScreenStreamRequest::GuiStartScreenStreamRequest(uint32_t id): MainRequest(id, PB_Main_gui_start_screen_stream_request_tag) diff --git a/plugins/flipperproto0/mainrequest.cpp b/plugins/flipperproto0/mainrequest.cpp index dd9daca2..68a5ce46 100644 --- a/plugins/flipperproto0/mainrequest.cpp +++ b/plugins/flipperproto0/mainrequest.cpp @@ -1,6 +1,6 @@ #include "mainrequest.h" -#include "pb_encode.h" +#include MainRequest::MainRequest(uint32_t id, pb_size_t tag, bool hasNext): m_message({id, PB_CommandStatus_OK, hasNext, {}, tag, {}}) diff --git a/plugins/flipperproto0/mainrequest.h b/plugins/flipperproto0/mainrequest.h index 301c2251..f147dd20 100644 --- a/plugins/flipperproto0/mainrequest.h +++ b/plugins/flipperproto0/mainrequest.h @@ -2,7 +2,7 @@ #include -#include "messages/flipper.pb.h" +#include class MainRequest { diff --git a/plugins/flipperproto0/messagewrapper.cpp b/plugins/flipperproto0/messagewrapper.cpp index e712d90f..1372c879 100644 --- a/plugins/flipperproto0/messagewrapper.cpp +++ b/plugins/flipperproto0/messagewrapper.cpp @@ -1,6 +1,6 @@ #include "messagewrapper.h" -#include "pb_decode.h" +#include #include "mainresponse.h" diff --git a/plugins/flipperproto0/messagewrapper.h b/plugins/flipperproto0/messagewrapper.h index 51d0d845..18fcd157 100644 --- a/plugins/flipperproto0/messagewrapper.h +++ b/plugins/flipperproto0/messagewrapper.h @@ -2,7 +2,7 @@ #include -#include "messages/flipper.pb.h" +#include class MessageWrapper { diff --git a/plugins/flipperproto0/regiondata.cpp b/plugins/flipperproto0/regiondata.cpp index 068f0f99..6e92e73b 100644 --- a/plugins/flipperproto0/regiondata.cpp +++ b/plugins/flipperproto0/regiondata.cpp @@ -2,7 +2,7 @@ #include -#include "pb_encode.h" +#include static bool fieldEncodeCallback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg) { diff --git a/plugins/flipperproto0/regiondata.h b/plugins/flipperproto0/regiondata.h index ce9eb2bc..2b095b9c 100644 --- a/plugins/flipperproto0/regiondata.h +++ b/plugins/flipperproto0/regiondata.h @@ -2,8 +2,9 @@ #include +#include + #include "bandinfo.h" -#include "messages/flipper.pb.h" class RegionData { diff --git a/plugins/flipperproto0/statusrequest.cpp b/plugins/flipperproto0/statusrequest.cpp index b9c78a74..7733943e 100644 --- a/plugins/flipperproto0/statusrequest.cpp +++ b/plugins/flipperproto0/statusrequest.cpp @@ -1,6 +1,6 @@ #include "statusrequest.h" -#include "pb_encode.h" +#include StatusPingRequest::StatusPingRequest(uint32_t id, const QByteArray &data): MainRequest(id, PB_Main_system_ping_request_tag) diff --git a/plugins/flipperproto0/storagerequest.cpp b/plugins/flipperproto0/storagerequest.cpp index 9649e48b..5e4dd8d1 100644 --- a/plugins/flipperproto0/storagerequest.cpp +++ b/plugins/flipperproto0/storagerequest.cpp @@ -1,6 +1,6 @@ #include "storagerequest.h" -#include "pb_encode.h" +#include AbstractStorageRequest::AbstractStorageRequest(uint32_t id, pb_size_t tag, const QByteArray &path, bool hasNext): MainRequest(id, tag, hasNext), diff --git a/plugins/flipperproto0/systemrequest.cpp b/plugins/flipperproto0/systemrequest.cpp index cb0e8c74..e25b08fd 100644 --- a/plugins/flipperproto0/systemrequest.cpp +++ b/plugins/flipperproto0/systemrequest.cpp @@ -1,6 +1,6 @@ #include "systemrequest.h" -#include "pb_encode.h" +#include SystemRebootRequest::SystemRebootRequest(uint32_t id, PB_System_RebootRequest_RebootMode mode): MainRequest(id, PB_Main_system_reboot_request_tag)