28#ifndef NIDIS_DYNLD_MODBUSRTU_H
29#define NIDIS_DYNLD_MODBUSRTU_H
31#include <nidas/Config.h>
34#include <modbus/modbus.h>
42namespace nidas {
namespace dynld {
116 bool process(
const Sample* samp,std::list<const Sample*>& results)
169 ModbusThread(
const std::string& devname, modbus_t* mb,
int regaddr,
170 int nvars,
int pipefd,
float rate):
171 Thread(devname+
"_modbus_thread",
false), _devname(devname), _mb(mb), _regaddr(regaddr),
172 _nvars(nvars), _pipefd(pipefd), _rate(
rate)
176 std::
string _devname;
184 ModbusThread(const ModbusThread&);
186 ModbusThread& operator=(const ModbusThread&);
189 ModbusThread *_thread;
197 void setFd(
int val) { _fd = val; }
200 ModbusIODevice *_iodevice;
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition DSMSensor.h:88
An interface to an IO device.
Definition IODevice.h:42
A SampleScanner which supports the set/get of message separation parameters and extracts samples from...
Definition SampleScanner.h:430
A scanner of sample data.
Definition SampleScanner.h:74
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Interface to a data sample.
Definition Sample.h:190
Support for a sensor that is sending packets on a TCP socket, a UDP socket, a Bluetooth RF Comm socke...
Definition SerialSensor.h:65
SampleScanner * buildSampleScanner()
Calls CharacterSensor::buildSampleScanner(), and then sets the per-byte transmission delay for that s...
Definition SerialSensor.cc:63
IODevice * buildIODevice()
Creates an IODevice depending on the device name prefix: name prefix type of IODevice inet: TCPSocket...
Definition SerialSensor.cc:71
void close()
close my associated device.
Definition SerialSensor.cc:136
A basic Unix I/O device, such as a named pipe, or a watched file.
Definition UnixIODevice.h:49
A subclass of MessageStreamScanner, with a modified nextSampleSepBOM() method that adjusts the sample...
Definition ModbusRTU.h:144
Sample * nextSampleSepBOM(DSMSensor *sensor)
Method to read input and break it into samples where the message separator occurs at the beginning of...
int _nbytesDiscarded
Definition ModbusRTU.h:153
ModbusMessageStreamScanner()
Definition ModbusRTU.h:146
A class for data from a modbus RTU sensor, connected to a serial port.
Definition ModbusRTU.h:85
bool process(const Sample *samp, std::list< const Sample * > &results)
Virtual method that is called to convert a raw sample containing an ASCII NMEA message to a processed...
Definition ModbusRTU.cc:338
void validate()
Definition ModbusRTU.cc:69
ModbusRTU()
Definition ModbusRTU.cc:60
void init()
Initialize the CharacterSensor instance for post-processing.
Definition ModbusRTU.cc:89
void open(int flags)
Open the sensor device port for real-time sampling.
Definition ModbusRTU.cc:138
uint16_t _nvars
Definition ModbusRTU.h:204
ModbusRTU & operator=(const ModbusRTU &)
ModbusRTU(const ModbusRTU &)
SampleTag * _stag
Definition ModbusRTU.h:206
The essential core classes of nidas.
Definition A2DConverter.h:31
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
static float rate
Definition sing.cc:53