| /** | |
| * @file : gsw_at_interface.h | |
| * @brief : atCmd and cpu | |
| * @date : 2022-12-09 | |
| * @author : qinzhijiao6791 | |
| * @version : v1.0 | |
| * @copyright Copyright(C) 2022,Gosuncnwelink | |
| */ | |
| #ifndef __GSW_AT_INTERFACE__H__ | |
| #define __GSW_AT_INTERFACE__H__ | |
| /*********************************************************************************************/ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <pthread.h> | |
| #include <stddef.h> | |
| #include "gsw_hal_errcode.h" | |
| #define GSW_AT_SUCCESS GSW_HAL_SUCCESS | |
| #define GSW_AT_ERROR GSW_HAL_NORMAL_FAIL | |
| typedef enum{ | |
| soc_max=0, | |
| cpu0, | |
| cpu1, | |
| cpu2, | |
| cpu3, | |
| gpu0, | |
| gpu1, | |
| dramc, | |
| mmsys, | |
| md_5g, | |
| md_4g, | |
| md_3g, | |
| soc_dram_ntc, | |
| pa_5g, | |
| pa_4g, | |
| rf_ntc, | |
| pmic, | |
| pmic_vcore, | |
| pmic_vpro, | |
| pmic_vgpu=19, | |
| }ZONE_NUM; | |
| /** | |
| * @brief at_callback | |
| * @param [in] input whole atcmd | |
| * @param [in] out_max_size atcmd result maxlenth | |
| * @param [out] output atcmd result | |
| * @retval | |
| */ | |
| typedef void(*LYNQ_AT_CALLBACK)(char input[],char output[],int out_max_size); | |
| /** | |
| * @brief register at api, E02 and E06 unused | |
| * @param [in] atcmd register part atcmd | |
| * @param [in] func at_callback | |
| * @retval 0: success | |
| * @retval other: failed | |
| */ | |
| int gsw_reg_atcmd(const char *atcmd,LYNQ_AT_CALLBACK func); | |
| /** | |
| * @brief at_init and modem-temp_init, E02 and E06 unused | |
| * @param | |
| * @retval 0: success | |
| * @retval other: failed | |
| */ | |
| int gsw_sdk_at_init(void); | |
| /** | |
| * @brief get modem temperture, E02 and E06 unused | |
| * @details support thread safe | |
| * @param [in] num ZONE_NUM | |
| * @param [out] temp ZONE_NUM_TEMP | |
| * @retval 0: LYNQ_THM_OK | |
| * @retval -1: THM_OPEN_ERROR | |
| * @retval -2: THM_READ_ERROR | |
| * @retval -3: THM_ACCESS_ERROR | |
| * @retval -4: ERROR_DEVICE | |
| */ | |
| int gsw_get_modem_temperture(ZONE_NUM num,int *temp); | |
| /** | |
| * @brief sent AT Command and wait result | |
| * @param [in] atcmd: at command | |
| * @param [out] resp: at result | |
| * @param [in] resp_len: length of result | |
| * @param [in] timeout_ms: wait timeout millisecond | |
| * @retval 0: success | |
| * @retval other: failed | |
| */ | |
| int gsw_at_cmd_send(const char* atcmd, char* resp, uint32_t resp_len, int64_t timeout_ms); | |
| #endif //__GSW_AT_INTERFACE__H_ |