#include <stdio.h>
#include "interfaces.h"
void Testle_pos_GetInfo();
{
int32_t val, val1, accuracy;
uint32_t uval, uAccuracy;
uint16_t year;
uint16_t month;
uint16_t day;
uint16_t hours;
uint16_t minutes;
uint16_t seconds;
uint16_t milliseconds;
if(positionSampleRef == NULL)
{
LE_ERROR(
"New Position sample is NULL!");
}
else
{
LE_INFO(
"New Position sample %p", positionSampleRef);
}
LE_INFO(
"GetFixState: %d", fixState);
LE_INFO(
"Get2DLocation: lat.%d, long.%d, accuracy.%d", val, val1, accuracy);
LE_INFO(
"GetDate: year.%d, month.%d, day.%d", year, month, day);
LE_INFO(
"GetTime: hours.%d, minutes.%d, seconds.%d, milliseconds.%d", hours, minutes, seconds,
milliseconds);
LE_INFO(
"GetAltitude: alt.%d, accuracy.%d", val, accuracy);
LE_INFO(
"GetHorizontalSpeed: hSpeed.%u, accuracy.%u", uval, uAccuracy);
LE_INFO(
"GetVerticalSpeed: vSpeed.%d, accuracy.%d", val, accuracy);
LE_INFO(
"GetHeading: heading.%u, accuracy.%u", uval, uAccuracy);
LE_INFO(
"GetDirection: direction.%u, accuracy.%u", uval, uAccuracy);
}
static void TwentyMeterNavigationHandler(
le_pos_SampleRef_t positionSampleRef,
void* contextPtr)
{
int32_t val, val1, accuracy;
uint32_t uval, uAccuracy;
if(positionSampleRef == NULL)
{
LE_ERROR(
"New Position sample is NULL!");
}
else
{
LE_INFO(
"New Position sample %p", positionSampleRef);
}
LE_INFO(
"GetFixState: %d", fixState);
LE_INFO(
"Get2DLocation: lat.%d, long.%d, accuracy.%d", val, val1, accuracy);
LE_INFO(
"GetAltitude: alt.%d, accuracy.%d", val, accuracy);
LE_INFO(
"GetHorizontalSpeed: hSpeed.%u, accuracy.%u", uval, uAccuracy);
LE_INFO(
"GetVerticalSpeed: vSpeed.%d, accuracy.%d", val, accuracy);
LE_INFO(
"GetHeading: heading.%u, accuracy.%u", uval, uAccuracy);
LE_INFO(
"GetDirection: direction.%u, accuracy.%u", uval, uAccuracy);
}
static void* NavigationThread
(
void* context
)
{
LE_INFO(
"======== Navigation Handler thread ========");
return NULL;
}
void Testle_pos_GetInfo()
{
int32_t latitude;
int32_t longitude;
int32_t altitude;
int32_t hAccuracy;
int32_t vAccuracy;
uint32_t hSpeed;
uint32_t hSpeedAccuracy;
int32_t vSpeed;
int32_t vSpeedAccuracy;
uint32_t heading;
uint32_t headingAccuracy=0;
uint32_t direction;
uint32_t directionAccuracy=0;
uint16_t year = 0;
uint16_t month = 0;
uint16_t day = 0;
uint16_t hours = 0;
uint16_t minutes = 0;
uint16_t seconds = 0;
uint16_t milliseconds = 0;
LE_INFO(
"position fix state %d", fixState);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_Get2DLocation latitude.%d, longitude.%d, hAccuracy.%d" , latitude, longitude, hAccuracy);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_Get3DLocation latitude.%d, longitude.%d, hAccuracy.%d, altitude.%d" ", vAccuracy.%d"
, latitude, longitude, hAccuracy, altitude, vAccuracy);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_GetDate year.%d, month.%d, day.%d" , year, month, day);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_GetTime hours.%d, minutes.%d, seconds.%d, milliseconds.%d" , hours, minutes, seconds, milliseconds);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_GetMotion hSpeed.%u, hSpeedAccuracy.%u, vSpeed.%d, vSpeedAccuracy.%d" , hSpeed, hSpeedAccuracy, vSpeed, vSpeedAccuracy);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_GetHeading heading.%u, headingAccuracy.%u" , heading, headingAccuracy);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
LE_INFO(
"Check le_pos_GetDirection direction.%u, directionAccuracy.%u" , direction, directionAccuracy);
, (res==LE_OK)?
"OK":(res==
LE_OUT_OF_RANGE)?
"parameter(s) out of range":
"ERROR");
}
static void Testle_pos_TestAcquisitionRate()
{
}
{
LE_INFO(
"======== Positioning Test started ========");
Testle_pos_TestAcquisitionRate();
navigationThreadRef =
le_thread_Create(
"NavigationThread",NavigationThread,NULL);
Testle_pos_GetInfo();
LE_INFO(
"Request activation of the positioning service");
LE_INFO(
"Wait 120 seconds for a 3D fix");
sleep(120);
Testle_pos_GetInfo();
sleep(1);
LE_INFO(
"Release the positioning service");
LE_INFO(
"======== Positioning Test finished ========");
exit(EXIT_SUCCESS);
}