codes in progress
Dependents: RUCHE2-CODES_correctiondepoids RUCHE2-CODES_correction_de_poids
message_1.h@2:330f063d8cfa, 2019-01-23 (annotated)
- Committer:
- Sidibe
- Date:
- Wed Jan 23 14:27:12 2019 +0000
- Revision:
- 2:330f063d8cfa
- Parent:
- 0:db9f881dd501
- Child:
- 3:7542ed5cd721
new step in our project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sidibe | 0:db9f881dd501 | 1 | #ifndef MESSAGE_1_H |
Sidibe | 0:db9f881dd501 | 2 | #define MESSAGE_1_H |
Sidibe | 0:db9f881dd501 | 3 | |
Sidibe | 0:db9f881dd501 | 4 | #include "mbed.h" |
Sidibe | 0:db9f881dd501 | 5 | #include "message.h" |
Sidibe | 0:db9f881dd501 | 6 | |
Sidibe | 0:db9f881dd501 | 7 | class Message_1 : public Message { |
Sidibe | 0:db9f881dd501 | 8 | public: |
Sidibe | 0:db9f881dd501 | 9 | //Methodes: |
Sidibe | 0:db9f881dd501 | 10 | |
Sidibe | 0:db9f881dd501 | 11 | //constructeur |
Sidibe | 2:330f063d8cfa | 12 | Message_1(int messageType, float tempExt, float tempInt, int humidite, float masse):Message(messageType){ |
Sidibe | 2:330f063d8cfa | 13 | this->m_tempExt = this->parseToInt16_t(tempExt); |
Sidibe | 2:330f063d8cfa | 14 | this->m_tempInt = this->parseToInt16_t(tempInt); |
Sidibe | 2:330f063d8cfa | 15 | this->m_humidite = this->parseToInt16_t(humidite); |
Sidibe | 2:330f063d8cfa | 16 | this->m_masse = this->parseToInt16_t(masse); |
Sidibe | 0:db9f881dd501 | 17 | }; |
Sidibe | 0:db9f881dd501 | 18 | |
Sidibe | 0:db9f881dd501 | 19 | void send(){ |
Sidibe | 0:db9f881dd501 | 20 | char donnee[] = "AT$SF="; |
Sidibe | 0:db9f881dd501 | 21 | this->sigfox.printf(donnee); |
Sidibe | 0:db9f881dd501 | 22 | this->writeInSendBuffer(this->m_tempExt); |
Sidibe | 0:db9f881dd501 | 23 | this->writeInSendBuffer(this->m_tempInt); |
Sidibe | 0:db9f881dd501 | 24 | this->writeInSendBuffer(this->m_humidite); |
Sidibe | 0:db9f881dd501 | 25 | this->writeInSendBuffer(this->m_masse); |
Sidibe | 0:db9f881dd501 | 26 | this->sigfox.printf("\r"); |
Sidibe | 0:db9f881dd501 | 27 | }; |
Sidibe | 0:db9f881dd501 | 28 | |
Sidibe | 0:db9f881dd501 | 29 | //Accesseurs |
Sidibe | 0:db9f881dd501 | 30 | int getTempExt() const{ |
Sidibe | 0:db9f881dd501 | 31 | return this->m_tempExt; |
Sidibe | 0:db9f881dd501 | 32 | }; |
Sidibe | 0:db9f881dd501 | 33 | |
Sidibe | 0:db9f881dd501 | 34 | int getTempInt() const{ |
Sidibe | 0:db9f881dd501 | 35 | return this->m_tempInt; |
Sidibe | 0:db9f881dd501 | 36 | }; |
Sidibe | 0:db9f881dd501 | 37 | |
Sidibe | 0:db9f881dd501 | 38 | int getHumidite() const{ |
Sidibe | 0:db9f881dd501 | 39 | return this->m_humidite; |
Sidibe | 0:db9f881dd501 | 40 | }; |
Sidibe | 0:db9f881dd501 | 41 | |
Sidibe | 0:db9f881dd501 | 42 | float getMasse() const{ |
Sidibe | 0:db9f881dd501 | 43 | return this->m_masse; |
Sidibe | 0:db9f881dd501 | 44 | }; |
Sidibe | 0:db9f881dd501 | 45 | |
Sidibe | 0:db9f881dd501 | 46 | private: |
Sidibe | 0:db9f881dd501 | 47 | int16_t m_tempExt; |
Sidibe | 0:db9f881dd501 | 48 | int16_t m_tempInt; |
Sidibe | 0:db9f881dd501 | 49 | int16_t m_humidite; |
Sidibe | 0:db9f881dd501 | 50 | int16_t m_masse; |
Sidibe | 0:db9f881dd501 | 51 | }; |
Sidibe | 0:db9f881dd501 | 52 | |
Sidibe | 0:db9f881dd501 | 53 | |
Sidibe | 0:db9f881dd501 | 54 | #endif |