1
Users / Re: Generic IP Device - Configure
« on: November 12, 2011, 09:03:22 am »
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
Claudio
Perhaps i don't use conn object? is a problem?
IP Camera Template Code
Code: [Select]
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 CodeCode: [Select]
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