Overview - API | NetworkInfo | NetworkInfo-IPInfo
The main features are:
This module gives access to useful information about the different network services, such as the strength of a WiFi service, its current state or its security requirement.
This module notifies through events the changes about the network connectivity.
ALConnectionManager is based on the open source software ConnMan to get information about all networks services and connecting to them.
Aldebaran Robotics is a contributor to the ConnMan project, our ConnMan sources are hosted on github http://github.com/aldebaran, only a few patches differs from the official ConnMan version, our goal is to limit as much as possible the differences between the two versions.
The WiFi services are handled by WPA Supplicant. The Bluetooth services are handled by BlueZ.
Limitation
The Tethering mode makes NAO acting as an Access Point, but it also shares your Internet connectivity. If NAO is connected to a corporate network, you have to verify if this mode is compatible with your network security policy.
Essential information to deal with ALConnectionManager:
Services objects from ConnectionManager are represented as NetworkInfo.
Getting the global state of the network connectivity
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
NAO_IP = "127.0.0.1"
alconnman = ALProxy("ALConnectionManager", NAO_IP, 9559)
print "network state: " + alconnman.state()
Getting the network services list
# -*- encoding: UTF-8 -*-
#!/usr/bin/env python
from naoqi import ALProxy
NAO_IP = "127.0.0.1"
alconnman = ALProxy("ALConnectionManager", NAO_IP, 9559)
#Scanning is required to update the services list
alconnman.scan()
services = alconnman.services()
for service in services:
network = dict(service)
if network["Name"] == "":
print "{hidden} " + network["ServiceId"]
else:
print network["Name"] + " " + network["ServiceId"]