On 26/02/2019 20:21, JH wrote:
Does ConnMan provide C API to setup WiFi and LTE connection? Or it is
not necessary to use API but use configuration in main.conf?
Both connman and ofono are primarily controlled via DBus. The
configuration file may get you most of what you want, but you still need
to configure the access point, set up a context for fallback to
UMTS/GSM, etc and this pretty much requires a bit of setup via dbus.
Calling DBus methods from C is no big deal. If your setup is simple,
though, you might be able to get away with just using the connmanctl
utility on the command line to do whatever minimal setup you need. It
all depends on the use case.
I am currently debating with my colleague about if it is necessary to
use connection manager in a small embedded Linux device with network
interfaces of LTE, WiFi and BLE. To cut the long story short, I
strongly proposed to use ConnMan and my colleague is against it, his
argument was connection manager should only be used in desktop not for
embedded system, he wanted to set up WiFi directly from
wpa_supplicant, run LTE connection directly from modem gpio. From my
point of view, set up WiFi directly from wpa_supplicant is fine, but
switch on / off LTE directly from gpio could cause serious
consequences, the application should never interact LTE directly
through low level of GPIO, it'll likely to break the integrity of the
kernel and Linux system where other parts of the kernel or system
access the modem via ioctl communication. The manager will make the
final call. As an embedded developer, none of us have experience in
connection manager, appreciate your comments.
So most modems expose one or more serial ports (real or virtual) that
can be used for sending commands to them; these are primarily
AT-commands, but there are other protocols around. There really aren't
many ioctls in play, though, in the common case.
Whether you have GPIO's involved is a matter of system design, but these
generally sit on some reset-line of the modem and that's about it.
You are right, though, in that you don't want multiple clients messing
about with the modem state concurrently. Best to leave that to one
agent and let other clients talk to the agent. That's where ofono comes
into play: ofono manages your modem so you (or connman) can control it
at a higher level of abstraction.
What connman gets you, primarily, is sane routing depending on
availability of the various types of connection. If WiFi isn't
available, connman can ask ofono to bring up the LTE connection and set
that up as the primary route. When WiFi becomes available, it can move
the default route to that. And so on... depending on your requirements.
Aside from that, your question isn't easy to answer. Do you need
connman? It depends. Do you need ofono? It depends. Do connman and
ofono work well on small embedded devices? Absolutely. Given the
nature of your questions, however, I have a hunch that a connection
manager of some sort is what you want.
connman mailing list