📄 as_gps.h
字号:
#ifndef _AS_GPS_H_#define _AS_GPS_H_#include<stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <time.h>#include <string.h>#define AS_GPS_SAT_CONDITION_SEARCH 0#define AS_GPS_SAT_CONDITION_TRACKING 1#define AS_GPS_SAT_CONDITION_DECODED 2#define AS_GPS_SAT_CONDITION_DECODED_USED 3#define AS_GPS_SAT_LEVEL_0 0#define AS_GPS_SAT_LEVEL_LT10 1#define AS_GPS_SAT_LEVEL_LT20 2#define AS_GPS_SAT_LEVEL_GT20 3#define AS_GPS_SET_CURRENT_POSITION 0xb0#define AS_GPS_SET_HEIGHT 0xb1#define AS_GPS_SET_TIME 0xb2#define AS_GPS_SET_TIMESTAMP 0xb3#define AS_GPS_SET_RECEIVER_MODE 0xb5#define AS_GPS_SET_SYSTEM_RESET 0xb6#define AS_GPS_SET_AUTO_TRANSMIT 0xb7#define AS_GPS_SET_STOP_TRANSMIT 0xb8#define AS_GPS_SET_COLD_START 0xb9#define AS_GPS_REQ_RECEIVER_MODE 0xc3#define AS_GPS_REQ_DIAGNOSIS 0xc4#define AS_GPS_REQ_TIMESTAMP 0xc5#define AS_GPS_REQ_CONDITION 0xc6#define AS_GPS_REQ_POSITION_DATA 0xca#define AS_GPS_REQ_RECEIVE_SAT 0xcb#define AS_GPS_RCV_SET_CURRENT_POSITION 0xb0#define AS_GPS_RCV_SET_HEIGHT 0xb1#define AS_GPS_RCV_SET_TIME 0xb2#define AS_GPS_RCV_SET_TIMESTAMP 0xb3#define AS_GPS_RCV_SET_RECEIVER_MODE 0xb5#define AS_GPS_RCV_SET_SYSTEM_RESET 0xb6#define AS_GPS_RCV_SET_AUTO_TRANSMIT 0xb7#define AS_GPS_RCV_SET_STOP_TRANSMIT 0xb8#define AS_GPS_RCV_SET_COLD_START 0xb9#define AS_GPS_RCV_RECEIVER_MODE 0xc3#define GSP_RCV_DIAGNOSIS 0xc4#define AS_GPS_RCV_TIMESTAMP 0xc5#define AS_GPS_RCV_CONDITION 0xc6#define AS_GPS_RCV_POSITION_DATA 0xca#define AS_GPS_RCV_RECEIVE_SAT 0xcbextern unsignedas_gps_snd_size[32];extern unsignedas_gps_rcv_size[32];typedef struct{ unsigned valid; unsigned char id; unsigned char condition; unsigned char level;}AS_GPS_SatEntry;typedef struct{ unsigned status, healthy; double lat, lgt, hgt; time_t time; double HDOP, VDOP; unsigned long_error, short_error; double heading, heading_error; double speed, speed_error; unsigned char unknown[4]; AS_GPS_SatEntry sat_entries[8];} AS_GPS_PositionData;typedef struct{ char version[6]; unsigned char error[3];} AS_GPS_Diagnosis;typedef struct{ unsigned status; unsigned elevation_mask; unsigned signal_level_mask; unsigned PDOP_limit; unsigned smooth_level; double hgt;} AS_GPS_ReceiverMode;typedef struct{ unsigned char id; unsigned char condition; unsigned char level; unsigned azimuth; unsigned elevation;}AS_GPS_SatInfoEntry;typedef struct{ unsigned seconds; AS_GPS_SatInfoEntry sat_entries[8]; unsigned almanac_age; char health[32];} AS_GPS_ReceiveSats;typedef struct{ unsigned char id; unsigned char level;} AS_GPS_SatCondition;typedef struct{ unsigned char status; unsigned char healthy; unsigned char visible; int height; double lgt; double lat; time_t time; AS_GPS_SatCondition id_lvl[8]; unsigned char diag[2];} AS_GPS_Condition;extern int as_gps_file;int as_gps_open(char *);int as_gps_close();int as_gps_get_data(unsigned char *data, int length);int as_gps_send_cmd(unsigned char cmd, unsigned char *data, int length);int as_gps_parse_position_data(unsigned char *data, AS_GPS_PositionData *pos);int as_gps_parse_receive_sats(unsigned char *data, AS_GPS_ReceiveSats *pos);void as_gps_print_position_data(const AS_GPS_PositionData *pos);void as_gps_print_sat_entries(const AS_GPS_SatEntry *sat_entries);void as_gps_print_receive_sats(const AS_GPS_ReceiveSats *pos);unsigned char bcd2uchar(unsigned char);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -