pam_api.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _PAM_API_H_
  13. #define _PAM_API_H_
  14. #include <stdint.h>
  15. #include <stdbool.h>
  16. #include "cfw_config.h"
  17. #include "cfw.h"
  18. #include "pam_gnss_api.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #ifdef CONFIG_PAM_LTE_GNSS_WIFISCAN_SUPPORT
  23. /**
  24. * @brief pam api init.
  25. */
  26. void pamApiInit();
  27. /**
  28. * @brief pam->gnss, download gnss module, while poweron device.
  29. *
  30. * @return 1 success, others: fail
  31. */
  32. unsigned pamGnssDownload(uint8_t nSim);
  33. /**
  34. * @brief pam->gnss, init gnss module, after download function.
  35. *
  36. * @return 1 success, others: fail
  37. */
  38. unsigned pamGnssInit(uint8_t nSim);
  39. /**
  40. * @brief get gnss version.
  41. *
  42. * @return gnss version
  43. */
  44. const char *pamGetGnssVersionInfo(void);
  45. /**
  46. * @brief set nmea log output enable.
  47. *
  48. * @param enable: 1 enable, 0 disable
  49. */
  50. void pamEnableNmeaOutput(bool enable);
  51. /**
  52. * @brief set gnss restart.
  53. *
  54. * @param mode: 0 hot, 1 cold, 2 warm.
  55. *
  56. * @return 1 success, others: fail
  57. */
  58. unsigned pamGnssSetRestart(uint32_t mode);
  59. /**
  60. * @brief set gnss state to open, Ask about startup mode and belt A-GNSS.
  61. *
  62. * @param pStartMode: 0 hot, 1 cold, 2 warm, 3 factory.(1-3 same treatment)
  63. * @param pSatelliteType: temporarily undeveloped, invalid.
  64. * @param nSim: sim index.
  65. *
  66. * @return 1 success, others: fail
  67. */
  68. unsigned pamGnssStartMode(uint8_t *pStartMode, uint8_t *pSatelliteType, uint8_t nSim);
  69. /**
  70. * @brief set gnss state to open, Ask about startup mode and belt A-GNSS.
  71. *
  72. * @param pStartMode: 0 hot, 1 cold, 2 warm, 3 factory.(1-3 same treatment)
  73. * @param nCtrlMode: PAM_GNSS_SWITCH_CTRL AUTO_GNSS_ON/USER_GNSS_ON.
  74. * @param nSim: sim index.
  75. *
  76. * @return 1 success, others: fail
  77. */
  78. unsigned pamGnssStartMode_V2(uint8_t *pStartMode, uint8_t nMode, uint8_t nSim);
  79. /**
  80. * @brief set gnss state to idleoff, gnss positioning running.
  81. *
  82. * @param nSim: sim index.
  83. *
  84. * @return 1 success, others: fail
  85. */
  86. unsigned pamGnssRun(uint8_t nSim);
  87. /**
  88. * @brief set gnss state to closed, gnss positioning stop.
  89. *
  90. * @param mode: PAM_GNSS_SWITCH_CTRL AUTO_GNSS_OFF/USER_GNSS_OFF.
  91. * @param nSim: sim index.
  92. *
  93. * @return 1 success, others: fail
  94. */
  95. unsigned pamGnssStop(uint8_t mode, uint8_t nSim);
  96. /**
  97. * @brief set gnss state to closed,
  98. * gnss positioning stop and notify gnss service stop.
  99. *
  100. * @param mode: PAM_GNSS_SWITCH_CTRL AUTO_GNSS_OFF/USER_GNSS_OFF.
  101. * @param nSim: sim index.
  102. *
  103. * @return 1 success, others: fail
  104. */
  105. unsigned pamGnssStop_V2(uint8_t mode, uint8_t nSim);
  106. /**
  107. * @brief set the type of satellite used, use one or several combinations
  108. * of GPS, BDS, GLONASS, B1C, GALILEO.
  109. *
  110. * @param nSatType: satellite type the value is from AT manual.
  111. * @param nSim: sim index.
  112. *
  113. * @return 1 success, others: fail
  114. */
  115. unsigned pamGnssSetSatType(uint8_t nSatType, uint8_t nSim);
  116. /**
  117. * @brief read the gnss position information
  118. *
  119. * @param pamGnsInfo: store location information.
  120. * @param nSim: sim index.
  121. *
  122. * @return 1 success, others: fail
  123. */
  124. unsigned pamGnssReadSatLocInfo(GNSS_READ_INFO_CNF_T **pamGnsInfo, uint8_t nSim);
  125. /**
  126. * @brief output the gnss position information(nmea data)
  127. *
  128. * @param nOutputFormat: data output format(value from AT manual).
  129. * @param nTimeInterval: data output time interval.
  130. * @param nSim: sim index.
  131. *
  132. * @return 1 success, others: fail
  133. */
  134. unsigned pamGnssOutputLocInfoFormat(uint16_t nOutputFormat, uint32_t nTimeInterval, uint8_t nSim);
  135. /**
  136. * @brief gnss module entry power off.
  137. *
  138. * @param nSim: sim index.
  139. *
  140. * @return 1 success, others: fail
  141. */
  142. unsigned pamGnssPowerOff(uint8_t nSim);
  143. /**
  144. * @brief used A-GNSS,Apply for A-GNSS resource data.
  145. *
  146. * @param nNsapi: activate pdp cid index.
  147. * @param nSim: sim index.
  148. *
  149. * @return 1 success, others: fail
  150. */
  151. unsigned pamGnssSendPdpInfo(uint32_t nNsapi, uint8_t nSim);
  152. unsigned pamGnssDelAidData(uint8_t nSim);
  153. /**
  154. * @brief set the priority order of gnss and lte .
  155. *
  156. * @param priority:
  157. * 0: gnss cold > lte signal > gnss hot > lte data
  158. * 1: gnss cold > lte signal > lte data > gnss hot
  159. * 2: gnss cold > gnss hot > lte signal > lte data
  160. * 3: lte signal > lte data > gnss cold > gnss hot.
  161. * @param nSim: sim index.
  162. *
  163. * @return 1 success, others: fail
  164. */
  165. unsigned pamSetGnssLteServicePrio(uint8_t priority, uint8_t nSim);
  166. /**
  167. * @brief notify lte,That gnss service will be started .
  168. *
  169. * @param nStartMode: gnss start mode
  170. * 0: hot start
  171. * 1: cold start
  172. * @param nSim: sim index.
  173. *
  174. * @return 1 success, others: fail
  175. */
  176. unsigned pamGnssStartHSLToCfw(uint8_t nStartMode, uint8_t nSim);
  177. /**
  178. * @brief notify lte,That gnss service has been stopped .
  179. *
  180. * @param nSim: sim index.
  181. *
  182. * @return 1 success, others: fail
  183. */
  184. unsigned pamGnssStopHSLToCfw(uint8_t nSim);
  185. /**
  186. * @brief empty function,only for testing
  187. */
  188. unsigned pamGnssStartHSLToCfw_V2(uint8_t nStartMode, uint8_t nSim);
  189. /**
  190. * @brief empty function,only for testing
  191. */
  192. unsigned pamGnssStopHSLToCfw_V2(uint8_t nSim);
  193. #endif //CONFIG_PAM_LTE_GNSS_WIFISCAN_SUPPORT
  194. #endif