mrfioc2  2.3.0
databuf.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2010 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 #ifdef DATABUF_H_INC_LEVEL2
9  #ifdef epicsExportSharedSymbols
10  #define DATABUFL2_epicsExportSharedSymbols
11  #undef epicsExportSharedSymbols
12  #include "shareLib.h"
13  #endif
14 #endif
15 
16 
17 #ifndef DATABUF_H_INC
18 #define DATABUF_H_INC
19 
20 #include <epicsTypes.h>
21 #include <epicsTime.h>
22 
23 #include "mrf/object.h"
24 
31 typedef void (*dataBufComplete)(void *arg, epicsStatus ok,
32  epicsUInt32 len, const epicsUInt8* buf);
33 
34 
35 class epicsShareClass dataBufTx : public mrf::ObjectInst<dataBufTx> {
36  struct impl;
37  impl *pimpl;
38 public:
39  explicit dataBufTx(const std::string& n) : mrf::ObjectInst<dataBufTx>(n) {}
40  virtual ~dataBufTx()=0;
41 
43  virtual bool dataTxEnabled() const=0;
44  virtual void dataTxEnable(bool)=0;
45 
47  virtual bool dataRTS() const=0;
48 
49  virtual epicsUInt32 lenMax() const=0;
50 
56  virtual void dataSend(epicsUInt32 len, const epicsUInt8 *buf)=0;
57 
58 };
59 
60 
61 
62 class epicsShareClass dataBufRx : public mrf::ObjectInst<dataBufRx> {
63 public:
64  explicit dataBufRx(const std::string& n) : mrf::ObjectInst<dataBufRx>(n) {}
65 
66  virtual ~dataBufRx()=0;
67 
68  virtual bool dataRxEnabled() const=0;
69  virtual void dataRxEnable(bool)=0;
70 
79  virtual void dataRxError(dataBufComplete, void*)=0;
80 
86  virtual void dataRxAddReceive(dataBufComplete fptr, void* arg=0)=0;
87 
90  virtual void dataRxDeleteReceive(dataBufComplete fptr, void* arg=0)=0;
91 };
92 
93 #endif // DATABUF_H_INC
94 
95 #ifdef DATABUFL2_epicsExportSharedSymbols
96  #undef DATABUF_H_INC_LEVEL2
97  #define epicsExportSharedSymbols
98  #include "shareLib.h"
99 #endif
dataBufTx(const std::string &n)
Definition: databuf.h:39
User implementation hook.
Definition: object.h:459
Definition: flash.cpp:23
dataBufRx(const std::string &n)
Definition: databuf.h:64
void(* dataBufComplete)(void *arg, epicsStatus ok, epicsUInt32 len, const epicsUInt8 *buf)
Definition: databuf.h:31