2022-07-04 13:09:46 +00:00
|
|
|
#pragma once
|
|
|
|
#include "rpc.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
RpcAppEventSessionClose,
|
|
|
|
RpcAppEventAppExit,
|
|
|
|
RpcAppEventLoadFile,
|
|
|
|
RpcAppEventButtonPress,
|
|
|
|
RpcAppEventButtonRelease,
|
|
|
|
} RpcAppSystemEvent;
|
|
|
|
|
2022-08-02 12:54:12 +00:00
|
|
|
typedef void (*RpcAppSystemCallback)(RpcAppSystemEvent event, void* context);
|
2022-11-29 09:08:08 +00:00
|
|
|
typedef void (
|
|
|
|
*RpcAppSystemDataExchangeCallback)(const uint8_t* data, size_t data_size, void* context);
|
2022-07-04 13:09:46 +00:00
|
|
|
|
|
|
|
typedef struct RpcAppSystem RpcAppSystem;
|
|
|
|
|
|
|
|
void rpc_system_app_set_callback(RpcAppSystem* rpc_app, RpcAppSystemCallback callback, void* ctx);
|
|
|
|
|
2022-07-25 14:16:45 +00:00
|
|
|
void rpc_system_app_send_started(RpcAppSystem* rpc_app);
|
|
|
|
|
|
|
|
void rpc_system_app_send_exited(RpcAppSystem* rpc_app);
|
|
|
|
|
2022-08-02 12:54:12 +00:00
|
|
|
const char* rpc_system_app_get_data(RpcAppSystem* rpc_app);
|
|
|
|
|
|
|
|
void rpc_system_app_confirm(RpcAppSystem* rpc_app, RpcAppSystemEvent event, bool result);
|
|
|
|
|
2022-11-29 09:08:08 +00:00
|
|
|
void rpc_system_app_set_error_code(RpcAppSystem* rpc_app, uint32_t error_code);
|
|
|
|
|
|
|
|
void rpc_system_app_set_error_text(RpcAppSystem* rpc_app, const char* error_text);
|
|
|
|
|
2022-12-08 05:49:54 +00:00
|
|
|
void rpc_system_app_error_reset(RpcAppSystem* rpc_app);
|
|
|
|
|
2022-11-29 09:08:08 +00:00
|
|
|
void rpc_system_app_set_data_exchange_callback(
|
|
|
|
RpcAppSystem* rpc_app,
|
|
|
|
RpcAppSystemDataExchangeCallback callback,
|
|
|
|
void* ctx);
|
|
|
|
|
|
|
|
void rpc_system_app_exchange_data(RpcAppSystem* rpc_app, const uint8_t* data, size_t data_size);
|
|
|
|
|
2022-07-04 13:09:46 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|