Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Is it possible to extract child ID from a just sent message?
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Is it possible to extract child ID from a just sent message?

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 51 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nigel31
    wrote on last edited by
    #1

    Hi,
    In my ongoing effort to ensure end to end data transmission of some more critical data, is it possible to extract / retrieve the constituent elements of a message, just sent. in the manner of an incoming message in the receive() function?
    i.e. can I in a separate function, handling the "logging" of outgoing messages (to be compared to incoming echos) do something like

    send(msgSPFlag.set(SPupdateFlag), true);
    ChildIDtoCheck = message.sensor;
    

    My aim would be to put the sent childID's into a buffer and then loop through the childID's (in the buffer) in the receive function, and then remove them from the buffer on successful receipt of an echo, if this works, I could possibly expand this to check the actual message payload against what was sent, but that is probably unnecessary.

    If that isn't possible, than I'll just have to pass the child to my function as well, but it would be nicer if I can "extract" it.

    Many thanks Nigel

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nigel31
      wrote on last edited by
      #2

      I Guess given the lack of response, that the answer is no.

      I am passing the child ID to my function as a separate int.

      Nca78N 1 Reply Last reply
      0
      • N Nigel31

        I Guess given the lack of response, that the answer is no.

        I am passing the child ID to my function as a separate int.

        Nca78N Offline
        Nca78N Offline
        Nca78
        Hardware Contributor
        wrote on last edited by
        #3

        @Nigel31 Hello, if you have a message variable (msgSPFlag I guess ?) then you have the child ID in it in the destination property of the message.

        1 Reply Last reply
        0
        • ZenBlizzardZ Offline
          ZenBlizzardZ Offline
          ZenBlizzard
          wrote on last edited by
          #4

          It seems you can access the child ID from the sent message by looking at the destination property. If you have the message object, you can extract the ID directly from there.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          7

          Online

          11.7k

          Users

          11.2k

          Topics

          113.0k

          Posts


          Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular