News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Request XML Data #869

Started by ddamron, November 21, 2007, 06:37:38 PM

Previous topic - Next topic

ddamron

I am trying to write an interface for the EZBridge (IP/Insteon) using GSD/Ruby.

all of the commands to/from the EZBridge are in XML format.

I noticed, in the Datagrid Commands, seems like XML parsing is already supported.

I searched the wiki for XML with no hits.

Does anyone know how to use these commands and, if possible, give a 'sample'?

attempting simple commands first.. I'd like to send an XML msg and receive an XML msg back (most of the time, multiple XML msgs back)

Here's a sample xml msg I send to IP:port
<?xml version="1.0"?>
<command>SndIns
<parameter1>0x0B</parameter1>
<parameter2>0x71</parameter2>
<parameter3>0xAB</parameter3>
<parameter4>0x0F</parameter4>
<parameter5>0x11</parameter5>
<parameter6>0xFF</parameter6>
</command>

and the message(s) I get back:

<?xml version="1.0"?>
<Response> SndIns
<Parameter1>0X2</Parameter1>
<Parameter2>0X62</Parameter2>
<Parameter3>0XB</Parameter3>
<Parameter4>0X71</Parameter4>
<Parameter5>0XAB</Parameter5>
<Parameter6>0XF</Parameter6>
<Parameter7>0X11</Parameter7>
<Parameter8>0XFF</Parameter8>
<Parameter9>0X6</Parameter9>
</Response>

then...

<?xml version="1.0"?>
<Response> InsStdMsg
<Parameter1>0X2</Parameter1>
<Parameter2>0X50</Parameter2>
<Parameter3>0XB</Parameter3>
<Parameter4>0X71</Parameter4>
<Parameter5>0XAB</Parameter5>
<Parameter6>0X5</Parameter6>
<Parameter7>0XEA</Parameter7>
<Parameter8>0XD9</Parameter8>
<Parameter9>0X2B</Parameter9>
<Parameter10>0X11</Parameter10>
<Parameter11>0XFF</Parameter11>
</Response>



Thanks much!

Dan

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

hmm.  Ok, looks like nobody has tried that...

How about this:  There are a few Ruby Gems out there to do XML.. Can I use one of those, or do I need to parse my XML myself?
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

tschak909

haven't tried.. it's always worth a try.

-Thom

ddamron

k, I'll check into that... don't know if embedded ruby is the same... it might be simpler to implement my own parser.. the results I'll be parsing are very simple.

The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.

ddamron

FYI, rexml is now included with ruby.. works great! (used to be a ruby gem)
The only intuitive interface is the nipple.  After that it's all learned.
My other computer is your windows box.
I'm out of my mind.  Back in 5 minutes.
Q:  What's Red and smells like blue paint?

A:  Red Paint.