Hi Pierre,
On Mon, Jul 24, 2017 at 3:18 PM, Daniel Wagner <wagi(a)monom.org> wrote:
Hi Pierre,
On 07/24/2017 02:40 PM, Pierre Couderc wrote:
>
> For example, if want to list the wifi essids available in my C app, I
> think the best way is connman by the D-Bus.
ConnMan main API is D-Bus. There are some config files which are also
honored but anything dynamic is exposed via the D-Bus API. So there isn't
really a choice :)
> Ant I suppose GDbus is the best way.
I also use GIO/GDBus for my project in C/C++ (do not use dbus glib
which is deprecated),
You can found some example with bluetooth-gnome here:
https://github.com/GNOME/gnome-bluetooth/blob/master/lib/bluetooth-client.c
Since BlueZ and ConnMan have a similar way to do API it may help a lot.
Using gdbus-codegen may help at the beginning, especially for the
complicated signature of services
method "a(oa{sv})".
You can also use d-feet tools to have a graphical view of the API and concept.
Not worth to read to dbus specification
https://dbus.freedesktop.org/doc/dbus-specification.html
Also it may be interresting to do unit test and run valgrind to check
for memory leak, use of GVariant
is not always easy at the begining to track who have the ownership of
the differents objects.
Regards,
Julien
--
*This email and any attachment thereto are confidential and intended solely
for the use of the individual or entity to whom they are addressed.If you
are not the intended recipient, please be advised that disclosing, copying,
distributing or taking any action in reliance on the contents of this email
is strictly prohibited. In such case, please immediately advise the sender,
and delete all copies and attachment from your system.This email shall not
be construed and is not tantamount to an offer, an acceptance of offer, or
an agreement by SoftBank Robotics Europe on any discussion or contractual
document whatsoever. No employee or agent is authorized to represent or
bind SoftBank Robotics Europe to third parties by email, or act on behalf
of SoftBank Robotics Europe by email, without express written confirmation
by SoftBank Robotics Europe’ duly authorized representatives.*
------------------------------
*Ce message électronique et éventuelles pièces jointes sont confidentiels,
et exclusivement destinés à la personne ou l'entité à qui ils sont
adressés.Si vous n'êtes pas le destinataire visé, vous êtes prié de ne pas
divulguer, copier, distribuer ou prendre toute décision sur la foi de ce
message électronique. Merci d'en aviser immédiatement l'expéditeur et de
supprimer toutes les copies et éventuelles pièces jointes de votre
système.Ce message électronique n'équivaut pas à une offre, à une
acceptation d’offre, ou à un accord de SoftBank Robotics Europe sur toute
discussion ou document contractuel quel qu’il soit, et ne peut être
interprété comme tel. Aucun employé ou agent de SoftBank Robotics Europe
n'est autorisé à représenter ou à engager la société par email, ou à agir
au nom et pour le compte de la société par email, sans qu’une confirmation
écrite soit donnée par le représentant légal de SoftBank Robotics Europe ou
par toute autre personne ayant reçu délégation de pouvoir appropriée.*