| #include <stdlib.h> |
| #include <stdint.h> |
| #include <string.h> |
| #include <stdbool.h> |
| #include <stdio.h> |
| //gsw include |
| #define GSW_HAL_SUCCESS 0 |
| #define GSW_HAL_FAIL -1 |
| #define GSW_HAL_MEM_INVAILD -2 |
| #define GSW_SIM_ICCID_LENGTH 20+1 |
| #define GSW_SIM_IMSI_LENGTH 20+1 |
| #define GSW_SIM_MSISDN_LENGTH 20+1 |
| #define GSW_SIM_IMEI_LENGTH 20+1 |
| |
| typedef enum sim_status |
| { |
| SIM_STATUS_ABSENT = 0, /**< sim absent*/ |
| SIM_STATUS_PRESENT = 1, /**< sim present mtk as ready*/ |
| SIM_STATUS_ERROR = 2, /**< sim error*/ |
| SIM_STATUS_READY = 3, /**< sim state ready mtk no this value*/ |
| SIM_STATUS_PIN = 4, /**< pinlock status*/ |
| } sim_status_e_type; |
| |
| |
| |
| /** |
| * @brief sim sdk init |
| * @param [in] token usr id define by who use |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_sim_sdk_init(int32_t token); |
| |
| |
| /** |
| * @brief sim sdk deinit |
| * @param |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_sim_sdk_deinit(void); |
| |
| /** |
| * @brief get sim state |
| * @param [out] sim_state sim status as sim_status_e_type |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_get_sim_status(int32_t *sim_state); |
| |
| /** |
| * @brief get iccid function |
| * @param [in] len iccid length,max is 20 |
| * @param [out] iccid return iccid from this func |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_get_sim_iccid(int32_t len, int8_t *iccid); |
| |
| /** |
| * @brief get imsi function |
| * @param [in] len imsi length,max is 20 |
| * @param [out] iccid return imsi from this func |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_get_sim_imsi(int32_t len, int8_t *imsi); |
| |
| /** |
| * @brief get sim msisdn function |
| * @param [in] len msisdn length,max is 20 |
| * @param [out] msisdn msisdn length,max is 20 |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_get_sim_msisdn(int32_t len, int8_t *msisdn); |
| |
| /** |
| * @brief get imei function |
| * @param [in] len imei length,max is 20 |
| * @param [out] imei return imei from this func |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_get_imei(int32_t len, int8_t *imei); |
| |
| /** |
| * @brief set sim power down |
| * @param |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_set_sim_power_down(void); |
| |
| /** |
| * @brief set sim power up |
| * @param |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_set_sim_power_up(void); |
| |
| /** |
| * @brief reset modem stack only, notice: after use this method, all ril sdk |
| * need restart by app, means network, sim, sms, data need deinit then init! |
| * @param |
| * @retval 0: success |
| * @retval other: fail |
| */ |
| int gsw_reset_modem(void); |
| |