rllib  1
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
rlDF1 Class Reference

#include <rldf1.h>

Collaboration diagram for rlDF1:
Collaboration graph
[legend]

Public Types

enum  DF1ret {
  retERROR_TNS = -6, retERROR_STS = -5, retERROR_CRC = -4, retERROR_NAC = -3,
  retERROR = -2, retNORESPONSE = -1, retSUCCESS = 0
}
 
enum  CPUMODE { PROGRAM = 0, TEST, RUN, NOCHANGE }
 

Public Member Functions

 rlDF1 (unsigned char src=0, int timeout=1000)
 
virtual ~rlDF1 ()
 
void registerSerial (rlSerial *serial)
 
int cmdSetCPUMode (unsigned char destination, unsigned char mode)
 
int cmdDiagnosticStatus (unsigned char destination, unsigned char *data)
 
int cmdLogicalRead (unsigned char destination, unsigned char nsize, unsigned char filetype, unsigned char filenum, unsigned char adr, unsigned char sadr, unsigned char *buffer)
 
int cmdLogicalWrite (unsigned char destination, unsigned char nsize, unsigned char filetype, unsigned char filenum, unsigned char adr, unsigned char sadr, unsigned char *buffer)
 
int requests ()
 
int responses ()
 
void clearStats ()
 

Private Types

enum  DF1BytePos {
  POS_DST =0, POS_SRC =1, POS_CMD =2, POS_STS =3,
  POS_TNSL =4, POS_TNSH =5, POS_DATA =6
}
 
enum  DF1ControlChars {
  SOH = 0x01, STX = 0x02, ETX = 0x03, EOT = 0x04,
  ENQ = 0x05, ACK = 0x06, DLE = 0x10, NAC = 0x15
}
 
enum  DF1Flags { FLAG_TIMEOUT =-1, FLAG_DATA =0, FLAG_CONTROL =1 }
 

Private Member Functions

int sendCommand (unsigned char destination, unsigned char cmd, unsigned char sts, unsigned char *cdata, unsigned char len)
 
int receiveAnswer (unsigned char &destination, unsigned char &cmd, unsigned char &sts, unsigned char *cdata, unsigned char &len)
 
int writeBuffer (unsigned char *buffer, int len)
 
int writeBuffer (df1Buffer &buffer)
 
int getSymbol (unsigned char *c)
 
int get (unsigned char *c)
 
int sendENQ ()
 
int sendACK ()
 
int sendNAC ()
 

Private Attributes

rlSerialtty
 
bool active
 
unsigned short tns
 
int nRequests
 
int nResponses
 
unsigned char source
 
int timeout
 

Detailed Description

Definition at line 38 of file rldf1.h.

Member Enumeration Documentation

◆ CPUMODE

      Command: Set CPU mode ( See page 7-26 )
      destination = destination ID
      mode = CPUMODE value
Enumerator
PROGRAM 
TEST 
RUN 
NOCHANGE 

Definition at line 67 of file rldf1.h.

67  {
68  PROGRAM = 0,
69  TEST,
70  RUN,
71  NOCHANGE
72  };

◆ DF1BytePos

enum rlDF1::DF1BytePos
private
      Functions for Data Link Layer.
      Internal Use ONLY.
Enumerator
POS_DST 
POS_SRC 
POS_CMD 
POS_STS 
POS_TNSL 
POS_TNSH 
POS_DATA 

Definition at line 158 of file rldf1.h.

158  {
159  POS_DST =0,
160  POS_SRC =1,
161  POS_CMD =2,
162  POS_STS =3,
163  POS_TNSL =4,
164  POS_TNSH =5,
165  POS_DATA =6
166  };

◆ DF1ControlChars

enum rlDF1::DF1ControlChars
private
Enumerator
SOH 

Page 2-6 of Ref Manual.

STX 
ETX 
EOT 
ENQ 
ACK 
DLE 
NAC 

Definition at line 167 of file rldf1.h.

167  {
168  SOH = 0x01,
169  STX = 0x02,
170  ETX = 0x03,
171  EOT = 0x04,
172  ENQ = 0x05,
173  ACK = 0x06,
174  DLE = 0x10,
175  NAC = 0x15
176  };
Page 2-6 of Ref Manual.
Definition: rldf1.h:168

◆ DF1Flags

enum rlDF1::DF1Flags
private
Enumerator
FLAG_TIMEOUT 
FLAG_DATA 
FLAG_CONTROL 

Definition at line 177 of file rldf1.h.

