 I'll first go through the slides and afterwards do some kind of live demo to make things a little easier. I'll switch back and forth. Yeah, so my session will be about developing telephony functionality for Plasm Mobile using Phonesim. Yeah, first let's talk about why you would want to use Phonesim instead of a real device. Some of you probably own Pine Phones and so on. Obviously, sending many test SMS can be expensive, just like calling people all the time, which you have to calculate that most of those calls will probably not work if you are developing, so you will waste a lot of money if you use a real SIM card and modem. Send code to the phone takes time because the phone doesn't have a very powerful processor usually and you can probably do some kind of cross-compiling, but all of that will be much more complicated than using a computer for development. Also on the Pine phone, for example, bugs outside of the application you are developing could affect debugging, for example, if something is not yet working in the Kernel or other user space processes. Obviously, not everyone has a Pine phone or a Vibram 5 at all, so many people have to use Phonesim anyway. Phonesim is a cute-based application that simulates a GSM modem. Its functionality includes simulating calls, SMS, but also the SIMC toolkit, which is usually an application running on the SIM card itself. It also can simulate all kinds of things like signal, strength, carrier, name, and so on, which will be displayed in the Plasma phone shell and Phonesim is basically implemented like any Ophono driver. It's just a plug-in included in Ophono that speaks to Phonesim and so it won't make any difference to the application using Ophono, whether it's a Phonesim or a real modem driver. So Phonesim was initially developed for Nokia as part of Qtopia and later Qtextended, but as we all know it doesn't exist anymore, so it was later transferred to Intel apparently, which can be seen at the copyright notices in the code. Nowadays, it's hosted in the Ophono team on kernel.org, which is also still kind of owned by Intel, but it's open for everyone to contribute and contributions can be done through the Ophono mailing list. But of course, the most important thing about it is how we can use it for development. So first we need to get running. There is the issue that the current stable release, which is 1.21 at this point, is still based on Qt4. Intel seems to use it actively, but they are not really Qt developers, so they didn't really notice Qt4 was old. I talked to them and they are just using one VM image, which works for them. Anyway, so everyone but Intel can also use it. It was ported to Qt5, because the developers are, as I said, not Qt developers, but mostly focused on C. It uses an auto-autotool-based build system, but compiling is easy enough if you use the default slash USR prefix and nothing or slash USR local prefix and nothing special. In addition to Ophono, you will need Ophono, of course, so you can develop things for Ophono. Ophono itself doesn't depend on Ophono, but Ophono needs to be available at run time. Ophono is not enabled by default in Ophono. So we need to edit Ophono.conf and uncomment everything so it looks like the code in the slide. Afterwards, we need to restart Ophono to apply the new configuration. Ophono does support a GUI argument to tell it to use the GUI instead of the default Divers interface. In this case, I wrote the full path, because in the previous step we just installed Ophono, it might be that USR local bin is not yet in your path before you logged in to your session on your device again, but usually you can just write Ophono and not slash USR local bin, Ophono and so on. The most important thing is that we pass it the configuration file. It can emulate different kinds of modems in theory, but in all cases I needed the default configuration was totally fine. Also this configuration defines parts of Ophono, Ophono uses locally. The defaults are totally fine and we don't really need to edit anything there. Once we started that command, we will notice that nothing happens, which can be confusing at first, but the GUI doesn't start until the modem is enabled, which Ophono can tell the modem to do. For that we will need the Ophono scripts. In some distributions they are packaged, mostly as a package called Ophono scripts. We, those packages are not available on all those distributions. If they are not available on yours, you can find them in the Ophono repository in the test directory and just use it from the source directory of Ophono without having to compile Ophono yourself. If it is included in your distro, it's probably located in USR share Ophono scripts. In the following commands you will have to replace the path if it's not coming from the distribution. The most in the two scripts we are going to use for now are enable modem and online modem. The names pretty much show what they do. After you executed the enable modem script, the GUI should appear, but the modem is not yet online, so it doesn't have any connection or it doesn't emulate any connection. Once the window has started to appear, you can set the modem online using the second script. There are some common issues that can appear when using phone them. They are caused by the Ophono scripts not being extremely clever. They usually try to use first modem available and so you need to make sure there is nothing else seeming like modem to Ophono. The common issue is that the Bluetooth tag also has support for speaking to remote modems and Ophono supports that. So, in some cases Ophono might think that some device you previously connected to your Bluetooth adapter has a modem as well and it tries to use this one. Just disabling Bluetooth will work around it easily. There is a typo in the presentation. But in general if the scripts print out some deep-ass errors, the most common issue is that Ophono is probably not running yet this can be easily fixed. On system D distros, its surface Ophono start, other distros might either use sysfow in its script so slash etc init.d Ophono start or similar things. Once we have the Ophono Ophono running, we can see all the different functionality it provides. The most commonly used for a pleasant mobile is the SMS tab. The calls tab is hiding behind the error there. At the bottom you can see that we can enter an operator name or test this which will be useful for testing LTE and GSM settings in the shell. All AT commands the modem uses are displayed at the right of the windows so every time an SMS arrives or is sent by the application or is fake to arrive by the modem it will appear in there and of course all other actions will also leave AT commands there. One interesting feature of Ophono which is not currently or pleasant mobile currently doesn't use it is emulating the SIM toolkit. Of course Ophono doesn't actually include an emulator for those SIM noodles based on java card but it implements the same way of communicating as the SIM card would do. This is mostly based on numbers defined to do some special functionality and both sides then have to know what this number means. So if you want to understand how a SIM toolkit in java card works this is actually pretty useful to understand it. There are also good talks on YouTube. I think Santu knows about them because he recommended them to me in the first place. So the source code of Ophono is also useful to understand this kind of functionality. If anyone wants to implement SIM toolkit in Plasma Mobile this would be the place to start. This is a slide. We are now moving a little bit away from the main topic but it is important to do anything useful with Ophono in Plasma Mobile context. The applications in Shell do not communicate directly with Ophono but in most cases use telepathy which then needs the telepathy Ophono back in to be installed so telepathy can actually talk to Ophono. Telepathy is a framework providing abstractions for all kinds of communication in the more human sense like calls, messages, in theory even video chats and so on. For Plasma Mobile we only use the voice call and text channel features for now. If you need more direct communication with Ophono for some application for example it is used by the Shell to find out the carrier name and so on and also the signal strength. There is libq Ophono which is the newer of two Ophono queued binding libraries. It is developed by Jolla so the good thing is we don't have to care much about it is developed for us. But in case you need more direct communication for some application Ophono provides a D-Bus interface. If you end up writing this D-Bus interface in Qt you can upstream it to libq Ophono because that's mostly how libq Ophono also works. For example the SIM toolkit is as of now not yet supported in libq Ophono as far as I know so that would be the possible use case for this. Now do you have any questions about things that appeared so far otherwise I will go on with the small demo. Okay I don't see any questions so let's see if screen sharing works. So I will quickly demonstrate what I previously showed in the presentation slides. First we start with the default contract file and the GUI argument, nothing will happen at first. Then we switch to the tab so we can run the Ophono scripts. So first we enable the modem Ophono will open up and then we can set it online, now it's ready and then we can use it to for example send SMS. Here we can enter the virtual sender and send the message and then in theory it should appear here and we can answer to it and now it wasn't very well available so I will do it again. You can see that something happens here in the AT command so the message is set to the modem. That's pretty much it for now.