Skip to content
  • MySensors
  • 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. Development
  3. receiving numbers bigger than unsigned long

receiving numbers bigger than unsigned long

Scheduled Pinned Locked Moved Development
6 Posts 3 Posters 1.2k Views 4 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.
  • AndurilA Offline
    AndurilA Offline
    Anduril
    wrote on last edited by
    #1

    Hey there,

    I know an arduino is capable of using uint16_t type variables. But how do I get them transfered within the mysensors framework? I know there are way to read int (message.getint) and long (message.getlong) for usage in void receive(), but how do I receive an uint64_t number? I couldn't find a documentation about this. But as far as I read the max payload is 25 byte, so it should fit in.

    Regards,
    Anduril

    1 Reply Last reply
    0
    • hekH Offline
      hekH Offline
      hek
      Admin
      wrote on last edited by
      #2

      You can send custom data structures using:
      https://github.com/mysensors/MySensors/blob/development/core/MyMessage.cpp#L230

      ... and pick them up using:
      https://github.com/mysensors/MySensors/blob/development/core/MyMessage.cpp#L64

      1 Reply Last reply
      0
      • AndurilA Offline
        AndurilA Offline
        Anduril
        wrote on last edited by
        #3

        Thanks a lot @hek
        What do I have to write for length at MyMessage& MyMessage::set(void* value, uint8_t length)? Is it 8 byte or 64 bit? Is MAX_PAYLOAD defined in byte or bit (or something else)?

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

          64bit / 8 = 8 bytes length

          1 Reply Last reply
          0
          • AndurilA Offline
            AndurilA Offline
            Anduril
            wrote on last edited by
            #5

            well yeah thats obvious, my question was more about the specific syntax (but that was not very clear).
            Which of the following do I have to use?

            uint64_t value;
            send(Mymessage.set(value,8);
            send(Mymessage.set(value,64);
            send(Mymessage.set(value,8 byte);
            ...
            
            YveauxY 1 Reply Last reply
            0
            • AndurilA Anduril

              well yeah thats obvious, my question was more about the specific syntax (but that was not very clear).
              Which of the following do I have to use?

              uint64_t value;
              send(Mymessage.set(value,8);
              send(Mymessage.set(value,64);
              send(Mymessage.set(value,8 byte);
              ...
              
              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #6

              @Anduril said in receiving numbers bigger than unsigned long:

              uint64_t value;
              send(Mymessage.set(&value, sizeof(value) );
              

              http://yveaux.blogspot.nl

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


              20

              Online

              11.7k

              Users

              11.2k

              Topics

              113.1k

              Posts


              Copyright 2025 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
              • MySensors
              • OpenHardware.io
              • Categories
              • Recent
              • Tags
              • Popular