volte_demo.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*================================================================
  2. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  3. Quectel Wireless Solution Proprietary and Confidential.
  4. =================================================================*/
  5. /*=================================================================
  6. EDIT HISTORY FOR MODULE
  7. This section contains comments describing changes made to the module.
  8. Notice that changes are listed in reverse chronological order.
  9. WHEN WHO WHAT, WHERE, WHY
  10. ------------ ------- -------------------------------------------------------------------------------
  11. 20/10/2020 marvin create
  12. =================================================================*/
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <stdlib.h>
  16. #include "ql_api_common.h"
  17. #include "ql_api_osi.h"
  18. #include "ql_api_volte.h"
  19. #include "ql_log.h"
  20. ql_task_t volte_task = NULL;
  21. void volte_demo_task(void * param)
  22. {
  23. ql_volte_errcode_e err = QL_VOLTE_SUCCESS;
  24. uint8_t nSim = 0;
  25. //China Telecom 4G/5G SIM card must enable VoLTE before making a call
  26. err = ql_volte_set(nSim, 1);
  27. if(err != QL_VOLTE_SUCCESS){
  28. QL_VOLTE_LOG("ql_voice_call_volte_set FAIL");
  29. }else {
  30. QL_VOLTE_LOG("ql_voice_call_volte_set OK");
  31. }
  32. //data centric
  33. err = ql_volte_usage_set(nSim, 1);
  34. if(err != QL_VOLTE_SUCCESS){
  35. QL_VOLTE_LOG("data centric set FAIL,err = %d",err);
  36. }else{
  37. QL_VOLTE_LOG("data centric set OK");
  38. }
  39. //set IMS PS Voice preferred, CS Voice as secondary
  40. err = ql_volte_vdp_set(nSim, 3);
  41. if(err != QL_VOLTE_SUCCESS){
  42. QL_VOLTE_LOG("set IMS PS Voice preferred FAIL,err=%d",err);
  43. }else{
  44. QL_VOLTE_LOG("set IMS PS Voice preferred OK");
  45. }
  46. ql_rtos_task_delete(NULL);
  47. }
  48. QlOSStatus ql_volte_app_init(void)
  49. {
  50. QlOSStatus err = QL_OSI_SUCCESS;
  51. err = ql_rtos_task_create(&volte_task, 2048, APP_PRIORITY_NORMAL, "volte_task", volte_demo_task, NULL, 2);
  52. if(err != QL_OSI_SUCCESS)
  53. {
  54. QL_VOLTE_LOG("volte_demo_task created failed, ret = 0x%x", err);
  55. }
  56. return err;
  57. }