Overview

This module handle one or several Aldebaran's bluetooth boards.

Methods

AL::ALValue scan ()

Scan for bluetooth devices, this may take up to 10 seconds

Returns

a list of bluetooth devices <name, address>

void connect ()

Connect to all associated devices that we found.

void connect (const string& devicename)

Connect to a specific device.

devicename

the device name, this will be used to refer to the device later

bool isConnected (const string& devicename)

Is a device connected?

devicename

the device name

Returns

return true is the device is connected

void disconnect ()

Disconnect all bluetooth devices

void disconnect (const string& devicename)

Disconnect a bluetooth device

devicename

the device name to disconnect

void send (const string& devicename, const AL::ALValue& PWMs, const AL::ALValue& servos, const AL::ALValue& GPIOs)

Send data to a bluetooth device, each value should be provided.

devicename

the device name

PWMs

array of 4 signed short, should be between -32768 and 32768 (duty cycle ranging from -100% to 100%)

servos

array of 2 unsigned short, should be between 500 and 2500 (pulse width in microsecond)

GPIOs

array of 4 bool

vector<string> getConnectedDeviceList ()

list all connected bluetooth devices

Returns

a list of connected bluetooth device <name>

AL::ALValue getDeviceList ()

list all available bluetooth devices (need a scan before)

Returns

a list of bluetooth device <name, address>

AL::ALValue getAssociatedDeviceList ()

list all bluetooth devices that are associated with nao.

Returns

a list of bluetooth device <name, address>

void setAssociatedDeviceList (const AL::ALValue& deviceList)

set the device list that nao should handle. Association will be persistent after reboot.

deviceList

list of bluetooth device <name, address>


Methods inherited from ALModule

void exit ()

Exits and unregisters the module.

string version ()

Returns the version of the module.

Returns

A string containing the version of the module.

bool ping ()

Just a ping. Always returns true

Returns

returns true

vector<string> getMethodList ()

Retrieves the module's method list.

Returns

An array of method names.

AL::ALValue getMethodHelp (const string& methodName)

Retrieves a method's description.

methodName

The name of the method.

Returns

A structure containing the method's description.

AL::ALValue getModuleHelp ()

Retrieves the module's description.

Returns

A structure describing the module.

string getBrokerName ()

Gets the name of the parent broker.

Returns

The name of the parent broker.

string getUsage (const string& name)

Gets the method usage string. This summarise how to use the method.

name

The name of the method.

Returns

A string that summarises the usage of the method.


Copyright © 2010 Aldebaran Robotics - All rights reserved