LMXBluetoothModule Class Reference

LMX Bluetooth module class. More...

#include <LMXBluetoothModule.h>

Inheritance diagram for LMXBluetoothModule:
BluetoothModule Thread PowerEventListener

List of all members.

Public Member Functions

 LMXBluetoothModule (const char *portName)
 Class constructor.
virtual ~LMXBluetoothModule ()
 Class destructor.
virtual bool shutdown ()
 Shut down Bluetooth subsystem (static).
virtual std::string getLocalMac ()
 Get MAC address.
virtual std::string getVersion ()
virtual void setEnabled (bool enabled)
 Enable or disable the module Enables or disables the LMX Bluetooth module.
virtual bool powerStateChange (PowerState oldState, PowerState newState)
 Change module power state Changes the module power state, if power management is enabled.

Static Public Member Functions

static bool initialize ()
 Initialize Bluetooth subsystem (static).

Protected Member Functions

virtual bool sendSPPData (int connid, const void *data, size_t len)
 Send SPP data over the bluetooth connection.
virtual bool addSDPRecord (int localPort, void *data, size_t len)
 Stores a new service record in local SDP database Stores a new service record in Service Discovery Database.
virtual bool connectSPP (int idConn, unsigned char *dstAddr, unsigned char dstPort)
 Initiate a SPP connection.
virtual bool listenSPP (int idConn)
 Puts the device into listening mode Puts the device into listening mode, activates the proper SDP record.
virtual bool disconnectSPP (int idConn)
 Request a SPP connection disconnect.

Detailed Description

LMX Bluetooth module class.

Implements the National LMX-series Bluetooth module functionality.


Constructor & Destructor Documentation

LMXBluetoothModule::LMXBluetoothModule ( const char *  portName  ) 

Class constructor.

Initializes the LMX Bluetooth module object.

Parameters:
portName Points to a null-terminated string containing the name of the serial port the LMX module is connected to.
LMXBluetoothModule::~LMXBluetoothModule (  )  [virtual]

Class destructor.

Terminates the LMX Bluetooth module object.


Member Function Documentation

bool LMXBluetoothModule::addSDPRecord ( int  localPort,
void *  data,
size_t  len 
) [protected, virtual]

Stores a new service record in local SDP database Stores a new service record in Service Discovery Database.

Parameters:
localPort Local port used by the service
data Pointer to the data to be used
len Data length
Returns:
Returns true if the record was successfully created

Implements BluetoothModule.

bool LMXBluetoothModule::connectSPP ( int  idConn,
unsigned char *  dstAddr,
unsigned char  dstPort 
) [protected, virtual]

Initiate a SPP connection.

Initiates a SPP connection process for a connection id.

Parameters:
idConn Connection ID (=local port), returned from connection object registration.
dstAddr Destination MAC address
dstPort Destination port
Returns:
Returns true if connection process was initiated, false on error.

Implements BluetoothModule.

bool LMXBluetoothModule::disconnectSPP ( int  idConn  )  [protected, virtual]

Request a SPP connection disconnect.

Initiates a SPP disconnect process

Parameters:
idConn Connection ID
Returns:
Returns true if disconnect was initiated, false on error

Implements BluetoothModule.

std::string LMXBluetoothModule::getLocalMac (  )  [virtual]

Get MAC address.

Retrieves the hardware MAC address of the LMX Bluetooth module.

Returns:
Returns the text string containing a formatted MAC address.

Implements BluetoothModule.

virtual std::string LMXBluetoothModule::getVersion (  )  [inline, virtual]

Reader implementation should override this function to implement method for retrieving reader's bluetooth protocol version.

Returns:
Returns version number as string

Implements BluetoothModule.

bool LMXBluetoothModule::initialize (  )  [static]

Initialize Bluetooth subsystem (static).

Creates the LMX Bluetooth Module object, performs an initial handshake procedure with the LMX Bluetooth module, starts BT thread

Returns:
Returns true if the bluetooth subsystem was initialized successfully.
bool LMXBluetoothModule::listenSPP ( int  idConn  )  [protected, virtual]

Puts the device into listening mode Puts the device into listening mode, activates the proper SDP record.

Parameters:
idConn Connection ID that should be used for listening incoming packets
Returns:
Returns true if the device is in listening mode, false otherwise

Implements BluetoothModule.

bool LMXBluetoothModule::powerStateChange ( PowerState  oldState,
PowerState  newState 
) [virtual]

Change module power state Changes the module power state, if power management is enabled.

Parameters:
oldState Current power state of the module
newState The power state the module should be put into
Returns:
Returns true if the power state change was successful, false otherwise

Implements PowerEventListener.

bool LMXBluetoothModule::sendSPPData ( int  connid,
const void *  data,
size_t  len 
) [protected, virtual]

Send SPP data over the bluetooth connection.

Parameters:
connid Connection ID, returned on SPP connection registration
data Data to be sent over SPP link
len Data length

Data buffer given by *data parameter will be sent out over Bluetooth.

Note:
The return value shows if the data was sent out, not received by other end!
Returns:
Returns true if data was sent out, false on error

Implements BluetoothModule.

void LMXBluetoothModule::setEnabled ( bool  enabled  )  [virtual]

Enable or disable the module Enables or disables the LMX Bluetooth module.

Parameters:
enabled Set to true to enable the module, false to disable it

Implements BluetoothModule.

bool LMXBluetoothModule::shutdown (  )  [virtual]

Shut down Bluetooth subsystem (static).

Disconnects all Bluetooth connections, stops BT thread. You should delete all connection objects before shutting down LMXBluetoothModule!

Returns:
Returns true if the bluetooth subsystem was shut down successfully.

Implements BluetoothModule.


The documentation for this class was generated from the following files:
Generated on Wed Oct 20 11:13:44 2010 for libspatha by  doxygen 1.6.3