rpc_app.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "rpc.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef enum {
  7. RpcAppEventSessionClose,
  8. RpcAppEventAppExit,
  9. RpcAppEventLoadFile,
  10. RpcAppEventButtonPress,
  11. RpcAppEventButtonRelease,
  12. } RpcAppSystemEvent;
  13. typedef void (*RpcAppSystemCallback)(RpcAppSystemEvent event, void* context);
  14. typedef void (
  15. *RpcAppSystemDataExchangeCallback)(const uint8_t* data, size_t data_size, void* context);
  16. typedef struct RpcAppSystem RpcAppSystem;
  17. void rpc_system_app_set_callback(RpcAppSystem* rpc_app, RpcAppSystemCallback callback, void* ctx);
  18. void rpc_system_app_send_started(RpcAppSystem* rpc_app);
  19. void rpc_system_app_send_exited(RpcAppSystem* rpc_app);
  20. const char* rpc_system_app_get_data(RpcAppSystem* rpc_app);
  21. void rpc_system_app_confirm(RpcAppSystem* rpc_app, RpcAppSystemEvent event, bool result);
  22. void rpc_system_app_set_error_code(RpcAppSystem* rpc_app, uint32_t error_code);
  23. void rpc_system_app_set_error_text(RpcAppSystem* rpc_app, const char* error_text);
  24. void rpc_system_app_set_data_exchange_callback(
  25. RpcAppSystem* rpc_app,
  26. RpcAppSystemDataExchangeCallback callback,
  27. void* ctx);
  28. void rpc_system_app_exchange_data(RpcAppSystem* rpc_app, const uint8_t* data, size_t data_size);
  29. #ifdef __cplusplus
  30. }
  31. #endif