Model Railroad System 2.2.2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
lcc::CANGridConnectOverUSBSerial Class Reference

Connect to a CAN bus using GridConnect formatted message over a USB Serial port. More...

Public Member Functions

 CANGridConnectOverUSBSerial (name,...)
 Constructor: create a connection to Grid Connect USB serial device. More...
 

Static Public Member Functions

static findAvailableComPorts ()
 Return a list of available (USB) serial ports. More...
 
static buildPortandnidDialog ()
 Function to construct the Dialog to ask the user for a port and Node ID. More...
 
static _CancelOpenTransport ()
 Function bound to the Cancel button. More...
 
static _OpenTransport ()
 Function bound to the Open button. More...
 
static requiredOpts ()
 Return the default option list. More...
 
static drawOptionsDialog (...)
 Pop up the Options Dialog box. More...
 

Static Public Attributes

static portandnidDialog
 Dialog to ask the user for a port and Node ID. More...
 
static portLCombo
 LabelComboBox containing all possible serial port devices. More...
 
static nidLEntry
 LabelEntry containing the Node ID. More...
 

Private Attributes

 gccomponent
 GC Component. More...
 
 ttyfd
 The tty I/O channel. More...
 

Detailed Description

Connect to a CAN bus using GridConnect formatted message over a USB Serial port.

Options:

Constructor & Destructor Documentation

◆ CANGridConnectOverUSBSerial()

lcc::CANGridConnectOverUSBSerial::CANGridConnectOverUSBSerial ( name  ,
  ... 
)

Constructor: create a connection to Grid Connect USB serial device.

Connect to the CAN bus via a Grid Connect USB serial port interface.

Parameters
nameThe name of the instance.
...The options:
  • -port The name of the serial port. Typically "/dev/ttyACMn" under Linux (using the cdc_acm driver).
  • -nid The Node ID that the computer will assume in the format of hh:hh:hh:hh:hh:hh which is a 48 bit number expressed as 6 pairs of hexadecimal digits separacted by colons (:).
  • -eventhandler This is a script prefix that is run on incoming messages. The current message as a binary CanMessage is appended.
  • -promisciousmode Promiscious mode flag. If true all messages are handled, whether they are addressed to this node or not.

References i.

Member Function Documentation

◆ _CancelOpenTransport()

static lcc::CANGridConnectOverUSBSerial::_CancelOpenTransport ( )
static

Function bound to the Cancel button.

Closes the dialog box and returns the empty string.

Returns
The empty string.

◆ _OpenTransport()

static lcc::CANGridConnectOverUSBSerial::_OpenTransport ( )
static

Function bound to the Open button.

Closes the dialog box and returns the options needed to open the transport.

Returns
An option argument list with the -nid and -port options.

◆ buildPortandnidDialog()

static lcc::CANGridConnectOverUSBSerial::buildPortandnidDialog ( )
static

Function to construct the Dialog to ask the user for a port and Node ID.

Returns
The Dialog box object.

◆ drawOptionsDialog()

static lcc::CANGridConnectOverUSBSerial::drawOptionsDialog (   ...)
static

Pop up the Options Dialog box.

Pops up the Options Dialog box and collects the options needed to open the CANGridConnectOverUSBSerial object.

Parameters
...Options:
  • -parent Set the parent for this dialog box.
  • -port The default serial port name for the serial port option.
  • -nid The default Node ID to use for the Node ID option.
Returns
Either the null string or an options list.

◆ findAvailableComPorts()

static lcc::CANGridConnectOverUSBSerial::findAvailableComPorts ( )
static

Return a list of available (USB) serial ports.

This method does a platform specific search for possible serial ports to use to communicate over the CAN bus.

Returns
A list of serial port device names.

◆ requiredOpts()

static lcc::CANGridConnectOverUSBSerial::requiredOpts ( )
static

Return the default option list.

Returns the default options for the options dialog.

Returns
The option value list.

Member Data Documentation

◆ gccomponent

lcc::CANGridConnectOverUSBSerial::gccomponent
private

GC Component.

◆ nidLEntry

lcc::CANGridConnectOverUSBSerial::nidLEntry
static

LabelEntry containing the Node ID.

◆ portandnidDialog

lcc::CANGridConnectOverUSBSerial::portandnidDialog
static

Dialog to ask the user for a port and Node ID.

◆ portLCombo

lcc::CANGridConnectOverUSBSerial::portLCombo
static

LabelComboBox containing all possible serial port devices.

◆ ttyfd

lcc::CANGridConnectOverUSBSerial::ttyfd
private

The tty I/O channel.