rpc_app.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_error_reset(RpcAppSystem* rpc_app);
  25. void rpc_system_app_set_data_exchange_callback(
  26. RpcAppSystem* rpc_app,
  27. RpcAppSystemDataExchangeCallback callback,
  28. void* ctx);
  29. void rpc_system_app_exchange_data(RpcAppSystem* rpc_app, const uint8_t* data, size_t data_size);
  30. #ifdef __cplusplus
  31. }
  32. #endif