// SimpleProductData.cpp
//
#include "stdafx.h"
#include "stdio.h"
#include "conio.h"
#include "GarXfaceAll.h"
int main()
{
GarXface4::GpsUsbDevice usbDev;
/*StempSoftMessageLogger::MsgLoggerFileDevice *pMsgLoggerFileDevice;
//The log can be turned on for recording diagnostic messages
pMsgLoggerFileDevice = new StempSoftMessageLogger::MsgLoggerFileDevice("SimpleProductData.log");
StempSoftMessageLogger::SetMessageLoggerDevice(pMsgLoggerFileDevice);*/
GarXface4::UsbDeviceNameList lst;
GarXface4::UsbDeviceName *n=lst[0];
usbDev.SetDeviceName(lst[0]->GetDeviceName());
GarXface4::Gps gps;
try
{
//Qui ho scritto io
printf("E' acceso? %i\n\n\n",gps.IsOpen());
gps.Open(&usbDev);
printf("GPS acceso");
GarXface4::ProductData *pProductData = gps.GetProductData();
printf("Product Description: %s\n",pProductData->GetDescription());
printf("Model ID: %d\n",pProductData->GetProductID());
printf("Software Version: %f\n\n",pProductData->GetSwVersion());
printf("E' acceso? %i\n",gps.IsOpen());
gps.PvtDataOn();
GarXface4::PVTdata *pvt;
pvt = gps.GetPVTdata();
printf("E' connesso il GPS? %i\n",pvt->GetGpsConnect());
printf("Dati validi? %i\n",pvt->GetValidData());
printf("Alitudine: %f\n",pvt->GetAltitude());
double m_dLatitude = GarXface4::Math::WGS84::radiansToDegrees(pvt->GetLatitude());
printf("m_dLatitude %f\n\n",m_dLatitude);
getchar();
} catch(GarXface4::Exceptions::GxException e) {
e.ReportError();
}
return 0;
}