AsciiMassage
AsciiMassagePacker.h
1 /* * Copyright (C) 2017 Thomas O. Fredericks, Sofian Audry
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy of
4  * this software and associated documentation files (the "Software"), to deal in
5  * the Software without restriction, including without limitation the rights to
6  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7  * the Software, and to permit persons to whom the Software is furnished to do so,
8  * subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in all
11  * copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef AsciiMassagePacker_h
22 #define AsciiMassagePacker_h
23 
24 
25 #include "Massage/MassagePacker.h"
26 #include "Print.h"
27 
31 class AsciiMassagePacker : public MassagePacker, private Print
32 {
33 public:
41  virtual void beginPacket(const char* address);
42 
46  virtual void addByte(uint8_t value);
47 
51  virtual void addInt(int16_t value);
52 
56  virtual void addLong(int32_t value);
57 
61  virtual void addFloat(float value);
62 
66  virtual void addString(const char * value);
67 
71  virtual void endPacket();
72 
73 
74 
75  // REQUIRED BY PRINT, BUT SHOULD NEVER BE USED EXTERNALLY !!!
76 private:
77  virtual size_t write(uint8_t) ;
78 };
79 
80 
81 
82 
83 #endif
AsciiMassagePacker()
Definition: AsciiMassagePacker.cpp:29
virtual void addInt(int16_t value)
Definition: AsciiMassagePacker.cpp:48
virtual void addString(const char *value)
Definition: AsciiMassagePacker.cpp:65
virtual void addLong(int32_t value)
Definition: AsciiMassagePacker.cpp:53
virtual void endPacket()
Definition: AsciiMassagePacker.cpp:73
virtual void addFloat(float value)
Definition: AsciiMassagePacker.cpp:59
virtual void beginPacket(const char *address)
Definition: AsciiMassagePacker.cpp:35
Definition: AsciiMassagePacker.h:31
virtual void addByte(uint8_t value)
Definition: AsciiMassagePacker.cpp:43
Main MassagePacker abstract class.
Definition: MassagePacker.h:40