Senet Packet API

Dependents:   MTDOT-UDKDemo_Senet Senet NAMote mDot-IKS01A1 unh-hackathon-example ... more

Revision:
6:17e4e5f99d0c
Parent:
3:b6823438e893
--- a/senet_packet.h	Thu Aug 11 12:48:46 2016 +0000
+++ b/senet_packet.h	Tue Aug 23 16:01:03 2016 +0000
@@ -343,15 +343,16 @@
  */
 struct SensorPacket : public SenetPacket
 {
-    bool setPrimarySensor(uint16_t value) { return addSensorValue(0,1, value);};
+    bool setPrimarySensor(uint16_t value) { return addSensorValue(0,1, value);}
     bool setTemperature  (uint16_t value) { return addSensorValue(1,2, value);}
+    bool setPressure     (uint16_t value) { return addSensorValue(2,3, value);}
     void reset();
 
     SensorPacket(uint8_t *_buffer=NULL, uint8_t _buflen=0) :
         SenetPacket(SENSOR_PACKET, _buffer, _buflen) {}
 
-    protected:
-    static const uint8_t MAX_SENSOR_VALUES = 2;
+    public:
+    static const uint8_t MAX_SENSOR_VALUES = 3;
 
     struct SensorValue
     {
@@ -373,16 +374,10 @@
         }
     } sensorValue[MAX_SENSOR_VALUES];
 
-            bool    addSensorValue(uint8_t position, uint8_t type, uint16_t value);
+    bool    addSensorValue(uint8_t position, uint8_t type, uint16_t value);
 
-    /*
-     *--------------------------------------------------------------------------------------
-     *       Class:  SelfIdPacket 
-     *      Method:  serializePayload
-     * Description:  Serialize the data 
-     *--------------------------------------------------------------------------------------
-     */
     virtual int32_t serializePayload(uint8_t *frame, int32_t len);
+    virtual int32_t deserializePayload(uint8_t *frame, int32_t len);
 
 };