Senet Packet API

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

Revision:
5:1a67bed5b486
Parent:
3:b6823438e893
--- a/senet_packet.h	Mon May 23 14:15:27 2016 -0400
+++ b/senet_packet.h	Thu Aug 11 15:45:06 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;
+    enum { MAX_SENSOR_VALUES = 3 };
 
     struct SensorValue
     {
@@ -373,15 +374,8 @@
         }
     } 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);
 
 };