Shop OBEX P1 Docs P2 Docs Learn Events
PINK & Binary data transfer over UDP ? — Parallax Forums

PINK & Binary data transfer over UDP ?

etiquetetiquet Posts: 3
edited 2006-04-12 23:17 in General Discussion
Dear Readers,

I have the following chalenge for you.

For an application, I need to transfert/retreive binary data using the pink module.
I understand that "PINK " uses "zero" (0x00) as eof, which is conflicting with binary data transfert.

My question : what are the other options to interact with PINK for tranfering binary data over UDP with PINK ?

By the way, I thank a lot the Javelin yahoo forum, that help me a lot dealing with pink.

Guys how did you get the knowledge ? The documentation is so thin...

Thanks for the help !

Eric

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 22:14
    One way is to use an escape sequence,
    for example, use '\','\' to send a '\' and
    use '\','0' to send a binary 0.

    The javelin when it reads a variable, it scans for '\'
    if it is followed by '\' then the char is '\'
    if it is followed by '0' then the char is binary null.
    I believe all other ascii codes are accepted
    so this the quickest method and it has a nice
    java appeal (like '\n', '\r', also have a \'0')

    regards peter
    ·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-04-12 23:17
    I have uploaded class Pink.java version 1.4
    http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/web/

    I added methods writeBinVar() and readBinVar() that implement the escape sequence
    mentioned in my previous post.

    regards peter
Sign In or Register to comment.