![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
sra-romi
Dependencies: BufferedSerial Matrix
MessageBuilder.h@1:dc87724abce8, 2019-04-11 (annotated)
- Committer:
- fabiofaria
- Date:
- Thu Apr 11 09:51:28 2019 +0000
- Revision:
- 1:dc87724abce8
Initial commit.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
fabiofaria | 1:dc87724abce8 | 1 | #ifndef MESSAGEBUILDER_H_ |
fabiofaria | 1:dc87724abce8 | 2 | #define MESSAGEBUILDER_H_ |
fabiofaria | 1:dc87724abce8 | 3 | |
fabiofaria | 1:dc87724abce8 | 4 | #include "mbed.h" |
fabiofaria | 1:dc87724abce8 | 5 | |
fabiofaria | 1:dc87724abce8 | 6 | class MessageBuilder |
fabiofaria | 1:dc87724abce8 | 7 | { |
fabiofaria | 1:dc87724abce8 | 8 | private: |
fabiofaria | 1:dc87724abce8 | 9 | static const char max_len = 32; |
fabiofaria | 1:dc87724abce8 | 10 | char *_pointer; |
fabiofaria | 1:dc87724abce8 | 11 | |
fabiofaria | 1:dc87724abce8 | 12 | public: |
fabiofaria | 1:dc87724abce8 | 13 | char message[max_len]; |
fabiofaria | 1:dc87724abce8 | 14 | |
fabiofaria | 1:dc87724abce8 | 15 | MessageBuilder(); |
fabiofaria | 1:dc87724abce8 | 16 | virtual ~MessageBuilder(); |
fabiofaria | 1:dc87724abce8 | 17 | char add(const void* data, size_t len); |
fabiofaria | 1:dc87724abce8 | 18 | char add(char data); |
fabiofaria | 1:dc87724abce8 | 19 | char add(float data); |
fabiofaria | 1:dc87724abce8 | 20 | char add(int data); |
fabiofaria | 1:dc87724abce8 | 21 | char add(unsigned int data); |
fabiofaria | 1:dc87724abce8 | 22 | void reset(); |
fabiofaria | 1:dc87724abce8 | 23 | unsigned char available(); |
fabiofaria | 1:dc87724abce8 | 24 | unsigned char length(); |
fabiofaria | 1:dc87724abce8 | 25 | }; |
fabiofaria | 1:dc87724abce8 | 26 | |
fabiofaria | 1:dc87724abce8 | 27 | #endif /* MESSAGEBUILDER_H_ */ |
fabiofaria | 1:dc87724abce8 | 28 | |
fabiofaria | 1:dc87724abce8 | 29 |