Hi,
When trying to build my app using ‘mkapp -t wp77xx MyApp.sdef’ I got this error message:
My version of Legato is
I also used
Hi,
When trying to build my app using ‘mkapp -t wp77xx MyApp.sdef’ I got this error message:
Are you using wrong command for .sdef?
I assume mkapp is for .adef
Yes sorry I made a mistake in my post. I should have written .adef.
This issue has been solved. I copied the needed files from DataHub to my app folder.
Could you tell me where the files are generated when we call dhubAdmin_AddStringPushHandler("/obs/message/content", MessagePushHandler, ctx) for example? What is the root?
You can print it out in this file
Well. Thank you! So it is the absolute path of resource. As it starts by “/” in examples, I am confused on what is the root path before “/” but it is a trivial I guess.
The “mk tools” (including mksys
and mkapp
) make use of a tool called ifgen
to generate IPC proxy code for the functions defined in the .api
files like admin.api
. (When you see the build say “Generating IPC interface code”, that’s what’s happening.) Those files will appear under the build
directory somewhere, with names like dhubAdmin_client.c
and admin_server.c
. You can find them using find
.
(lsh:SWI-WP76) jchitty@quadra:~/leaf/yellow/cleanMangOH$ find -name dhubAdmin_client.c
./build/env_test_yellow_wp76xx/api/b6eb00c7b4a5f2ccf5027389955f74fb/client/dhubAdmin_client.c
The client-side proxy code is what your app’s function will call. That code will allocate message buffers, pack parameters into those messages, send them over a Unix-domain socket to the server, receive response messages from the server, unpack the return values and output parameters from the messages, free the message buffer, and return back to your app code.
The server-side proxy code runs inside the Data Hub app. That code receives the messages from your client app, unpacks the parameters, calls the Data Hub functions that @jyijyi (so helpful, as usual ) pointed to in adminService.c
, packs the return values and output parameters into response messages, and sends the response messages back to your client app.
I hope this de-mystifies some of this a bit more.
In the future, I highly recommend using mksys
instead of mkapp
. But if you need to continue using mkapp
, you can also use the -i
option to tell mkapp
where to find the .api
files you need, so you don’t have to copy them into your app.
Regarding the Data Hub’s resource paths, I recommend generating and reading the Data Hub documentation by doing the following (while running the leaf shell):
cd $MANGOH_ROOT/apps/DataHub
make docs
firefox docs/html/index.html &
The resource paths are documented in the I/O API. You can jump straight there with:
firefox 'docs/html/c_dataHubIo.html#c_dataHubIo_Paths' &
(Hopefully this stuff will become part of the Legato documentation on legato.io soon, but for now, it’s easy to generate yourself. …And, of course, you can use Chrome or whatever, if you’re not a Firefox user.)
Cheers,
–Jen
Super! that’s help a lot! Thank you all!