feito

Dependencies:   BufferedSerial

Committer:
josefg25
Date:
Thu May 20 16:18:59 2021 +0000
Revision:
9:d0ef39e209b7
Parent:
0:c25c4b67b6a1
SRA_update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yaaqobhpt 0:c25c4b67b6a1 1 #ifndef MESSAGEBUILDER_H_
yaaqobhpt 0:c25c4b67b6a1 2 #define MESSAGEBUILDER_H_
yaaqobhpt 0:c25c4b67b6a1 3
yaaqobhpt 0:c25c4b67b6a1 4 #include "mbed.h"
yaaqobhpt 0:c25c4b67b6a1 5
yaaqobhpt 0:c25c4b67b6a1 6 class MessageBuilder
yaaqobhpt 0:c25c4b67b6a1 7 {
yaaqobhpt 0:c25c4b67b6a1 8 private:
yaaqobhpt 0:c25c4b67b6a1 9 static const char max_len = 32;
yaaqobhpt 0:c25c4b67b6a1 10 char *_pointer;
yaaqobhpt 0:c25c4b67b6a1 11
yaaqobhpt 0:c25c4b67b6a1 12 public:
yaaqobhpt 0:c25c4b67b6a1 13 char message[max_len];
yaaqobhpt 0:c25c4b67b6a1 14
yaaqobhpt 0:c25c4b67b6a1 15 MessageBuilder();
yaaqobhpt 0:c25c4b67b6a1 16 virtual ~MessageBuilder();
yaaqobhpt 0:c25c4b67b6a1 17 char add(const void* data, size_t len);
yaaqobhpt 0:c25c4b67b6a1 18 char add(char data);
yaaqobhpt 0:c25c4b67b6a1 19 char add(float data);
yaaqobhpt 0:c25c4b67b6a1 20 char add(int data);
yaaqobhpt 0:c25c4b67b6a1 21 char add(unsigned int data);
yaaqobhpt 0:c25c4b67b6a1 22 void reset();
yaaqobhpt 0:c25c4b67b6a1 23 unsigned char available();
yaaqobhpt 0:c25c4b67b6a1 24 unsigned char length();
yaaqobhpt 0:c25c4b67b6a1 25 };
yaaqobhpt 0:c25c4b67b6a1 26
yaaqobhpt 0:c25c4b67b6a1 27 #endif /* MESSAGEBUILDER_H_ */
yaaqobhpt 0:c25c4b67b6a1 28
yaaqobhpt 0:c25c4b67b6a1 29
yaaqobhpt 0:c25c4b67b6a1 30