Q about requesting values from another node


  • Hero Member

    There's a part of the vers 1.4 protocol that I do not understand.

    I recall some discussion to the effect that a node wanting to display, say, temperature could just ask another node measuring temperature for its values. And in the API docs I find:

    Requests a variable value from gateway or some other sensor in the radio network. Make sure to add callback-method in begin-method to handle request responses. If you send this request to some other sensor-node you must handle the reply message yourself in the destination node.
    
       void request(uint8_t childSensorId, uint8_t variableType, uint8_t destination);
           childSensorId - The unique child id for the different sensors connected to this Arduino. 0-254.
           variableType - The variableType to fetch.
           destination - The nodeId of other node to request data from in radio network. Default is gateway.
    

    I can see how this call within the display node could get routed to the temperature measuring node ("destination" of the request), given the parameters passed. And the latter could respond as usual to a request.

    What I don't see is how temperature node's response is routed back to the requesting node. Does the temperarture measruring node have to be written to look at the Sender field in the request, and make a send to that? Is there an example sketch?


  • Admin

    @Zeph said:

    Does the temperarture measruring node have to be written to look at the Sender field in the request, and make a send to that?

    Yes.


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts