b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | typedef unsigned int Uint_t; |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 14 | #define MOPEN_GNSS_NMEA_MAX_LENGTH 255 /* NMEA string maximum length. */ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 15 | |
| 16 | typedef enum |
| 17 | { |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 18 | 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.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 20 | } e_msg_id_t; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 21 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 22 | typedef 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 | |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 30 | typedef struct |
| 31 | { |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 32 | 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 | |
| 37 | typedef 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 | |
| 53 | typedef struct |
| 54 | { |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 55 | 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 */ |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 63 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 64 | typedef 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; |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 72 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 73 | int qser_Gnss_Init (uint32_t *h_gnss); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 74 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 75 | int qser_Gnss_Deinit (uint32_t h_gnss); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 76 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 77 | int qser_AddRxIndMsgHandler (gnss_handler_func_t handler_ptr,uint32_t h_gnss); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 78 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 79 | int qser_Set_Indications (uint32_t h_gnss,e_msg_id_t type); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 80 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 81 | int qser_Gnss_Start (uint32_t h_gnss); |
liubin | 281ac46 | 2023-07-19 14:22:54 +0800 | [diff] [blame] | 82 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 83 | int qser_Gnss_Stop (uint32_t h_gnss); |
| 84 | |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 85 | int qser_Gnss_Set_Frequency(uint32_t h_gnss, int frequency); |
| 86 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 87 | int qser_Gnss_InjectTime (uint32_t h_gnss,LYNQ_INJECT_TIME_INTO_T *time_info); |
| 88 | |
| 89 | int qser_Gnss_Delete_Aiding_Data (uint32_t h_gnss,DELETE_AIDING_DATA_TYPE_T flags); |
| 90 | |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 91 | int qser_Gnss_Server_Configuration(char *host, char *id, char *password); |
| 92 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 93 | int qser_Gnss_download_tle(); |
| 94 | |
| 95 | int qser_Gnss_injectEphemeris(uint32_t h_gnss); |
| 96 | |
wangyouqiang | 3d09b4d | 2024-01-04 13:50:51 +0800 | [diff] [blame] | 97 | |
b.liu | 4e243dc | 2023-11-27 11:20:00 +0800 | [diff] [blame] | 98 | #endif /* _QSER_GNSS_H */ |