LinuxMCE Forums
May 23, 2013, 07:27:50 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
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
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Request XML Data #869  (Read 920 times)
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« 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 » Logged

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 WWW
« 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?
Logged

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: 5101

DOES work for LinuxMCE.


View Profile
« Reply #2 on: November 23, 2007, 08:14:49 pm »

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

-Thom
Logged
ddamron
Alumni
wants to work for LinuxMCE
*
Posts: 962



View Profile WWW
« 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.

Logged

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 WWW
« 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)
Logged

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!