Hi everyone,
I'm following up on this conversation: http://comments.gmane.org/gmane.comp.mobile.osmocom.baseband.devel/1796
It seems like there was no movement in this topic in the last couple of years, so I decided to go ahead and integrate Nico's SAP client into the current master branch and created a patch from it. I tested it (with Kevin's softSIM and a pcsc reader), it worked for me, however it is currently quite ugly: it kind of hand crafts the msgb structure (in l1ctl.c, patch line 121), sorry for that, but I kept getting extra bytes stuffed into the msg that was passed to the sap_interface so I decided to manually go around the problem. I'm of course open to any suggestions to get it cleaner, and then if you think and decide so it could be merged into the master (as far as I see.
One thing however that I think is strange, and worth mentioning: I'm not sure why Nico decided to implement the switch between phone and SAP-client inside of l1ctl.c, for me it would feel better to do it in sim.c (since sim.c deals with SIM activities, l1ctl should deal only with L1 stuff...also the current SAP client calls back to sim.c, but receives data from l1ctl - little bit confusing), but I left it as is because of not knowing exactly the thoughts behind it.
Regards, Domi
Hi, * Tomcsányi, Domonkos domi@tomcsanyi.net [2015-04-23 18:12]: [...]
It seems like there was no movement in this topic in the last couple of years, so I decided to go ahead and integrate Nico's SAP client into the current master branch and created a patch from it.
Cool, great work!
One thing however that I think is strange, and worth mentioning: I'm not sure why Nico decided to implement the switch between phone and SAP-client inside of l1ctl.c, for me it would feel better to do it in sim.c (since sim.c deals with SIM activities, l1ctl should deal only with L1 stuff...also the current SAP client calls back to sim.c, but receives data from l1ctl - little bit confusing), but I left it as is because of not knowing exactly the thoughts behind it.
I don't remember details to be honest as this is too long ago, but I think there was no real design decision behind this other than that the code that is sending traffic to the SIM was already in l1ctl and I just added the switch...
Cheers, Nico
Hi,
On Friday, April 24, 2015 4:41:53 PM, Nico Golde wrote:
One thing however that I think is strange, and worth mentioning: I'm not sure why Nico decided to implement the switch between phone and SAP-client inside of l1ctl.c, for me it would feel better to do it in sim.c (since sim.c deals with SIM activities, l1ctl should deal only with L1 stuff...also the current SAP client calls back to sim.c, but receives data from l1ctl - little bit confusing), but I left it as is because of not knowing exactly the thoughts behind it.
I don't remember details to be honest as this is too long ago, but I think there was no real design decision behind this other than that the code that is sending traffic to the SIM was already in l1ctl and I just added the switch...
All right, thanks for clarifying. I went ahead and did the change: now sim.c calls either l1ctl or sap_interface and they both call back to sim.c when they have a result. The function that gets called in sap_interface.c has now the same signature as the one in l1ctl suggesting they provide an interface for the same task (which they do indeed).
I attached the revised patch.
Some background info/documentation: By default the mobile app will try to use the SAP backend instead of the built in SIM reader. If it fails to connect to the default SAP socket (/tmp/osmocom_sap) it'll fallback to the phone's built-in SIM slot. To use the SAP backend you'll need softSIM which will create the socket and also interact with a PC/SC reader or a previously captured file (sim_os). First you need to start up the demo_server with the right parameters based on your setup (-s unix to create the socket for the mobile app, -t type depends on whether you have a PC/SC reader or not). After that osmocon could be started, then the mobile app, then the phone itself. When starting up the mobile app one can observe the debug information from the SAP interface by default.
Regards, Domi
baseband-devel@lists.osmocom.org