Welcome to mirror list, hosted at ThFree Co, Russian Federation.

flipper.proto - github.com/flipperdevices/flipperzero-protobuf.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 31fe8337d34bc967983a4ebba7185879f89a08e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
syntax = "proto3";
import "storage.proto";
import "status.proto";

package PB;
option java_package = "com.flipperdevices.protobuf";

enum CommandStatus {
    OK = 0;
    ERROR = 1; /**< Unknown error */
    ERROR_DECODE = 2; /**< Command can't be decoded successfully - command_id in response may be wrong! */
    ERROR_NOT_IMPLEMENTED = 3; /**< Command succesfully decoded, but not implemented (deprecated or not yet implemented) */
    ERROR_BUSY = 4; /**< Somebody took global lock, so not all commands are available */
    ERROR_CONTINUOUS_COMMAND_INTERRUPTED = 14; /**< Not received has_next == 0 */
    ERROR_INVALID_PARAMETERS = 15; /**< not provided (or provided invalid) crucial parameters to perform rpc */
    ERROR_STORAGE_NOT_READY = 5; /**< FS not ready */
    ERROR_STORAGE_EXIST = 6; /**< File/Dir alrady exist */
    ERROR_STORAGE_NOT_EXIST = 7; /**< File/Dir does not exist */
    ERROR_STORAGE_INVALID_PARAMETER = 8; /**< Invalid API parameter */
    ERROR_STORAGE_DENIED = 9; /**< Access denied */
    ERROR_STORAGE_INVALID_NAME = 10; /**< Invalid name/path */
    ERROR_STORAGE_INTERNAL = 11; /**< Internal error */
    ERROR_STORAGE_NOT_IMPLEMENTED = 12; /**< Functon not implemented */
    ERROR_STORAGE_ALREADY_OPEN = 13; /**< File/Dir already opened */
}

/* 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.
 */
message Empty {
}

message Main {
    uint32 command_id = 1;
    CommandStatus command_status = 2;
    bool has_next = 3;
    oneof content {
        Empty empty = 4;
        .PB_Status.PingRequest ping_request = 5;
        .PB_Status.PingResponse ping_response = 6;
        .PB_Storage.ListRequest storage_list_request = 7;
        .PB_Storage.ListResponse storage_list_response = 8;
        .PB_Storage.ReadRequest storage_read_request = 9;
        .PB_Storage.ReadResponse storage_read_response = 10;
        .PB_Storage.WriteRequest storage_write_request = 11;
        .PB_Storage.DeleteRequest storage_delete_request = 12;
        .PB_Storage.MkdirRequest storage_mkdir_request = 13;
        .PB_Storage.Md5sumRequest storage_md5sum_request = 14;
        .PB_Storage.Md5sumResponse storage_md5sum_response = 15;
    }
}