About Legato IPS and Threads

in mi application I’ve a Componet A calling a function on Component B.

Componet B is:

  • connected to GNSS (ConnectService in Component Init)

  • exposes a function “stop” via api to component A.

  • the “stop” function start a thread (I’m using thread to avoid blocking componet A waiting) and call le_gnss_stop().

When runnig, when i call “stop” the app crashes. It seems that access to le_gnss is not permitted, so i tried to call ConnectService, in thread before any operations, but even in this case I’ve erros.

More generally, whats’ the right approach in legato to handle this kind of situations? To avoid producer-consumer problem?


Here says circular dependency is not recommended to avoid deadlocks:

Hum… can you be clearer… I cant see circular dependency… but maybe my fault cause I’m tring to solve since yesterday.

A dont uses gnss, just call “stop”
B call a thread to spot gnss, but give me error.

If you want i can post code.


You can first try
gnss enable
gnss start
gnss stop

If you don’t see problem, you can see the code here