177  {
178  FLAG_TIMEOUT =-1,
179  FLAG_DATA =0,
180  FLAG_CONTROL =1
181  };

◆ DF1ret

Enumerator
retERROR_TNS 
retERROR_STS 
retERROR_CRC 
retERROR_NAC 
retERROR 
retNORESPONSE 
retSUCCESS 

Definition at line 51 of file rldf1.h.

51  {
52  retERROR_TNS = -6,
53  retERROR_STS = -5,
54  retERROR_CRC = -4,
55  retERROR_NAC = -3,
56  retERROR = -2,
57  retNORESPONSE = -1,
58  retSUCCESS = 0
59  };

Constructor & Destructor Documentation

◆ rlDF1()

rlDF1::rlDF1 ( unsigned char  src = 0,
int  timeout = 1000 
)
    Initialize class
    src = id of local device
    timeout = receive timeout in ms

Get a random TNS

Definition at line 145 of file rldf1.cpp.

146 {
147  source = src;
148  timeout=_timeout;
149  tty = NULL;
150  active = false;
151  nRequests = 0;
152  nResponses = 0;
153  tns = (unsigned short) time((time_t *)0);
154 }
int nRequests
Definition: rldf1.h:195
int timeout
Definition: rldf1.h:198
unsigned short tns
Definition: rldf1.h:193
int nResponses
Definition: rldf1.h:196
bool active
Definition: rldf1.h:192
unsigned char source
Definition: rldf1.h:197
rlSerial * tty
Definition: rldf1.h:191

◆ ~rlDF1()

rlDF1::~rlDF1 ( )
virtual

Definition at line 156 of file rldf1.cpp.

157 {
158 }

Member Function Documentation

◆ clearStats()

void rlDF1::clearStats ( )
inline

Definition at line 206 of file rldf1.h.

206 { nRequests=0; nResponses=0;};
int nRequests
Definition: rldf1.h:195
int nResponses
Definition: rldf1.h:196

◆ cmdDiagnosticStatus()

int rlDF1::cmdDiagnosticStatus ( unsigned char  destination,
unsigned char *  data 
)
        Command: Diagnostic Status
        Reads a block of status information from an interface module.
        The function returns the status information in data.
        (see Chapter 10, “Diagnostic Status Information.”)
        destination = destination ID
        data = buffer for data return
        returns the number of valid bytes in data or Error Code

Definition at line 257 of file rldf1.cpp.

258 {
259  unsigned char cdat[256];
260  cdat[0]=0x03;
261  int ret = sendCommand( destination, 0x06, 0x00, cdat, 1);
262  if (ret==retSUCCESS) {
263  unsigned char dest,cmd,sts,len;
264  ret = receiveAnswer( dest, cmd, sts, cdat, len);
265  if ( ret == retSUCCESS ) {
266  for (int i=0;i<len;i++) buffer[i]=cdat[i];
267  ret = len;
268  }
269  }
270  return ret;
271 }
int sendCommand(unsigned char destination, unsigned char cmd, unsigned char sts, unsigned char *cdata, unsigned char len)
Definition: rldf1.cpp:319
int receiveAnswer(unsigned char &destination, unsigned char &cmd, unsigned char &sts, unsigned char *cdata, unsigned char &len)
Definition: rldf1.cpp:386

◆ cmdLogicalRead()

int rlDF1::cmdLogicalRead ( unsigned char  destination,
unsigned char  nsize,
unsigned char  filetype,
unsigned char  filenum,
unsigned char  adr,
unsigned char  sadr,
unsigned char *  buffer 
)
        Command: protected typed logical read with three address fields
        *Most Important command*. Reads data from a logical address.
        Parameters:
            destination = destination ID
            nsize = size of data to be read
            filetype = Type of file with number filenum
                            84 hex: status
                            85 hex: bit
                            86 hex: timer
                            87 hex: counter
                            88 hex: control
                            89 hex: integer
                            8A hex: floating point
                            8B hex: output logical by slot
                            8C hex: input logical by slot
                            8D hex: string
                            8E hex: ASCII
                            8F hex: BCD
            filenum = filenumber in PLC memory
            adr  = Elements Address (see Manual)
            sadr = Subelements Address (see Manual)
            data = buffer for data return
        returns the number of valid bytes in data or Error Code

Definition at line 273 of file rldf1.cpp.

