Send data to other sensor
Development
8
Posts
4
Posters
2.9k
Views
1
Watching
-
The gateway is the only place where you can send out data via serial window. The Sensor-class does not listen to serial input.
But it is a two-liner to send a value (1.4 example below).
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg); -
The gateway is the only place where you can send out data via serial window. The Sensor-class does not listen to serial input.
But it is a two-liner to send a value (1.4 example below).
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg);@hek said:
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg);This will not compile, as the new()-operator returns a pointer to a MyMessage object.
Better to compress the whole to:gw.send( MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>) ); -
@hek said:
MyMessage msg = new MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>); gw.send(msg);This will not compile, as the new()-operator returns a pointer to a MyMessage object.
Better to compress the whole to:gw.send( MyMessage(<chidldSensorId>,<dataType>).setDestination(<destinationNode>).set(<value>) );