File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -195,14 +195,15 @@ inline void ArduinoCloudProperty<char*>::appendValue(CborObject &cbor) {
195
195
cbor.set (" s" , property);
196
196
};
197
197
198
- #ifndef addProperty
199
- #define addProperty (prop ) addPropertyReal(prop, #prop)
200
- #endif
198
+ #define NAME_OF ( v ) #v
201
199
202
200
class ArduinoCloudThing {
203
201
public:
204
202
ArduinoCloudThing ();
205
203
void begin ();
204
+ template <typename T> ArduinoCloudPropertyGeneric& addProperty (T property) {
205
+ return addPropertyReal (property, NAME_OF (property));
206
+ };
206
207
ArduinoCloudPropertyGeneric& addPropertyReal (int & property, String name);
207
208
ArduinoCloudPropertyGeneric& addPropertyReal (bool & property, String name);
208
209
ArduinoCloudPropertyGeneric& addPropertyReal (float & property, String name);
You can’t perform that action at this time.
0 commit comments