274 {
275  unsigned char cdat[256];
276  cdat[0]=0xA2;
277  cdat[1]=nsize;
278  cdat[2]=filenum;
279  cdat[3]=filetype;
280  cdat[4]=adr;
281  cdat[5]=sadr;
282  int ret = sendCommand( destination , 0x0F, 0x00, cdat, 6);
283  if (ret==retSUCCESS) {
284  unsigned char dest,cmd,sts,len;
285  ret = receiveAnswer( dest, cmd, sts, cdat, len);
286  if ( ret == retSUCCESS ) {
287  for (int i=0;i<len;i++) buffer[i]=cdat[i];
288  ret = len;
289  }
290  if (sts!=0) ret = retERROR_STS;
291  }
292  return ret;
293 }
int sendCommand(unsigned char destination, unsigned char cmd, unsigned char sts, unsigned char *cdata, unsigned char len)
Definition: rldf1.cpp:319
int receiveAnswer(unsigned char &destination, unsigned char &cmd, unsigned char &sts, unsigned char *cdata, unsigned char &len)
Definition: rldf1.cpp:386

◆ cmdLogicalWrite()

int rlDF1::cmdLogicalWrite ( unsigned char  destination,
unsigned char  nsize,
unsigned char  filetype,
unsigned char  filenum,
unsigned char  adr,
unsigned char  sadr,
unsigned char *  buffer 
)
        Command: protected typed logical write with three address fields
        *Most Important command*. Writes data to a logical address.
        Parameters:
            destination = destination ID
            nsize = size of data to write
            filetype = Type of file with number filenum
                            84 hex: status
                            85 hex: bit
                            86 hex: timer
                            87 hex: counter
                            88 hex: control
                            89 hex: integer
                            8A hex: floating point
                            8B hex: output logical by slot
                            8C hex: input logical by slot
                            8D hex: string
                            8E hex: ASCII
                            8F hex: BCD
            filenum = filenumber in PLC memory
            adr  = Elements Address (see Manual)
            sadr = Subelements Address (see Manual)
            data = buffer of data to write
        returns Error Code

Definition at line 294 of file rldf1.cpp.

295 {
296  unsigned char cdat[256];
297  cdat[0]=0xAA;
298  cdat[1]=nsize;
299  cdat[2]=filenum;
300  cdat[3]=filetype;
301  cdat[4]=adr;
302  cdat[5]=sadr;
303  for (int i=0;i<nsize;i++) cdat[6+i] = buffer[i];
304  int ret = sendCommand( destination, 0x0F, 0x00, cdat, 6+nsize);
305  if (ret==retSUCCESS) {
306  unsigned char dest,cmd,sts,len;
307  ret = receiveAnswer( dest, cmd, sts, cdat, len);
308  if ( ret == retSUCCESS ) {
309  for ( int i=0;i<len;i++) buffer[i] = cdat[i];
310  ret = len;
311  }
312  if (sts!=0) ret = retERROR_STS;
313  }
314  return ret;
315 }
int sendCommand(unsigned char destination, unsigned char cmd, unsigned char sts, unsigned char *cdata, unsigned char len)
Definition: rldf1.cpp:319
int receiveAnswer(unsigned char &destination, unsigned char &cmd, unsigned char &sts, unsigned char *cdata, unsigned char &len)
Definition: rldf1.cpp:386

◆ cmdSetCPUMode()

int rlDF1::cmdSetCPUMode ( unsigned char  destination,
unsigned char  mode 
)

Definition at line 240 of file rldf1.cpp.

241 {
242 
243  unsigned char cdat[256];
244  cdat[0]=0x3A;
245  cdat[1]=mode;
246  int ret = sendCommand( destination, 0x0F, 0x00, cdat, 2);
247  if (ret==retSUCCESS) {
248  unsigned char dest,cmd,sts,len;
249  ret = receiveAnswer( dest, cmd, sts, cdat, len);
250  if (sts!=0) {
251  printf("\nSet CPU Mode Execution Error! STS:%02X",sts);
252  }
253  }
254  return ret;
255 }
int sendCommand(unsigned char destination, unsigned char cmd, unsigned char sts, unsigned char *cdata, unsigned char len)
Definition: rldf1.cpp:319
int receiveAnswer(unsigned char &destination, unsigned char &cmd, unsigned char &sts, unsigned char *cdata, unsigned char &len)
Definition: rldf1.cpp:386

◆ get()

int rlDF1::get ( unsigned char *  c)
private

Definition at line 203 of file rldf1.cpp.

