package com.neucrack.communication;

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

public class ToDevices {
	private DataInputStream mInStream=null;
	private DataOutputStream mOutStream=null;
	
	public ToDevices(DataInputStream inStream,DataOutputStream outStream){
		mInStream = inStream;
		mOutStream = outStream;
	}
	
	public SignInfo WaitSignIn(){
		SignInfo result = new SignInfo();
		return result;
	}
	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 DoorInfo GetDoorStatus(String device){
		DoorInfo door = new DoorInfo();
		return door;
	}
	
	public LightInfo GetLightStatus(String device){
		LightInfo light = new LightInfo();
		return light;
	}
	public CurtainInfo GetCurtainStatus(String device){
		CurtainInfo curtain = new CurtainInfo();
		return curtain;
	}
	public SensorInfo GetSensorData(String device,int SensorName){
		SensorInfo sensor = new SensorInfo();
		return sensor;
	}
	
	class SignInfo{
		boolean isValid;
		String device;
		String userName;
		String passwd;
	}
	class LightInfo{
		boolean isValid;
		boolean isOn;
	}
	class CurtainInfo{
		boolean isValid;
		boolean isOn;
	}
	class SensorInfo{
		boolean isValid;
		int value;
	}
	class DoorInfo{
		boolean isValid;
		boolean isOn;
	}
}

@@ -658,24 +658,23 @@
 %09public 
-DoorInfo
+boolean
  GetDoor
@@ -693,21 +693,17 @@
 g device
-)%7B%0A%09%09
+,
 DoorInfo
@@ -711,26 +711,10 @@
 door
- = new DoorInfo();
+)%7B
 %0A%09%09r
@@ -719,20 +719,21 @@
 %09return 
-door
+false
 ;%0A%09%7D%0A%09%0A%09
@@ -739,25 +739,23 @@
 %09public 
-LightInfo
+boolean
  GetLigh
@@ -775,21 +775,17 @@
 g device
-)%7B%0A%09%09
+,
 LightInf
@@ -795,27 +795,10 @@
 ight
- = new LightInfo();
+)%7B
 %0A%09%09r
@@ -803,21 +803,21 @@
 %09return 
-light
+false
 ;%0A%09%7D%0A%09pu
@@ -821,27 +821,23 @@
 %09public 
-CurtainInfo
+boolean
  GetCurt
@@ -859,21 +859,17 @@
 g device
-)%7B%0A%09%09
+,
 CurtainI
@@ -883,29 +883,10 @@
 tain
- = new CurtainInfo();
+)%7B
 %0A%09%09r
@@ -891,23 +891,21 @@
 %09return 
-curtain
+false
 ;%0A%09%7D%0A%09pu
@@ -909,26 +909,23 @@
 %09public 
-SensorInfo
+boolean
  GetSens
@@ -959,21 +959,17 @@
 nsorName
-)%7B%0A%09%09
+,
 SensorIn
@@ -981,28 +981,10 @@
 nsor
- = new SensorInfo();
+)%7B
 %0A%09%09r
@@ -989,22 +989,21 @@
 %09return 
-sensor
+false
 ;%0A%09%7D%0A%09%0A%09
@@ -1020,35 +1020,23 @@
 Info%7B%0A%09%09
-boolean isValid;%0A%09%09
+public 
 String d
@@ -1040,24 +1040,31 @@
 g device;%0A%09%09
+public 
 String userN
@@ -1070,16 +1070,23 @@
 Name;%0A%09%09
+public 
 String p
@@ -1115,35 +1115,23 @@
 Info%7B%0A%09%09
-boolean isValid;%0A%09%09
+public 
 boolean 
@@ -1161,35 +1161,23 @@
 Info%7B%0A%09%09
-boolean isValid;%0A%09%09
+public 
 boolean 
@@ -1206,35 +1206,23 @@
 Info%7B%0A%09%09
-boolean isValid;%0A%09%09
+public 
 int valu
@@ -1250,27 +1250,15 @@
 %7B%0A%09%09
-boolean isValid;%0A%09%09
+public 
 bool

update interface