blob: 6704b1e296504c10777f2bf978d4e32f60d365ae [file] [log] [blame]
b.liu4e243dc2023-11-27 11:20:00 +08001/*
2* qser_gnss.h
3*
4* QSER GNSS header file.
5*
6* Author : lb
7* Date : 2023/11/23 11:13:18
8*/
9#ifndef _QSER_GNSS_H
10#define _QSER_GNSS_H
11#include "mbtk_type.h"
12
13typedef unsigned int Uint_t;
wangyouqiang3d09b4d2024-01-04 13:50:51 +080014#define MOPEN_GNSS_NMEA_MAX_LENGTH 255 /* NMEA string maximum length. */
liubin281ac462023-07-19 14:22:54 +080015
16typedef enum
17{
wangyouqiang3d09b4d2024-01-04 13:50:51 +080018 E_MT_LOC_MSG_ID_LOCATION_INFO = 1, /**< pv_data = & mopen_location_info_t */
19 E_MT_LOC_MSG_ID_NMEA_INFO = 3, /**< pv_data = & mopen_gnss_nmea_info_t */
b.liu4e243dc2023-11-27 11:20:00 +080020} e_msg_id_t;
liubin281ac462023-07-19 14:22:54 +080021
b.liu4e243dc2023-11-27 11:20:00 +080022typedef void (*gnss_handler_func_t)
23(
24 Uint_t *h_loc,
25 e_msg_id_t e_msg_id, //消息 ID
26 void *pv_data, //消息内容,取决于 ID,如下说明
27 void *context_ptr //用于区分哪个返回的消息
28)/* lynq_AddRxIndMsgHandler_t*/;
29
liubin281ac462023-07-19 14:22:54 +080030typedef struct
31{
wangyouqiang3d09b4d2024-01-04 13:50:51 +080032 int64_t timestamp; /**< System Timestamp, marked for when got the nmea data */
33 int length; /**< NMEA string length. */
34 char nmea[MOPEN_GNSS_NMEA_MAX_LENGTH + 1]; /**< NMEA string.*/
35}mopen_gnss_nmea_info_t; /* Message */
36
37typedef struct
38{
39 uint32_t size; /**< Set to the size of mcm_gps_location_t. */
40 int flags; /**< Contains GPS location flags bits. */
41 int position_source; /**< Provider indicator for HYBRID or GPS. */ //功能暂未实现,可不用添加进结构体
42 double latitude; /**< Latitude in degrees. */
43 double longitude; /**< Longitude in degrees. */
44 double altitude; /**< Altitude in meters above the WGS 84 reference ellipsoid. */
45 float speed; /**< Speed in meters per second. */
46 float bearing; /**< Heading in degrees. */ //功能暂未实现,可不用添加进结构体
47 float accuracy; /**< Expected accuracy in meters. */ //功能暂未实现,可不用添加进结构体
48 int64_t timestamp; /**< Timestamp for the location fix in UTC million-second base. */
49 int32_t is_indoor; /**< Location is indoors. */ //功能暂未实现,可不用添加进结构体
50 float floor_number; /**< Indicates the floor number. */
51}mopen_location_info_t;//功能暂未实现,可不用添加进结构体
52
53typedef struct
54{
b.liu4e243dc2023-11-27 11:20:00 +080055 uint32_t year; // 大于 1980
56 uint32_t month; // 1-12
57 uint32_t day; // 1-31
58 uint32_t hour; // 0-23
59 uint32_t minute; // 0-59
60 uint32_t second; // 0-59
61 uint32_t millisecond; // 0-999
62} LYNQ_INJECT_TIME_INTO_T; /* Message */
liubin281ac462023-07-19 14:22:54 +080063
b.liu4e243dc2023-11-27 11:20:00 +080064typedef enum {
65 DELETE_NOTHING = 0, /*不删除数据*/
66 DELETE_EPHEMERIS = 1, /*删除星历*/
67 DELETE_ALMANAC = 2, /*删除历书*/
68 DELETE_POSITION_TIME = 3, /*删除时间和位置信息. */
69 DELETE_UTC = 4, /*删除 UTC 时间*/
70 DELETE_ALL = 5 /*删除所有*/
71} DELETE_AIDING_DATA_TYPE_T;
liubin281ac462023-07-19 14:22:54 +080072
b.liu4e243dc2023-11-27 11:20:00 +080073int qser_Gnss_Init (uint32_t *h_gnss);
liubin281ac462023-07-19 14:22:54 +080074
b.liu4e243dc2023-11-27 11:20:00 +080075int qser_Gnss_Deinit (uint32_t h_gnss);
liubin281ac462023-07-19 14:22:54 +080076
b.liu4e243dc2023-11-27 11:20:00 +080077int qser_AddRxIndMsgHandler (gnss_handler_func_t handler_ptr,uint32_t h_gnss);
liubin281ac462023-07-19 14:22:54 +080078
b.liu4e243dc2023-11-27 11:20:00 +080079int qser_Set_Indications (uint32_t h_gnss,e_msg_id_t type);
liubin281ac462023-07-19 14:22:54 +080080
b.liu4e243dc2023-11-27 11:20:00 +080081int qser_Gnss_Start (uint32_t h_gnss);
liubin281ac462023-07-19 14:22:54 +080082
b.liu4e243dc2023-11-27 11:20:00 +080083int qser_Gnss_Stop (uint32_t h_gnss);
84
wangyouqiang3d09b4d2024-01-04 13:50:51 +080085int qser_Gnss_Set_Frequency(uint32_t h_gnss, int frequency);
86
b.liu4e243dc2023-11-27 11:20:00 +080087int qser_Gnss_InjectTime (uint32_t h_gnss,LYNQ_INJECT_TIME_INTO_T *time_info);
88
89int qser_Gnss_Delete_Aiding_Data (uint32_t h_gnss,DELETE_AIDING_DATA_TYPE_T flags);
90
wangyouqiang3d09b4d2024-01-04 13:50:51 +080091int qser_Gnss_Server_Configuration(char *host, char *id, char *password);
92
b.liu4e243dc2023-11-27 11:20:00 +080093int qser_Gnss_download_tle();
94
95int qser_Gnss_injectEphemeris(uint32_t h_gnss);
96
wangyouqiang3d09b4d2024-01-04 13:50:51 +080097
b.liu4e243dc2023-11-27 11:20:00 +080098#endif /* _QSER_GNSS_H */