changed the IIO

This commit is contained in:
paul-loedige 2020-12-25 14:18:21 +01:00
parent 321707368f
commit accf9b02b7
2 changed files with 18 additions and 7 deletions

View File

@ -1,8 +1,19 @@
package com.example.aped.communication;
public interface IIO {
public interface IIO
{
/**
* reads a value from a device connected to the raspberry
* @param deviceName the name of the device to read from
* @return the value read
*/
String read(String deviceName);
public Object read(String deviceName);
public Object write(String deviceName, Object value);
/**
* writes a value to a device connected to the raspberry
* @param deviceName the name of the device to write to
* @param value the value to write to the device
* @return the value written
*/
String write(String deviceName, String value);
}

View File

@ -3,12 +3,12 @@ package com.example.aped.communication;
public class TestIO implements IIO {
@Override
public Object read(String deviceName) {
return new String("test");
public String read(String deviceName) {
return "test";
}
@Override
public Object write(String deviceName, Object value) {
public String write(String deviceName, String value) {
return value;
}
}