Datagrams versus Values

So I’ve been using getValueReceivedOnFace(f), setValueSentOnAllFaces(63), and
setValueSentOnFace(63, 0) for both my values and datagrams. I noticed on the API Cheat Sheet there are some functions under “datagrams” similar to the ones above I mentioned that are listed under “communication”. I didn’t find anything other than an issue someone had with timing when I searched for the datagram functions.

Is there any advantage to using them over their “communication” (aka “value”) counterparts?
Maybe being able to send more than a 6 bit datagram ??? :slight_smile:
Is there any documentation on these API Cheat Sheet “Datagrams” functions? Or maybe a tutorial I maybe overlooked?

Thanks for any help or insight you can provide.

PS: I’ve had a blast coding my Blinks over the past 5 weeks :rocket:

Blinks - API Cheat Sheet

Sorry, I am confused. What do you mean by values and datagrams in this context? You can only send a single value with the face value API. Yes, technically that IS a datagram, but I am not sure that is what you mean.

Best documentation is usually the blinklib.h header file. The coments about those functions are pretty extensive.

That’s about it. You can send up to 16 bytes (128 bits if you prefer) with it in one go at the cost of:

  • It being slower (due to bigger sizes)
  • It being more complex to handle as there is no automatic retransmission like with face values.

See the header file I mentioned above.

Now, the biggest problem with datagrams is that they are not guaranteed to be delivered. You might send the datagram to a neighbor Blink and it might never be received there, so you need a way to handle this.

My Custom Blinklib allows one to use all the 8 bits for face values AND has guaranteed delivery for datagrams (making them considerably easier to use).

Thanks for the quick reply.

That’s about it. You can send up to 16 bytes (128 bits if you prefer) with it in one go at the cost of:

  • It being slower (due to bigger sizes)
  • It being more complex to handle as there is no automatic retransmission like with face values.

was exactly the type of answer I was looking for.

I was going to check the header file if nobody replied. My daughter gave me strict instructions I was not to code last night because I loose track of time when coding and she didn’t want me being up to cause Santa to skip our house. So I just read some forum posts and went to bed. If I had my IDE up, I would have checked.

I’d be interested in trying out your library. Being able to use 8 bits instead of 6 would be handy. I managed to make needing 9 bits work in Red January (The game I’ve been coding for the past month) since I didn’t need all 9 bits at the same point in time.

1 Like