My Project
mrmDataBufTx.h
1 /*************************************************************************\
2 * Copyright (c) 2014 Brookhaven Science Associates, as Operator of
3 * Brookhaven National Laboratory.
4 * Copyright (c) 2015 Paul Scherrer Institute (PSI), Villigen, Switzerland
5 * mrfioc2 is distributed subject to a Software License Agreement found
6 * in file LICENSE that is included with this distribution.
7 \*************************************************************************/
8 #ifndef MRMDATABUFTX_H_INC
9 #define MRMDATABUFTX_H_INC
10 
11 #include <epicsMutex.h>
12 
13 #include "mrf/databuf.h"
14 
19 class epicsShareClass mrmDataBufTx : public dataBufTx
20 {
21 public:
22 
23  mrmDataBufTx(const std::string& n,
24  volatile epicsUInt8* bufcontrol,
25  volatile epicsUInt8* buffer);
26  virtual ~mrmDataBufTx();
27 
28  /* locking done internally */
29  virtual void lock() const OVERRIDE FINAL {};
30  virtual void unlock() const OVERRIDE FINAL {};
31 
32  virtual bool dataTxEnabled() const OVERRIDE FINAL;
33  virtual void dataTxEnable(bool) OVERRIDE FINAL;
34 
35  virtual bool dataRTS() const OVERRIDE FINAL;
36 
37  virtual epicsUInt32 lenMax() const OVERRIDE FINAL;
38 
39  virtual void dataSend(epicsUInt32 len, const epicsUInt8 *buf) OVERRIDE FINAL;
40 
41 private:
42  volatile epicsUInt8 * const dataCtrl;
43  volatile epicsUInt8 * const dataBuf;
44 
45  epicsMutex dataGuard;
46 };
47 
48 #endif // MRMDATABUFTX_H_INC
Definition: mrmDataBufTx.h:20