/** Flags for the gps_set_capabilities callback. */
/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
If this is not set, then the framework will use 1000ms for min_interval
and will start and call start() and stop() to schedule the GPS.
*/
#define GPS_CAPABILITY_SCHEDULING 0x0000001/** GPS supports MS-Based AGPS mode */
#define GPS_CAPABILITY_MSB 0x0000002/** GPS supports MS-Assisted AGPS mode */
#define GPS_CAPABILITY_MSA 0x0000004/** GPS supports single-shot fixes */
#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008
还有很多的定义此处不一一列举 在gps.h中都有很好的解释。
2、数据结构体
GpsLocation定义了一个表示方位的结构体,成员有经纬度,高度,速度,方位角等。
GpsStatus
表示GPS的当前状态,只有两个成员一个是表示结构大小的成员,与一个表示Gps状态的类型GpsStatusValue
/** GPS status event values. */
typedef uint16_t GpsStatusValue;
// IMPORTANT: Note that the following values must match
// constants in GpsLocationProvider.java.
/** GPS status unknown. */
#define GPS_STATUS_NONE 0/** GPS has begun navigating. */
#define GPS_STATUS_SESSION_BEGIN 1/** GPS has stopped navigating. */
#define GPS_STATUS_SESSION_END 2/** GPS has powered on but is not navigating. */
#define GPS_STATUS_ENGINE_ON 3/** GPS is powered off. */
#define GPS_STATUS_ENGINE_OFF 4
GpsSvInfo
表示当前的卫星信息,有卫星编号,信号强度,卫星仰望角方位角等 GpsSvStatus
表示卫星状态,包含了GpsSvInfo结构,可见卫星数,星历时间,年历时间,与用来定位的卫星的卫星构成的一个掩码 AGpsRefLocation
/* 2G and 3G */
/* In 3G lac is discarded */
typedef struct {
uint16_t type;
uint16_t mcc;
uint16_t mnc;
uint16_t lac;
uint32_t cid;
} AGpsRefLocationCellID;
typedef struct {
uint8_t mac[6];
} AGpsRefLocationMac;
/** Represents ref locations */
typedef struct {
uint16_t type;
union {
AGpsRefLocationCellID cellID;
AGpsRefLocationMac mac;
} u;
} AGpsRefLocation;
/** Represents the status of AGPS. */
typedef struct {
/** set to sizeof(AGpsStatus) */
size_t size;
AGpsType type;
AGpsStatusValue status;
} AGpsStatus
3、回调函数指针定义