0.4.1
Loading...
Searching...
No Matches
NAV::UartSensor Class Reference

Abstract Uart Sensor Class. More...

Public Types

enum  Baudrate : uint32_t {
  BAUDRATE_FASTEST ,
  BAUDRATE_9600 ,
  BAUDRATE_19200 ,
  BAUDRATE_38400 ,
  BAUDRATE_57600 ,
  BAUDRATE_115200 ,
  BAUDRATE_128000 ,
  BAUDRATE_230400 ,
  BAUDRATE_460800 ,
  BAUDRATE_921600
}
 Available Baudrates. More...
 

Public Member Functions

UartSensoroperator= (const UartSensor &)=delete
 Copy assignment operator.
 
UartSensoroperator= (UartSensor &&)=delete
 Move assignment operator.
 
 UartSensor (const UartSensor &)=delete
 Copy constructor.
 
 UartSensor (UartSensor &&)=delete
 Move constructor.
 
 ~UartSensor ()=default
 Destructor.
 

Protected Member Functions

void restore (const json &j)
 Restores the node from a json object.
 
json save () const
 Saves the node into a json object.
 
Baudrate sensorBaudrate () const
 Returns the Baudrate for the element Selected by the GUI.
 
 UartSensor ()=default
 Default constructor.
 

Static Protected Member Functions

static int baudrate2Selection (Baudrate baud)
 Returns the guiSelection for the given baudrate.
 

Protected Attributes

int _selectedBaudrate
 Baudrate for the sensor.
 
std::string _sensorPort
 

Detailed Description

Abstract Uart Sensor Class.

Definition at line 25 of file UartSensor.hpp.

Member Enumeration Documentation

◆ Baudrate

enum NAV::UartSensor::Baudrate : uint32_t

Available Baudrates.

Enumerator
BAUDRATE_FASTEST 

Fastest possible Baudrate will be automatically chosen.

BAUDRATE_9600 

Baudrate with 9600 symbols per second [Baud].

BAUDRATE_19200 

Baudrate with 19200 symbols per second [Baud].

BAUDRATE_38400 

Baudrate with 38400 symbols per second [Baud].

BAUDRATE_57600 

Baudrate with 57600 symbols per second [Baud].

BAUDRATE_115200 

Baudrate with 115200 symbols per second [Baud].

BAUDRATE_128000 

Baudrate with 128000 symbols per second [Baud].

BAUDRATE_230400 

Baudrate with 230400 symbols per second [Baud].

BAUDRATE_460800 

Baudrate with 460800 symbols per second [Baud].

BAUDRATE_921600 

Baudrate with 921600 symbols per second [Baud].

Definition at line 29 of file UartSensor.hpp.

Constructor & Destructor Documentation

◆ ~UartSensor()

NAV::UartSensor::~UartSensor ( )
default

Destructor.

◆ UartSensor() [1/3]

NAV::UartSensor::UartSensor ( const UartSensor & )
delete

Copy constructor.

◆ UartSensor() [2/3]

NAV::UartSensor::UartSensor ( UartSensor && )
delete

Move constructor.

◆ UartSensor() [3/3]

NAV::UartSensor::UartSensor ( )
protecteddefault

Default constructor.

Member Function Documentation

◆ baudrate2Selection()

int NAV::UartSensor::baudrate2Selection ( Baudrate baud)
staticprotected

Returns the guiSelection for the given baudrate.

Parameters
[in]baudBaudrate to convert

Definition at line 81 of file UartSensor.cpp.

◆ operator=() [1/2]

UartSensor & NAV::UartSensor::operator= ( const UartSensor & )
delete

Copy assignment operator.

◆ operator=() [2/2]

UartSensor & NAV::UartSensor::operator= ( UartSensor && )
delete

Move assignment operator.

◆ restore()

void NAV::UartSensor::restore ( const json & j)
protected

Restores the node from a json object.

Parameters
[in]jJson object with the node state

Definition at line 25 of file UartSensor.cpp.

◆ save()

json NAV::UartSensor::save ( ) const
nodiscardprotected

Saves the node into a json object.

Definition at line 13 of file UartSensor.cpp.

◆ sensorBaudrate()

NAV::UartSensor::Baudrate NAV::UartSensor::sensorBaudrate ( ) const
nodiscardprotected

Returns the Baudrate for the element Selected by the GUI.

Definition at line 41 of file UartSensor.cpp.

Field Documentation

◆ _selectedBaudrate

int NAV::UartSensor::_selectedBaudrate
protected

Baudrate for the sensor.

Definition at line 82 of file UartSensor.hpp.

◆ _sensorPort

std::string NAV::UartSensor::_sensorPort
protected

COM port where the sensor is attached to

  • "COM1" (Windows format for physical and virtual (USB) serial port)
  • "/dev/ttyS1" (Linux format for physical serial port)
  • "/dev/ttyUSB0" (Linux format for virtual (USB) serial port)
  • "/dev/tty.usbserial-FTXXXXXX" (Mac OS X format for virtual (USB) serial port)
  • "/dev/ttyS0" (CYGWIN format. Usually the Windows COM port number minus 1. This would connect to COM1)

Definition at line 79 of file UartSensor.hpp.


The documentation for this class was generated from the following files: