94 lines
2.8 KiB
C
94 lines
2.8 KiB
C
|
/****************************************************************************
|
||
|
|
||
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
||
|
|
||
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
||
|
be copied by any method or incorporated into another program without
|
||
|
the express written consent of Aerospace C.Power. This Information or any portion
|
||
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
||
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
||
|
liability for its use in any way and conveys no license or title under
|
||
|
any patent or copyright and makes no representation or warranty that this
|
||
|
Information is free from patent or copyright infringement.
|
||
|
|
||
|
****************************************************************************/
|
||
|
|
||
|
#ifndef _IOT_GSM_EXT_API_H_
|
||
|
#define _IOT_GSM_EXT_API_H_
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
/* gsm extern support module id */
|
||
|
#define IOT_GSM_EXT_MODULE_INVALID 0x00
|
||
|
#define IOT_GSM_EXT_MODULE_C20 0x01
|
||
|
|
||
|
#pragma pack(push)
|
||
|
#pragma pack(1)
|
||
|
|
||
|
typedef struct _gps_location {
|
||
|
/* gps degree value - BIN code */
|
||
|
uint32_t degree;
|
||
|
/* gps minute value - BIN code */
|
||
|
uint32_t min;
|
||
|
/* gps seconds value magnify 100 times- BIN code */
|
||
|
uint32_t sec;
|
||
|
/* 1 - South latitude or west longitude 0 - other */
|
||
|
uint8_t single;
|
||
|
} gps_location;
|
||
|
|
||
|
typedef struct _iot_gps_time {
|
||
|
/* year - BIN code */
|
||
|
uint8_t year;
|
||
|
/* month - BIN code */
|
||
|
uint8_t month;
|
||
|
/* day - BIN code */
|
||
|
uint8_t day;
|
||
|
/* hour - BIN code */
|
||
|
uint8_t hour;
|
||
|
/* minute - BIN code */
|
||
|
uint8_t minu;
|
||
|
/* seconds - BIN code */
|
||
|
uint8_t sec;
|
||
|
/* millisecond - BIN code */
|
||
|
uint16_t mill_sec;
|
||
|
} iot_gps_time_t;
|
||
|
|
||
|
typedef struct _iot_gps_report_info {
|
||
|
/* utc time from gps report info */
|
||
|
iot_gps_time_t utc_tm;
|
||
|
/* gps value valid flag */
|
||
|
uint8_t gps_valid;
|
||
|
/* latitude value when gps_valid is 1 */
|
||
|
gps_location latitude;
|
||
|
/* longtitude value when gps_valid is 1 */
|
||
|
gps_location longtitude;
|
||
|
} iot_gps_rpt_info_t;
|
||
|
|
||
|
#pragma pack(pop) // restore the pack status
|
||
|
|
||
|
/* @brief c20_gps_report_cb() - report gps information.
|
||
|
* @iot_gps_rpt_info_t see - iot_gps_rpt_info_t.
|
||
|
*/
|
||
|
typedef void (*iot_gsm_gps_report_cb)(const iot_gps_rpt_info_t *gps_rpt_info);
|
||
|
|
||
|
/* @brief open gsm module.
|
||
|
* @gps_rpt_cb gps report callback see - iot_gsm_gps_report_cb.
|
||
|
* @return: error code, see ERR_XXX.
|
||
|
*/
|
||
|
uint32_t iot_gsm_ext_module_open(iot_gsm_gps_report_cb gps_rpt_cb);
|
||
|
|
||
|
/* @brief close gsm module
|
||
|
*
|
||
|
* @return: error code, see ERR_XXX
|
||
|
*/
|
||
|
uint32_t iot_gsm_ext_module_close(void);
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
#endif //_IOT_GSM_EXT_API_H_
|
||
|
|