LinuxMCE Forums
May 22, 2013, 02:39:08 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 [2]
  Print  
Author Topic: Generic IP Device - Configure  (Read 1332 times)
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #15 on: November 11, 2011, 12:42:32 am »

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

-Thom
Logged
ClaudioLNX
Newbie
*
Posts: 7


View Profile
« Reply #16 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
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
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
Logged
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #17 on: November 13, 2011, 01:51:38 am »

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* Wink

-Thom
Logged
Pages: 1 [2]
  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!