Loading...
Searching...
No Matches
rpc_i.h
1#pragma once
2#include "rpc.h"
3#include <storage/filesystem_api_defines.h>
4#include <pb.h>
5#include <pb_decode.h>
6#include <pb_encode.h>
7#include <flipper.pb.h>
8#include <cli/cli.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14typedef void* (*RpcSystemAlloc)(RpcSession* session);
15typedef void (*RpcSystemFree)(void* context);
16typedef void (*PBMessageHandler)(const PB_Main* msg_request, void* context);
17
18typedef struct {
19 bool (*decode_submessage)(pb_istream_t* stream, const pb_field_t* field, void** arg);
20 PBMessageHandler message_handler;
21 void* context;
23
24void rpc_send(RpcSession* session, PB_Main* main_message);
25
26void rpc_send_and_release(RpcSession* session, PB_Main* main_message);
27
28void rpc_send_and_release_empty(RpcSession* session, uint32_t command_id, PB_CommandStatus status);
29
30void rpc_add_handler(RpcSession* session, pb_size_t message_tag, RpcHandler* handler);
31
32void* rpc_system_system_alloc(RpcSession* session);
33void* rpc_system_storage_alloc(RpcSession* session);
34void rpc_system_storage_free(void* ctx);
35void* rpc_system_app_alloc(RpcSession* session);
36void rpc_system_app_free(void* ctx);
37void* rpc_system_gui_alloc(RpcSession* session);
38void rpc_system_gui_free(void* ctx);
39void* rpc_system_gpio_alloc(RpcSession* session);
40void rpc_system_gpio_free(void* ctx);
41void* rpc_system_property_alloc(RpcSession* session);
42
43void* rpc_desktop_alloc(RpcSession* session);
44void rpc_desktop_free(void* ctx);
45
46void rpc_debug_print_message(const PB_Main* message);
47void rpc_debug_print_data(const char* prefix, uint8_t* buffer, size_t size);
48
49void rpc_cli_command_start_session(Cli* cli, FuriString* args, void* context);
50
51PB_CommandStatus rpc_system_storage_get_error(FS_Error fs_error);
52
53#ifdef __cplusplus
54}
55#endif
Cli API.
struct Cli Cli
Cli type anonymous structure.
Definition cli.h:38
Definition string.c:4
Definition rpc_i.h:18
Definition rpc.c:67