package com.neucrack.communication;

import java.io.DataInputStream;
import java.io.DataOutputStream;

public class ToDevices {
	private DataInputStream mInStream=null;
	private DataOutputStream mOutStream=null;
	
	public boolean WaitSignIn(String device,String userName,String passwd){
		return false;
	}
	public boolean LightControl(String device,boolean isOn){
		return isOn;
	}
	public boolean CurtainControl(String device,boolean isOn){
		return isOn;
	}
	public boolean DoorControl(String device,boolean isOn){
		return isOn;
	}
	public boolean GetDoorStatus(String device,boolean isOn){
		return isOn;
	}
	
	public boolean GetLightStatus(String device,boolean isOn){
		return isOn;
	}
	public boolean GetCurtainStatus(String device,boolean isOn){
		return isOn;
	}
	public boolean GetSensorData(String device,int SensorName,int value){
		return false;
	}
	
}

@@ -219,72 +219,193 @@
 lic 
-boolean WaitSignIn(String device,String userName,String passwd)%7B
+ToDevices(DataInputStream inStream,DataOutputStream outStream)%7B%0A%09%09mInStream = inStream;%0A%09%09mOutStream = outStream;%0A%09%7D%0A%09%0A%09public SignInfo WaitSignIn()%7B%0A%09%09SignInfo result = new SignInfo();
 %0A%09%09r
@@ -406,29 +406,30 @@
 );%0A%09%09return 
-false
+result
 ;%0A%09%7D%0A%09public
@@ -654,31 +654,32 @@
 %0A%09%7D%0A%09public 
-boolean
+DoorInfo
  GetDoorStat
@@ -690,39 +690,60 @@
 tring device
-,boolean isOn)%7B
+)%7B%0A%09%09DoorInfo door = new DoorInfo();
 %0A%09%09return is
@@ -736,28 +736,28 @@
 );%0A%09%09return 
-isOn
+door
 ;%0A%09%7D%0A%09%0A%09publ
@@ -755,31 +755,33 @@
 %7D%0A%09%0A%09public 
-boolean
+LightInfo
  GetLightSta
@@ -793,39 +793,63 @@
 tring device
-,boolean isOn)%7B
+)%7B%0A%09%09LightInfo light = new LightInfo();
 %0A%09%09return is
@@ -838,36 +838,37 @@
 nfo();%0A%09%09return 
-isOn
+light
 ;%0A%09%7D%0A%09public boo
@@ -860,31 +860,35 @@
 %0A%09%7D%0A%09public 
-boolean
+CurtainInfo
  GetCurtainS
@@ -902,39 +902,69 @@
 tring device
-,boolean isOn)%7B
+)%7B%0A%09%09CurtainInfo curtain = new CurtainInfo();
 %0A%09%09return is
@@ -953,35 +953,38 @@
 nfo();%0A%09%09return 
-isO
+curtai
 n;%0A%09%7D%0A%09public bo
@@ -981,23 +981,26 @@
 %09public 
-boolean
+SensorInfo
  GetSens
@@ -1038,40 +1038,386 @@
 Name
-,int value)%7B%0A%09%09return false;%0A%09%7D%0A%09
+)%7B%0A%09%09SensorInfo sensor = new SensorInfo();%0A%09%09return sensor;%0A%09%7D%0A%09%0A%09class SignInfo%7B%0A%09%09boolean isValid;%0A%09%09String device;%0A%09%09String userName;%0A%09%09String passwd;%0A%09%7D%0A%09class LightInfo%7B%0A%09%09boolean isValid;%0A%09%09boolean isOn;%0A%09%7D%0A%09class CurtainInfo%7B%0A%09%09boolean isValid;%0A%09%09boolean isOn;%0A%09%7D%0A%09class SensorInfo%7B%0A%09%09boolean isValid;%0A%09%09int value;%0A%09%7D%0A%09class DoorInfo%7B%0A%09%09boolean isValid;%0A%09%09boolean isOn;%0A%09%7D
 %0A%7D%0A

update interface of to devices