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

Generic IP Device - Configure

Started by ClaudioLNX, October 31, 2011, 12:31:47 PM

Previous topic - Next topic

tschak909

the ip address is available as a variable. Please look at the Panasonic IP Camera template.

-Thom

ClaudioLNX

I'm very sorry...thom.....but i dont find the ip variable in IP Camera template.
Perhaps i don't use conn object? is a problem?

IP Camera Template Code
conn_.Reconnect()
auth_s=device_.devdata_[114]+":"+device_.devdata_[115]
auth_a=Array.new;
auth_s.each{|c| auth_a.push(c)}

fix_path=device_.devdata_[2];
fix_path='/'+fix_path if(fix_path[0]!='/'[0]);

s = "GET "+fix_path+" HTTP/1.0\r\n"
s+= "Accept: */*\r\n"
s+= "Authorization: Basic "+auth_a.pack("m").chop+"\r\n"
s+= "\r\n"

conn_.Send(s)

My Code

require'net/http'
fix_path=device_.devdata_[2];
fix_path='/'+fix_path if(fix_path[0]!='/'[0]);
h=Net::HTTP.new('192.168.1.201',80)
resp,data=h.get(fix_path+absolute_channel.to_s,nil)


Claudio

tschak909

you're making this too hard, bro.

way too hard.

seriously, stop. before I smack you.

if you use conn_. guess what?

all of those details are set up for you, you just need to send and receive data down that pipe appropriately.

*thwap-you-upside-the-head* ;)

-Thom