codes in progress
Dependents: RUCHE2-CODES_correctiondepoids RUCHE2-CODES_correction_de_poids
Diff: message_1.h
- Revision:
- 0:db9f881dd501
- Child:
- 2:330f063d8cfa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/message_1.h Fri Jan 18 14:15:55 2019 +0000 @@ -0,0 +1,54 @@ +#ifndef MESSAGE_1_H +#define MESSAGE_1_H + +#include "mbed.h" +#include "message.h" + +class Message_1 : public Message { + public: + //Methodes: + + //constructeur + Message_1(int messageType, int tempExt, int tempInt, int humidite, float masse):Message(messageType){ + this->m_tempExt = this->parseToUint16_t(tempExt); + this->m_tempInt = this->parseToUint16_t(tempInt); + this->m_humidite = this->parseToUint16_t(humidite); + this->m_masse = this->parseToUint16_t(masse); + }; + + void send(){ + char donnee[] = "AT$SF="; + this->sigfox.printf(donnee); + this->writeInSendBuffer(this->m_tempExt); + this->writeInSendBuffer(this->m_tempInt); + this->writeInSendBuffer(this->m_humidite); + this->writeInSendBuffer(this->m_masse); + this->sigfox.printf("\r"); + }; + + //Accesseurs + int getTempExt() const{ + return this->m_tempExt; + }; + + int getTempInt() const{ + return this->m_tempInt; + }; + + int getHumidite() const{ + return this->m_humidite; + }; + + float getMasse() const{ + return this->m_masse; + }; + + private: + int16_t m_tempExt; + int16_t m_tempInt; + int16_t m_humidite; + int16_t m_masse; +}; + + +#endif \ No newline at end of file