[slinkelist] Slinke from web

Steve Cato cato@usa.net
Mon, 12 Jun 2000 23:38:22 -0400


Here are the files I got to work as a test of X10 control over the web.
Similar should work for controlling CDJ or sending IR commands etc.
The time part just shows that ASP is running OK.
Three files are needed default.asp (set as the default page for the server),
respond.asp and global.asa. Most of the code was derived by simplifying
a couple of examples on the user download page. Hope it helps.

default.asp+++++++++++++++++
<h1>Hello, the time is <% = Time %> </h1>


<FORM ACTION="respond.asp" METHOD="POST">
Testing C1<BR>
<INPUT TYPE="RADIO" NAME="C1" VALUE="ON">On<BR>
<INPUT TYPE="RADIO" NAME="C1" VALUE="OFF">Off<BR>
<INPUT TYPE="SUBMIT" VALUE="Send">
</FORM>

respond.asp++++++++++++++
<% x = Request.Form("C1")%><BR>

<%
    Dim oSlinkx
    Set oSlinkx=Session("oSlinkx")

If x = "ON" then
     Response.Write "Turning C1 On"
     oSlinkx.SendEx("x10:On[c2]")
   Else
     Response.Write "Turning C1 Off"
     oSlinkx.SendEx("x10:Off[c2]")
   End If
%>

global.asa++++++++++++++++++
<script language=vbscript runat=server>

     Sub Session_OnStart
       Dim oSlinkx
       Set oSlinkx=Server.CreateObject("SLINKX.SlinkxCtrl.1")
       oSlinkx.AddDeviceText "cdj", "type=devtx", 1, 1, 0
       oSlinkx.AddDeviceText "cdjr", "type=devrx", 1, 1, 0
       oSlinkx.AddDeviceText "x10", "type=cm11a", 1, 1, 0
       oSlinkx.AddDevice "tv1", "c:\files\hafiles\sharptv.cde", 1, 1, 32
       Set Session("oSlinkx")=oSlinkx

     End Sub


</script>
++++++++++++++++++++++++++++




At 09:19 PM 6/12/2000 -0400, Neil Cunningham wrote:
>I'm working on a web page to control my system through slink-e.  I've
>added the "runat=server" but Slinkeserv starts on whatever system I call
>the page from instead of the server where the slink-e and web server
>are.  Can this run as server side?
>
>If anyone has a small piece of code that shows how to make this work I
>would greatly appreciate it if you could share.  I tried taking the TV
>(html) sample and adding the runat=server to the alx file but got the
>same result.
>
>Thanks,
>Neil
>
>
>_______________________________________________
>slinkelist maillist  -  slinkelist@nirvis.com
>http://www.nirvis.com/mailman/listinfo/slinkelist
>