Ruby and the IXM, all together now

1 view
Skip to first unread message

Matthew Beale

unread,
Sep 21, 2009, 3:22:01 PM9/21/09
to illum...@googlegroups.com
Hi all,

I've been watching you guys throw code around for a week or two now, I
figure it's about time to kick in some of my own.

Chris showed me how to use sfbprog to communicate with an IXM at the
packet level from my Linux box. sfbprog handles all the baud rate
negotiation and ugly low level stuff, but you can't really build
anything with it. Matt Stack's work with Mathmatica isn't doing any
baud rate work (yet), and man it looks slow.

I wrapped sfbprog in Ruby and built a basic implementation of reflex.
You can code Ruby on the host and use C for your sketches, but maintain
roughly the same pattern.

Take a look:

http://github.com/mixonic/libixm

GitHub is being slow to build the Gem, so for now you'll need to pull
the code down and drop it in a directory somewhere. Some example code:

http://github.com/mixonic/libixm/blob/master/examples/yodel_with_echo_packet.rb

I mention using a basic packet-level echo in a couple places. This is
that sketch:

--------------------------------------------
void yowl(u8 * packet) {
facePrintf(packetSource(packet), "You sent me a '%#p'\n", packet);
}

void setup() {
Body.otherwise(yowl);
}

void loop() {}
-----------------------------------------

Just a step away from doing some serious processing on my grid :-) The
wrapper around sfbprog isn't meant to be permanent. Eventually I'd like
to see a Ruby-native adapter or C-extension.

Thoughts? Thanks!

--
Matthew Beale :: 607 227 0871
Resume & Portfolio @ http://madhatted.com

Reply all
Reply to author
Forward
0 new messages