b.liu | 8f231a1 | 2024-05-31 17:55:06 +0800 | [diff] [blame] | 1 | /* |
| 2 | * gnss_utils.h |
| 3 | * |
| 4 | * GNSS utils header. |
| 5 | * |
| 6 | * Author : lb |
| 7 | * Date : 2024/5/28 11:27:34 |
| 8 | */ |
| 9 | #ifndef _GNSS_UTILS_H |
| 10 | #define _GNSS_UTILS_H |
| 11 | #include <libubus.h> |
| 12 | |
| 13 | #include "mbtk_type.h" |
| 14 | |
yq.wang | 069ea92 | 2024-09-08 19:29:35 -0700 | [diff] [blame] | 15 | #define MBTK_GNSS_PARAM_PARSE 1 |
| 16 | |
| 17 | #if MBTK_GNSS_PARAM_PARSE |
| 18 | typedef enum { |
| 19 | LYNQ_TIME_TYPE_CELL = 0, //NITZ |
| 20 | LYNQ_TIME_TYPE_NTP, |
| 21 | LYNQ_TIME_TYPE_GNSS, |
| 22 | LYNQ_TIME_TYPE_USER, |
| 23 | |
| 24 | LYNQ_TIME_TYPE_UNUSE |
| 25 | } lynq_time_type_enum; |
| 26 | #endif |
| 27 | |
b.liu | 8f231a1 | 2024-05-31 17:55:06 +0800 | [diff] [blame] | 28 | int uart_baud_get(int baud); |
| 29 | |
| 30 | int gnss_port_open(const char *dev, int flag, int baud, bool tty); |
| 31 | |
| 32 | int gnss_port_close(int fd); |
| 33 | |
| 34 | int gnss_set_baudrate(int fd, int baudrate); |
| 35 | |
| 36 | uint16 get_crc16 (const char *ptr, uint16 count); |
| 37 | |
| 38 | int gnss_pty_open(int *master_fd, int *slave_fd, const char *dev); |
| 39 | |
| 40 | int gnss_nmea_sscanf(const char *str, char *ret,...); |
| 41 | |
| 42 | void gnssStartTimer(struct uloop_timeout *timeout, int timeVal); |
| 43 | |
| 44 | void gnssStopTimer(struct uloop_timeout *timeout); |
| 45 | |
yq.wang | 069ea92 | 2024-09-08 19:29:35 -0700 | [diff] [blame] | 46 | #if MBTK_GNSS_PARAM_PARSE |
| 47 | int gnss_ind_nmea_parse(const char *data, int data_len); |
| 48 | #endif |
b.liu | 8f231a1 | 2024-05-31 17:55:06 +0800 | [diff] [blame] | 49 | |
| 50 | #endif /* _GNSS_UTILS_H */ |