From 93787326a850b73de94f2a0ab9c70ddfae5c7bb5 Mon Sep 17 00:00:00 2001 From: Martin Peach Date: Tue, 4 May 2010 04:10:39 +0000 Subject: Updated with test inputs svn path=/trunk/externals/mrpeach/; revision=13490 --- slipenc/slipenc-help.pd | 139 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 106 insertions(+), 33 deletions(-) diff --git a/slipenc/slipenc-help.pd b/slipenc/slipenc-help.pd index d32ebfc..b2e4bf6 100644 --- a/slipenc/slipenc-help.pd +++ b/slipenc/slipenc-help.pd @@ -1,36 +1,109 @@ -#N canvas 631 295 583 358 10; -#X obj -98 158 slipenc; -#X obj -98 83 packOSC; -#X msg -98 58 /test 1 2 3 192 218 219 220 221 222; -#X obj -98 277 slipdec; -#X text -36 159 Encodes a list of bytes for transmission through a -serial link using SLIP (RFC1055). Useful for sending OSC through [comport]. -; -#X text 76 315 Author: Martin Peach \, 2010/05/04; -#X floatatom 35 142 5 0 0 0 - - -; -#X text -35 77 SLIP is a simple encoding that prefixes each packet -with 192 \, and replaces any occurence of 192 by the sequence 219 \, -220 Also any occurrence of 219 will be replaced by 219 \, 221 The packet -is ended with a final 192; -#X text -100 0 [slipenc]: Encode a list of bytes using Serial Line +#N canvas 167 357 1113 568 10; +#X obj -98 77 packOSC; +#X msg -98 52 /test 1 2 3 192 218 219 220 221 222; +#X text 193 533 Author: Martin Peach \, 2010/05/04; +#X floatatom -72 99 5 0 0 0 - - -; +#X text -100 -6 [slipenc]: Encode a list of bytes using Serial Line Internet Protocol (SLIP); -#X text -81 234 Note that SLIP limits the maximum packet size to 1006 +#X text -39 228 Note that SLIP limits the maximum packet size to 1006 ; -#X obj -71 210 print encoded; -#X obj -71 135 print original; -#X obj -98 317 print decoded; -#X obj -98 113 t a a; -#X obj -98 186 t a a; -#X text -47 279 Decodes a list of bytes that were encoded with SLIP. +#X obj -71 246 print encoded; +#X obj -71 163 print original; +#X obj 8 381 print decoded; +#X obj -98 141 t a a; +#X obj -98 224 t a a; +#X msg 124 60 /test/pi 3.14159; +#X msg 233 60 /test/pi \$1; +#X obj 233 40 expr 4*atan(1); +#X obj 233 22 bng 15 250 50 0 empty empty empty 17 7 0 10 -4034 -86277 +-1; +#X obj -98 448 unpackOSC; +#X obj -98 364 t a a; +#X obj -98 469 routeOSC /test; +#X obj -92 492 print test; +#X obj -17 492 print other; +#X obj -98 515 routeOSC /pi; +#X floatatom -98 537 12 0 0 0 - - -; +#X text -38 191 Encodes a list of bytes for transmission through a +serial link using SLIP (RFC 1055). Useful for sending OSC through [comport]. ; -#X text -100 28 [slipdec]: Decode a list of bytes using Serial Line -Internet Protocol (SLIP); -#X connect 0 0 14 0; -#X connect 1 0 13 0; -#X connect 2 0 1 0; -#X connect 3 0 12 0; -#X connect 6 0 0 0; -#X connect 13 0 0 0; -#X connect 13 1 11 0; -#X connect 14 0 3 0; -#X connect 14 1 10 0; +#X msg -52 124 192 192 192 192 192; +#X msg 821 312 192 192 192 192 192; +#X floatatom -35 313 5 0 0 0 - - -; +#X obj -104 322 cnv 15 60 30 empty empty empty 20 12 0 14 -4034 -66577 +0; +#X obj -98 329 slipdec; +#X obj -103 186 cnv 15 60 30 empty empty empty 20 12 0 14 -4034 -66577 +0; +#X obj -98 191 slipenc; +#X msg 27 174 1 2 3 4; +#X text 366 117 The motivation behind SLIP is the need to determine +the boundaries of a packet when it is received one byte at a time \, +as with a serial channel. Bytes are integers between 0 and 255; +#X text -100 22 [slipdec]: Decode a list of bytes using SLIP; +#X msg 79 124 1 2 3 4 5 6; +#X msg 160 124 1.1 2.22 3 4 5 6; +#X text -37 98 single floats will pass through as single packets; +#X msg 18 312 192 \, 1 \, 219 \, 220 \, 192; +#X msg 170 312 192 \, 1.33 \, 192; +#X msg -76 290 verbosity \$1; +#X obj -76 271 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X text 366 174 SLIP (RFC 1055) is a simple encoding that prefixes +each packet with 192 \, and replaces 192s inside the packet with 219 +followed by 220 Any 219 will be replaced with 219 and 221 The packet +ends with 192; +#X text 16 294 This should give 1 192; +#X text 168 294 Only bytes are permitted; +#X text 819 294 Null packets are invisible; +#X text 637 294 Unterminated list is invalid; +#X msg 640 312 1 219 5 6 7; +#X text 318 294 Missing 192 at start is OK \, bad escapes are invalid +; +#X msg 480 312 192 219 5 6 7 192; +#X msg 321 312 1 43 5 6 7 192; +#X text -42 329 Decodes a list of bytes from SLIP to raw. Useful for +receiving OSC via [comport].; +#X obj -71 383 list split 1; +#X obj -71 404 == 47; +#X obj -98 427 spigot; +#X text -35 403 select OSC messages based on the leading '/'; +#X obj -59 358 print valid; +#X connect 0 0 9 0; +#X connect 1 0 0 0; +#X connect 3 0 9 0; +#X connect 9 0 29 0; +#X connect 9 1 7 0; +#X connect 10 0 27 0; +#X connect 10 1 6 0; +#X connect 11 0 0 0; +#X connect 12 0 0 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 17 0; +#X connect 16 0 52 0; +#X connect 16 1 8 0; +#X connect 16 1 50 0; +#X connect 17 0 18 0; +#X connect 17 0 20 0; +#X connect 17 1 19 0; +#X connect 20 0 21 0; +#X connect 23 0 9 0; +#X connect 24 0 27 0; +#X connect 25 0 27 0; +#X connect 27 0 16 0; +#X connect 27 1 54 0; +#X connect 29 0 10 0; +#X connect 30 0 29 0; +#X connect 33 0 9 0; +#X connect 34 0 9 0; +#X connect 36 0 27 0; +#X connect 37 0 27 0; +#X connect 38 0 27 0; +#X connect 39 0 38 0; +#X connect 45 0 27 0; +#X connect 47 0 27 0; +#X connect 48 0 27 0; +#X connect 50 0 51 0; +#X connect 51 0 52 1; +#X connect 52 0 15 0; -- cgit v1.2.1