Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of kpn_senml by
senml_float_actuator.h
00001 /* _ __ ____ _ _ 00002 * | |/ / | _ \ | \ | | 00003 * | ' / | |_) | | \| | 00004 * | . \ | __/ | |\ | 00005 * |_|\_\ |_| |_| \_| 00006 * 00007 * (c) 2018 KPN 00008 * License: MIT License. 00009 * Author: Jan Bogaerts 00010 * 00011 * support for float actuators headers 00012 */ 00013 00014 #ifndef SENMLFLOATACTUATOR 00015 #define SENMLFLOATACTUATOR 00016 00017 #include <senml_float_record.h> 00018 00019 #define FLOAT_ACTUATOR_SIGNATURE void (*callback)(float) 00020 00021 /** 00022 * A SenMLRecord that stores float data and supports actuation. 00023 */ 00024 class SenMLFloatActuator: public SenMLFloatRecord 00025 { 00026 public: 00027 SenMLFloatActuator(const char* name, FLOAT_ACTUATOR_SIGNATURE): SenMLFloatRecord(name, SENML_UNIT_NONE, 0.0), callback(callback) {}; 00028 SenMLFloatActuator(const char* name, SenMLUnit unit, FLOAT_ACTUATOR_SIGNATURE): SenMLFloatRecord(name, unit, 0.0), callback(callback) {}; 00029 SenMLFloatActuator(const char* name, SenMLUnit unit, float value, FLOAT_ACTUATOR_SIGNATURE): SenMLFloatRecord(name, unit, value), callback(callback) {}; 00030 ~SenMLFloatActuator(){}; 00031 00032 protected: 00033 00034 //called while parsing a senml message, when the parser found the value for an SenMLJsonListener 00035 virtual void actuate(const void* value, int dataLength, SenMLDataType dataType); 00036 00037 private: 00038 FLOAT_ACTUATOR_SIGNATURE; 00039 }; 00040 00041 #endif // SENMLFLOATACTUATOR 00042 00043 00044 00045 00046 00047 00048
Generated on Tue Jul 12 2022 23:07:21 by
