Child_ID



  • If I'm waiting for a message in my sensor, I can get the message, I can checks it type, but how do I check for the incoming Child_ID from the gateway... ( or any other field in the message header)

    Thanks
    ver 2.0b

    
    void incomingMessage(const MyMessage &message) 
    {
      if (message.type==V_VAR1) 
      {
        unsigned long gwPulseCount=message.getULong();
      }
    }
    
    

  • Contest Winner

    @lafleur You can use the 'sensor' member

    void incomingMessage(const MyMessage &message) 
    {
      if (message.sensor == Child_ID && message.type==V_VAR1) 
      {
        unsigned long gwPulseCount=message.getULong();
      }
    }
    

Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.