TryConnectService() creating UNIX wakelock


when I use tryConnectService() to use my own api in other apps, the call to tryConnectService() is creating a UNIX wakelock that gets only remove if I use DisconnectService() for the corresponding api.

Can you give me some background information, for example about why connecting a service is setting a wakelock?

best regards,
Nicolas Rausch

Do you mean it creates something here?


Yes under power/wake_lock I get wakelocks called UNIX

what is the code doing inside TryConnectService()

that is what I want to know.

which component’s tryConnectService() are you calling?

a component I wrote by myself. Before you ask what that component is doing, can you tell me what it should not do, or rather which process would lead to a UNIX wakelock.

then what function is inside the tryConnectService() in your code?

You better attach your code here, very hard to understand what you are asking

this function is provided by the legato framework and is created automatically.
See: le_mdmDefs_interface.h - Legato Docs (line47)

So basically the function provided by legato is trying to connect the current client thread to the service providing this API.
So let´s say I wrote a component called printComp that only has a function called PrintHello() and all it does is calling LE_INFO(“HELLO”).
Now I am in another client thread and want to use the PrintHello() function api, to use that api I need to connect the client thread to the service(printComp in my case). To make this connection I use printComp_tryConnectService(). When doing this i get a wakelock called UNIX. Only if I call printCompDIsonnectService() the UNIX wakelock is removed. I want to understand what using an api or rather to say what connecting client thread to a service has to do with wakelocks?

There is no need to call tryConnectService()

You can see this sample app

when do I have to use tryConnectService then?

I don’t know, I never need to use this.