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