Send data to other sensor
-
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>) );
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login