204 {
205 
206  int ret = tty->readBlock( c, 1, timeout);
207  if (ret<=0) return FLAG_TIMEOUT;
208  return FLAG_DATA;
209 }
int timeout
Definition: rldf1.h:198
int readBlock(unsigned char *buf, int len, int timeout=-1)
Definition: rlserial.cpp:498
rlSerial * tty
Definition: rldf1.h:191

◆ getSymbol()

int rlDF1::getSymbol ( unsigned char *  c)
private

Definition at line 184 of file rldf1.cpp.

185 {
186 
187  int ret = tty->readBlock( c, 1, timeout);
188  if (ret<=0) return FLAG_TIMEOUT;
189  if (*c!=DLE) {
190  return FLAG_DATA;
191  } else {
192  ret = tty->readBlock( c, 1, timeout);
193  if (ret<=0) return FLAG_TIMEOUT;
194  if (*c==DLE) {
195  return FLAG_DATA;
196  } else {
197  return FLAG_CONTROL;
198  }
199 
200  }
201 }
int timeout
Definition: rldf1.h:198
int readBlock(unsigned char *buf, int len, int timeout=-1)
Definition: rlserial.cpp:498
rlSerial * tty
Definition: rldf1.h:191

◆ receiveAnswer()

int rlDF1::receiveAnswer ( unsigned char &  destination,
unsigned char &  cmd,
unsigned char &  sts,
unsigned char *  cdata,
unsigned char &  len 
)
private

CRC LOW

CRC HI

Definition at line 386 of file rldf1.cpp.

387 {
388  int ret;
389  static unsigned char response=NAC;
390  df1Buffer msg;
391  int flag;
392  unsigned char rxc;
393 
394  DBGPRINTF("\n\tDF1::receiveAnswer >");
395  while(1) {
396  flag = getSymbol(&rxc);
397  if ( flag == FLAG_TIMEOUT ) {
398  DBGPRINTF("\nreceiveAnswer() Timeout....");
399  ret = retNORESPONSE;
400  break;
401 
402  } else if ( ( flag==FLAG_CONTROL) && ( rxc == STX) ) {
403 
404  DBGPRINTF(" DLE STX >")
405  msg.reset();
406  while ( (flag=getSymbol(&rxc))==FLAG_DATA ) {
407  DBGPRINTF("[%02X]", rxc);
408  msg.write(rxc);
409  }
410  if ( rxc != ETX ) {
411  DBGPRINTF(" [NO ETX] ");
412  sendNAC();
413  response = NAC;
414  continue;
415  }
416  DBGPRINTF(" ETX \n\t");
417  flag = get(&rxc);
418  if ( flag == FLAG_TIMEOUT) {
419  sendNAC();
420  response = NAC;
421  continue;
422  }
423  DBGPRINTF(" CRCLH:[%02X", rxc);
424  unsigned short crc = (unsigned short)rxc;
425  flag = get(&rxc);
426  if ( flag == FLAG_TIMEOUT) {
427  sendNAC();
428  response = NAC;
429  continue;
430  }
431  DBGPRINTF(":%02X] ", rxc);
432  crc += ( (unsigned short)rxc )<<8;
433  if ( crc != computeCRC( msg.data(), msg.length() ) ) {
434  DBGPRINTF(" [CRC ERROR] ");
435  sendNAC();
436  response = NAC;
437  continue;
438  }
439  unsigned short tns_ = (unsigned short)msg[POS_TNSL];
440  tns_ += ( (unsigned short)msg[POS_TNSH] )<<8;
441  DBGPRINTF(" TNS:[%04X] ", tns_);
442  if ( tns_ != tns ) {
443  DBGPRINTF(" [TNS ERROR] ");
444  sendACK();
445  response = ACK;
446  ret = retERROR_TNS;
447  break;
448  }
449  /* STS is a software error. Handle it in upper layer!
450  if ( msg[POS_STS]!=0 ) {
451  DBGPRINTF(" [STS=%02X != 0] ",msg[POS_STS]);
452  sendACK();
453  response = ACK;
454  ret = retERROR_STS;
455  break;
456  }
457  */
458  destination = msg[POS_DST];
459  cmd = msg[POS_CMD];
460  sts = msg[POS_STS];
461  len = msg.length()-6;
462  for (int i=0; i<len; i++) cdata[i] = msg[i + POS_DATA];
463  sendACK();
464  nResponses++;
465  response = ACK;
466  ret = retSUCCESS;
467  break;
468  } else if ( ( flag==FLAG_CONTROL) && ( rxc == ENQ) ) {
469  if (response==ACK) sendACK(); else sendNAC();
470  ret = retERROR;
471  break;
472  } else {
473  response = NAC;
474  }
475 
476  }
477  return ret;
478 }
unsigned short tns
Definition: rldf1.h:193
unsigned char * data()
Definition: rldf1.cpp:59
int sendACK()
Definition: rldf1.cpp:220
int nResponses
Definition: rldf1.h:196
unsigned int write(unsigned char c)
Definition: rldf1.cpp:78
int getSymbol(unsigned char *c)
Definition: rldf1.cpp:184
int sendNAC()
Definition: rldf1.cpp:229
#define DBGPRINTF(x...)
Definition: rldf1.cpp:41
static unsigned short computeCRC(const unsigned char *buffer, int len)
Definition: rldf1.cpp:133
unsigned int length()
Definition: rldf1.cpp:58

