@@ -58,7 +58,13 @@ class PinHistory {
58
58
}
59
59
60
60
public:
61
- PinHistory () {}
61
+ unsigned int asciiEncodingOffsetIn;
62
+ unsigned int asciiEncodingOffsetOut;
63
+
64
+ PinHistory () {
65
+ asciiEncodingOffsetIn = 0 ; // default is sensible
66
+ asciiEncodingOffsetOut = 1 ; // default is sensible
67
+ }
62
68
63
69
void reset (T val) {
64
70
clear ();
@@ -108,11 +114,19 @@ class PinHistory {
108
114
109
115
// convert the queue of incoming data to a string as if it was Serial comms
110
116
// start from offset, consider endianness
111
- String incomingToAscii (unsigned int offset, bool bigEndian) const { return q2a (qIn, offset, bigEndian); }
117
+ String incomingToAscii (unsigned int offset, bool bigEndian) const { return q2a (qIn, offset, bigEndian); }
118
+
119
+ // convert the queue of incoming data to a string as if it was Serial comms
120
+ // start from offset, consider endianness
121
+ String incomingToAscii (bool bigEndian) const { return incomingToAscii (asciiEncodingOffsetIn, bigEndian); }
122
+
123
+ // convert the pin history to a string as if it was Serial comms
124
+ // start from offset, consider endianness
125
+ String toAscii (unsigned int offset, bool bigEndian) const { return q2a (qOut, offset, bigEndian); }
112
126
113
127
// convert the pin history to a string as if it was Serial comms
114
128
// start from offset, consider endianness
115
- String toAscii ( unsigned int offset, bool bigEndian) const { return q2a (qOut, offset , bigEndian); }
129
+ String toAscii ( bool bigEndian) const { return toAscii (asciiEncodingOffsetOut , bigEndian); }
116
130
117
131
// copy elements to an array, up to a given length
118
132
// return the number of elements moved
0 commit comments