Author Topic: Request XML Data #869  (Read 4785 times)

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Request XML Data #869
« on: November 21, 2007, 06:37:38 pm »
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

« Last Edit: November 21, 2007, 06:42:58 pm by ddamron »
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

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Request XML Data #869
« Reply #1 on: November 23, 2007, 05:24:00 pm »
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

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Request XML Data #869
« Reply #2 on: November 23, 2007, 08:14:49 pm »
haven't tried.. it's always worth a try.

-Thom

ddamron

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Request XML Data #869
« Reply #3 on: November 24, 2007, 06:29:36 am »
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

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 962
    • View Profile
    • My LinuxMCE User Page
Re: Request XML Data #869
« Reply #4 on: November 28, 2007, 02:03:11 am »
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.