Hi, * Denis Kenzior <denkenz@xxxxxxxxx> [181230 00:14]: > Hi Pavel, > > > > Kernel 27.010 multiplexer or something else entirely? > > > > Kernel 27.010 multiplexer, AFAICT. Some of the endpoints are handled > > in kernel (gps, audio mixer control). > > > > Who sets up the multiplexer? Kernel? Yeah that's the kernel drivers/tty/n_gsm.c, and I'll be posting some patches to make it work with kernel serdev drivers. > It might make your job easier if the oFono driver itself invoked the > necessary magic to setup the multiplexer and handed off the devices as > needed. We used to have a driver like this, but not sure if it ever made it > upstream. Playing with ldattach and user space handling earlier this year did not work out good.. It needed app specific handling for the Motorola custom layer on top of ts 27.010, custom handling for all the devices such as GNSS and audio mixer, and did not work well with device specific power management. So let's not go back to that :) > > One more question: I guess I'll need to implement this... Is there > > another example of driver doing AT commands but on multiple file > > descriptors? I could really use something to look at as a template.. > > Any driver for a USB based device would be setup this way. Each AT port is > a separate file, e.g. ttyUSB1, ttyACM2, etc. The discovery is done via > udev. See plugins/mbm.c or plugins/ublox.c or plugins/telit.c, etc. > > Assuming you don't want to setup the multiplexer in oFono, then the only > tricky part is the port setup. udevng.c setup_serial_modem() assumes a > single port, so you might need to add some extra logic to setup the ports > via udev rules. We have network status data at /dev/motmdm1, outgoing SMS PDU device at /dev/motmdm3, incoming SMS PDU device at /dev/motmdm9 and so on for each ts 27.010 channel. At least incoming and outgoing SMS PDU devices could be considered as separate modems if that makes things easier? > Alternatively, simply use a config file specific to your driver. See for > example how plugins/phonesim.c does this. > > Or, if it is an extremely platform specific driver, then just hardcode it. > E.g. like plugins/calypso.c, which only works for the Freerunner. Just adding one more thing to consider: Looks like the modem handling for SMS PDU's needs to be specific to the nework. First the network needs to be detected, and then the GSM or CDMA handlers need to be used for sending and receiving SMS. After that things should get standard.. Looks like ofono has parsing for the different type SMS PDUs in src/*sms*.c :) Regards, Tony