rxresponseiosamplebase.h
1 /*
2  * Copyright (C) 2015 ThomArmax (Thomas COIN)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Thomas COIN <esvcorp@gmail.com> 18/04/2015
19  */
20 
21 #ifndef RxRESPONSEIOSAMPLEBASE_H
22 #define RxRESPONSEIOSAMPLEBASE_H
23 
24 #include "RxBaseResponse"
25 
26 #include <QObject>
27 
28 namespace QtXBee {
29 namespace Wpan {
30 
36 {
37  Q_OBJECT
38 public:
39  enum Pin {
40  ADC5 = 16384,
41  ADC4 = 8192,
42  ADC3 = 4096,
43  ADC2 = 2048,
44  ADC1 = 1024,
45  ADC0 = 512,
46  DIO8 = 256,
47  DIO7 = 128,
48  DIO6 = 64,
49  DIO5 = 32,
50  DIO4 = 16,
51  DIO3 = 8,
52  DIO2 = 4,
53  DIO1 = 2,
54  DIO0 = 1
55  };
56  Q_DECLARE_FLAGS(ChannelMask, Pin)
57 
58  explicit RxResponseIoSampleBase (QObject *parent = 0);
59  virtual ~RxResponseIoSampleBase ();
60 
61  // Reimplemented from RxBaseResponse
62  virtual void clear ();
63  virtual QString toString ();
64 
65  void setChannelMask (ChannelMask mask);
66  ChannelMask channelMask () const;
67 
68  void setSampleCount (const quint8 count);
69  quint8 sampleCount () const;
70 
71 protected:
72  virtual bool parseApiSpecificData (const QByteArray &data);
73 
74 protected:
75  quint8 m_samplesCount;
76  ChannelMask m_channelMask;
77 };
78 
79 }} // END namespace
80 
81 #endif // RxRESPONSEIOSAMPLEBASE_H