◆ registerSerial()

void rlDF1::registerSerial ( rlSerial serial)

Definition at line 160 of file rldf1.cpp.

161 {
162  tty = serial;
163 }
rlSerial * tty
Definition: rldf1.h:191

◆ requests()

int rlDF1::requests ( )
inline
    Some statistics...

Definition at line 204 of file rldf1.h.

204 {return nRequests;};
int nRequests
Definition: rldf1.h:195

◆ responses()

int rlDF1::responses ( )
inline

Definition at line 205 of file rldf1.h.

205 {return nResponses;};
int nResponses
Definition: rldf1.h:196

◆ sendACK()

int rlDF1::sendACK ( )
private

Definition at line 220 of file rldf1.cpp.

221 {
222  static unsigned char buf[2];
223  DBGPRINTF("\nsendACK()");
224  buf[0] = DLE;
225  buf[1] = ACK;
226  return writeBuffer( buf, 2 );
227 }
int writeBuffer(unsigned char *buffer, int len)
Definition: rldf1.cpp:165
#define DBGPRINTF(x...)
Definition: rldf1.cpp:41

◆ sendCommand()

int rlDF1::sendCommand ( unsigned char  destination,
unsigned char  cmd,
unsigned char  sts,
unsigned char *  cdata,
unsigned char  len 
)
private
      Functions for Application Layer.
      Normally private. If you want to add new Commands do it with new public functions.
      sendCommand implements sending with retries and handling
        destination = id of remote device
        cmd = Command Code (see page 6-3)
        sts = Status Code (see page 6-6 )
        cdata = Pointer to Command Specific data packet ( Chapter 7 )
        len = Length of cdata
      receiveAnswer gets answer frame from remote.
 

SOURCE

Definition at line 319 of file rldf1.cpp.

320 {
321  df1Buffer msg;
322  df1Buffer fullmsg;
323  unsigned short crc;
324 
325  tns++;
326  nRequests++;
327  DBGPRINTF("\n\tDF1::sendCommand >");
328  DBGPRINTF(" Dest:%02X", destination);
329  DBGPRINTF(" CMD:%02X", cmd);
330  DBGPRINTF(" STS:%02X", sts);
331  DBGPRINTF(" TNS:%04X", tns);
332  DBGPRINTF(" DATA [%d]: ",len);
333  for (int i=0; i<len; i++) { DBGPRINTF("[%02X] ",cdata[i]); }
334  msg.write( destination );
335  msg.write( source );
336  msg.write( cmd );
337  msg.write( sts );
338  msg.write( (unsigned char)(tns&0x00FF) );
339  msg.write( (unsigned char)(tns>>8) );
340  for(int i=0; i<len; i++) msg.write( cdata[i] );
341  //msg.print();
342  crc = computeCRC( msg.data(), msg.length() );
343  DBGPRINTF(" [CRC=%04X] ",crc);
344  fullmsg.write( DLE );
345  fullmsg.write( STX );
346  for(int i=0; i<(int)msg.length(); i++) fullmsg.writeDLE( *(msg.data()+i) );
347  fullmsg.write( DLE );
348  fullmsg.write( ETX );
349  fullmsg.write( (unsigned char)(crc&0x00FF) );
350  fullmsg.write( (unsigned char)(crc>>8) );
351 
352  // TRANSMIT LOOP
353  int naks=0;
354  int enq=0;
355  int flag;
356  unsigned char rxc;
357  int ret;
358  writeBuffer( fullmsg );
359  while(1) {
360  flag = getSymbol(&rxc);
361  if (( flag==FLAG_CONTROL )&&( rxc == ACK )) {
362  DBGPRINTF(" -> ACK RECEIVED");
363  ret = retSUCCESS;
364  break;
365  } else if (( flag==FLAG_CONTROL )&&( rxc == NAC )) {
366  naks++;
367  DBGPRINTF(" -> NAK RECEIVED:%d",naks);
368  if (naks>=3) {
369  ret = retERROR_NAC;
370  break;
371  }
372  writeBuffer( fullmsg );
373  } else if ( flag == FLAG_TIMEOUT ) {
374  enq++;
375  DBGPRINTF(" -> TIMEOUT ENQ:%d",enq);
376  if (enq>=3) {
377  ret = retNORESPONSE;
378  break;
379  }
380  sendENQ();
381  }
382  }
383  return ret;
384 }
int nRequests
Definition: rldf1.h:195
int sendENQ()
Definition: rldf1.cpp:211
unsigned int writeDLE(unsigned char c)
Definition: rldf1.cpp:87
int writeBuffer(unsigned char *buffer, int len)
Definition: rldf1.cpp:165
unsigned short tns
Definition: rldf1.h:193
unsigned char * data()
Definition: rldf1.cpp:59
unsigned char source
Definition: rldf1.h:197
unsigned int write(unsigned char c)
Definition: rldf1.cpp:78
int getSymbol(unsigned char *c)
Definition: rldf1.cpp:184
#define DBGPRINTF(x...)
Definition: rldf1.cpp:41
static unsigned short computeCRC(const unsigned char *buffer, int len)
Definition: rldf1.cpp:133
unsigned int length()
Definition: rldf1.cpp:58

