/**
 ******************************************************************************
 * @addtogroup UAVObjects OpenPilot UAVObjects
 * @{ 
 * @addtogroup GPSPosition GPSPosition 
 * @brief Future object for the raw GPS data from @ref GPSModule.  Only should be used by @ref AHRSCommsModule.
 *
 * Autogenerated files and functions for GPSPosition Object
 
 * @{ 
 *
 * @file       gpsposition.h
 * @author     The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
 * @brief      Implementation of the GPSPosition object. This file has been 
 *             automatically generated by the UAVObjectGenerator.
 * 
 * @note       Object definition file: gpsposition.xml. 
 *             This is an automatically generated file.
 *             DO NOT modify manually.
 *
 * @see        The GNU Public License (GPL) Version 3
 *
 *****************************************************************************/
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */

#ifndef GPSPOSITION_H
#define GPSPOSITION_H

// Object constants
#define GPSPOSITION_OBJID 3041480770U
#define GPSPOSITION_NAME "GPSPosition"
#define GPSPOSITION_METANAME "GPSPositionMeta"
#define GPSPOSITION_ISSINGLEINST 1
#define GPSPOSITION_ISSETTINGS 0
#define GPSPOSITION_NUMBYTES sizeof(GPSPositionData)

// Object access macros
/**
 * @function GPSPositionGet(dataOut)
 * @brief Populate a GPSPositionData object
 * @param[out] dataOut 
 */
#define GPSPositionGet(dataOut) UAVObjGetData(GPSPositionHandle(), dataOut)
#define GPSPositionSet(dataIn) UAVObjSetData(GPSPositionHandle(), dataIn)
#define GPSPositionInstGet(instId, dataOut) UAVObjGetInstanceData(GPSPositionHandle(), instId, dataOut)
#define GPSPositionInstSet(instId, dataIn) UAVObjSetInstanceData(GPSPositionHandle(), instId, dataIn)
#define GPSPositionConnectQueue(queue) UAVObjConnectQueue(GPSPositionHandle(), queue, EV_MASK_ALL_UPDATES)
#define GPSPositionConnectCallback(cb) UAVObjConnectCallback(GPSPositionHandle(), cb, EV_MASK_ALL_UPDATES)
#define GPSPositionCreateInstance() UAVObjCreateInstance(GPSPositionHandle())
#define GPSPositionRequestUpdate() UAVObjRequestUpdate(GPSPositionHandle())
#define GPSPositionRequestInstUpdate(instId) UAVObjRequestInstanceUpdate(GPSPositionHandle(), instId)
#define GPSPositionUpdated() UAVObjUpdated(GPSPositionHandle())
#define GPSPositionInstUpdated(instId) UAVObjUpdated(GPSPositionHandle(), instId)
#define GPSPositionGetMetadata(dataOut) UAVObjGetMetadata(GPSPositionHandle(), dataOut)
#define GPSPositionSetMetadata(dataIn) UAVObjSetMetadata(GPSPositionHandle(), dataIn)
#define GPSPositionReadOnly(dataIn) UAVObjReadOnly(GPSPositionHandle())

// Object data
typedef struct {
    uint8_t Status;
    int32_t Latitude;
    int32_t Longitude;
    float Altitude;
    float GeoidSeparation;
    float Heading;
    float Groundspeed;
    int8_t Satellites;
    float PDOP;
    float HDOP;
    float VDOP;

} __attribute__((packed)) GPSPositionData;

// Field information
// Field Status information
/* Enumeration options for field Status */
typedef enum { GPSPOSITION_STATUS_NOGPS=0, GPSPOSITION_STATUS_NOFIX=1, GPSPOSITION_STATUS_FIX2D=2, GPSPOSITION_STATUS_FIX3D=3 } GPSPositionStatusOptions;
// Field Latitude information
// Field Longitude information
// Field Altitude information
// Field GeoidSeparation information
// Field Heading information
// Field Groundspeed information
// Field Satellites information
// Field PDOP information
// Field HDOP information
// Field VDOP information


// Generic interface functions
int32_t GPSPositionInitialize();
UAVObjHandle GPSPositionHandle();

#endif // GPSPOSITION_H

/**
 * @}
 * @}
 */
