Do le_gnss.api need special permission? My test gps program as below…
<---- gpsTestComponent/Component.cdef ---->
sources:
{
gpsTestComponent.c
}
requires:
{
api:
{
le_gnss = le_gnss.api
}
}
<---- gpsTest.adef ---->
executables:
{
gpstest = ( gpsTestComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
( gpstest )
}
maxFileBytes: 51200K
}
bindings:
{
gpstest.gpsTestComponent.le_gnss → positioningService.le_gnss
}
version: 1.0.0
sandboxed: false
start: manual
<---- gpsTestComponent.c ---->
#include “legato.h”
#include “interfaces.h”
COMPONENT_INIT
{
LE_INFO("------------------------- START -------------------------------");
LE_INFO("------------------------- END -------------------------------");
exit(EXIT_SUCCESS);
}
<---- The result in Log is ---->
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | app.c app_Start() 2926 | Starting app ‘gpsTest’
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | app.c CreateFileLink() 1549 | Skipping file link ‘/legato/systems/current/apps/gpsTest/read-only/lib/libComponent_gpsTestComponent.so’ to '/legato/systems/current/appsWriteable/gpsTes
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | app.c CreateFileLink() 1549 | Skipping file link ‘/legato/systems/current/apps/gpsTest/read-only/bin/gpstest’ to ‘/legato/systems/current/appsWriteable/gpsTest/bin/gpstest’: Already e
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxCoreDumpFileBytes to value 102400.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileBytes to value 52428800.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxLockedMemoryBytes to value 8192.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxFileDescriptors to value 256.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxMQueueBytes to value 512.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxThreads to value 20.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | resourceLimits.c SetRLimitValue() 282 | Setting resource limit maxQueuedSignals to value 100.
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | proc.c proc_Start() 1389 | Starting process ‘gpstest’ with pid 2384
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | supervisor.c SigChildHandler() 783 | Reaping unconfigured child process 2383.
Jan 6 00:05:33 | supervisor[2384]/supervisor T=main | proc.c proc_Start() 1354 | Execing ‘gpstest’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=unknown | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refPathIteratorMap’ is truncated to ‘framework.hashMap_refPathIterat’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refEventHandlers’ is truncated to ‘framework.hashMap_refEventHandl’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refDefault Timer SafeRe’ is truncated to ‘framework.hashMap_refDefault Ti’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.MessagingClientInterfaces’ is truncated to ‘framework.MessagingClientInterf’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refHandlersRef’ is truncated to ‘framework.hashMap_refHandlersRe’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_MessagingServices’ is truncated to ‘framework.hashMap_MessagingServ’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_MessagingClients’ is truncated to ‘framework.hashMap_MessagingClie’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.PipelineSIGCHLD-reports’ is truncated to ‘framework.PipelineSIGCHLD-repor’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME fs_Init() 838 | FS prefix path “/data/le_fs/”
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refFsFileRefMap’ is truncated to ‘framework.hashMap_refFsFileRefM’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘framework.DestructorObjs’ overflowed. Expanded to 1 blocks.
Jan 6 00:05:33 | UNKNOWN[2384]/ T=main | _componentMain.c _gpsTestComponent_Init() 29 | Initializing gpsTestComponent component library.
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.hashMap_refle_gnss_ClientHandle’ is truncated to ‘framework.hashMap_refle_gnss_Cl’
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME msgMessage_CreatePool() 112 | Pool name truncated to ‘msgs-ac786c9bdfedf53fb1ab994768’ for protocol ‘ac786c9bdfedf53fb1ab99476841610f’.
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME InitPool() 303 | Memory pool name ‘framework.msgs-ac786c9bdfedf53fb1ab994768’ is truncated to ‘framework.msgs-ac786c9bdfedf53f’
Jan 6 00:05:33 | serviceDirectory[889]/serviceDirectory T=main | serviceDirectory.c DispatchToServer() 713 | Client (uid 0 ‘root’, pid 2384) disagrees with server (uid 0 ‘root’, pid 1015) on protocol ID of service 'gpstest.gpsTestCompon
Jan 6 00:05:33 | UNKNOWN[2384]/framework T=main | LE_FILENAME ReceiveSessionOpenResponse() 684 | Unexpected server response: -6 (LE_FAULT).
Jan 6 00:05:33 | supervisor[856]/supervisor T=main | proc.c proc_SigChildHandler() 2035 | Process ‘gpstest’ (PID: 2384) has exited with exit code 1.
Jan 6 00:05:34 | _appStopClient[2385]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
Jan 6 00:05:34 | supervisor[856]/supervisor T=main | app.c app_SigChildHandler() 3480 | Process ‘gpstest’ in app ‘gpsTest’ faulted: Ignored.
Jan 6 00:05:34 | supervisor[856]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘gpsTest’ has stopped.
<---- I’ve tested in terminal and I can get gps position ---->
root@fx30s:~# gnss enable
The GNSS device is already enabled
root@fx30s:~# gnss start
Success!
root@fx30s:~# gnss get loc2d
Latitude(positive->north) : 25.045136
Longitude(positive->east) : 121.467152
hAccuracy : 10.00m
root@fx30s:~#