◆ sendENQ()

int rlDF1::sendENQ ( )
private

Definition at line 211 of file rldf1.cpp.

212 {
213  static unsigned char buf[2];
214  DBGPRINTF("\nsendENQ()");
215  buf[0] = DLE;
216  buf[1] = ENQ;
217  return writeBuffer( buf, 2 );
218 }
int writeBuffer(unsigned char *buffer, int len)
Definition: rldf1.cpp:165
#define DBGPRINTF(x...)
Definition: rldf1.cpp:41

◆ sendNAC()

int rlDF1::sendNAC ( )
private

Definition at line 229 of file rldf1.cpp.

230 {
231  static unsigned char buf[2];
232  DBGPRINTF("\nsendNAC()");
233  buf[0] = DLE;
234  buf[1] = NAC;
235  return writeBuffer( buf, 2 );
236 }
int writeBuffer(unsigned char *buffer, int len)
Definition: rldf1.cpp:165
#define DBGPRINTF(x...)
Definition: rldf1.cpp:41

◆ writeBuffer() [1/2]

int rlDF1::writeBuffer ( unsigned char *  buffer,
int  len 
)
private

Definition at line 165 of file rldf1.cpp.

166 {
167  int ret=-1;
168  if ( tty!=NULL) {
169  ret = tty->writeBlock( buffer, len );
170  }
171  return ret;
172 }
rlSerial * tty
Definition: rldf1.h:191
int writeBlock(const unsigned char *buf, int len)
Definition: rlserial.cpp:584

◆ writeBuffer() [2/2]

int rlDF1::writeBuffer ( df1Buffer buffer)
private

Definition at line 174 of file rldf1.cpp.

175 {
176  int ret=-1;
177  if ( tty!=NULL) {
178  ret = tty->writeBlock( buffer.data(), buffer.length() );
179  }
180  return ret;
181 }
unsigned char * data()
Definition: rldf1.cpp:59
rlSerial * tty
Definition: rldf1.h:191
int writeBlock(const unsigned char *buf, int len)
Definition: rlserial.cpp:584
unsigned int length()
Definition: rldf1.cpp:58

Member Data Documentation

◆ active

bool rlDF1::active
private

Definition at line 192 of file rldf1.h.

◆ nRequests

int rlDF1::nRequests
private

Definition at line 195 of file rldf1.h.

◆ nResponses

int rlDF1::nResponses
private

Definition at line 196 of file rldf1.h.

◆ source

unsigned char rlDF1::source
private

Definition at line 197 of file rldf1.h.

◆ timeout

int rlDF1::timeout
private

Definition at line 198 of file rldf1.h.

◆ tns

unsigned short rlDF1::tns
private

Definition at line 193 of file rldf1.h.

◆ tty

rlSerial* rlDF1::tty
private

Definition at line 191 of file rldf1.h.


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