app_switch.h 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2019 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file app switch
  8. */
  9. #ifndef APP_SWITCH_H_
  10. #define APP_SWITCH_H_
  11. #define MAX_APP_NUM 25
  12. #define APP_SWITCH_LOCK_BTCALL (1 << 0)
  13. typedef enum{
  14. /** next app */
  15. APP_SWITCH_NEXT = 0x1,
  16. /** prev app */
  17. APP_SWITCH_PREV = 0x2,
  18. /** last app */
  19. APP_SWITCH_LAST = 0x04,
  20. /** curret app */
  21. APP_SWITCH_CURR = 0x08,
  22. }app_switch_mode_e;
  23. int app_switch(void *app_name, uint32_t switch_mode, bool force_switch);
  24. uint8_t * app_switch_get_app_name(uint8_t appid);
  25. void app_switch_add_app(const char *app_name);
  26. void app_switch_remove_app(const char *app_name);
  27. void app_switch_lock(uint8_t reason);
  28. void app_switch_unlock(uint8_t reason);
  29. void app_switch_force_lock(uint8_t reason);
  30. void app_switch_force_unlock(uint8_t reason);
  31. int app_switch_init(const char **app_id_switch_list, int app_num);
  32. #endif /* APP_SWITCH_H_ */