Hi,

I intend to use C for this, unless there is an easier way to do it. For my 
application, UDP will work just fine as I'm not too concerned about packet 
loss. And yes, I understand that HEX is a representation of binary data. I 
simply wanted to know if this could be done from the BBB and if so, see if 
there is a similar solution out there for new users. Thanks

On Tuesday, March 17, 2020 at 7:44:17 PM UTC-4, Dennis Bieber wrote:
>
> On Tue, 17 Mar 2020 15:16:57 -0700 (PDT), in 
> gmane.comp.hardware.beagleboard.user Alex Rodriguez 
>
> >Hey guys, 
> > 
> >I would like to have my BeagleBone Black output certain hex values over 
> >Ethernet (either UDP or TCP) to another offline system. Is there a simple 
> >way to go about doing this? If so, are there any specific examples of 
> this? 
> >Thanks! 
>
>         First: Define what you mean by "hex values"... 
>         Second: Study any textbook on network I/O (covering TCP/UDP) over 
> sockets. Related: What language do you intend to use? 
>
>         Hexadecimal is a /display/ (text) encoding for binary data. If you 
> really mean "hex", then you just need to convert the binary data to a 
> string, and send the string. 
>
> >>> hxstr = "%8.8X" % 123987456 
> >>> hxstr 
> '0763E600' 
> >>> print(hxstr) 
> 0763E600 
> >>> 
>
> {gets uglier for floating point -- one needs to use struct module to pack 
> the float into a bytestring, then unpack the bytestring as an integer} 
>
>         If you mean arbitrary binary values, you need to pack them into a 
> byte 
> array and send the byte array -- though this does introduce the next 
> factor... 
>
> ...        TCP is a stream protocol -- it ensures that you will receive 
> the sent 
> data, but does not guarantee that you will receive the same number of 
> packets as sent. It can split packets into multiple receive calls, or join 
> multiple send packets into a single packet. It is up to YOU to define the 
> high-level protocol that allows you to know if you have received all of a 
> transmission (for example -- you send a count of how many bytes are to 
> follow... Many of the text protocols use a line that contains just a "."). 
>
> ...        UDP, on the other hand, does not split/combine packets -- what 
> you 
> receive IS what was sent. However, it does not guarantee delivery! Any 
> individual packet can be lost/undelivered. It is up to YOU to define a 
> protocol that lets you detect lost packets (unless your application can 
> live with missed packets). 
>
>
> -- 
> Dennis L Bieber 
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/09967d83-0d4d-4960-94fb-87db33cde74d%40googlegroups.com.

Reply via email to