From accf9b02b756474fd7ea08c5d27384f382a93003 Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Fri, 25 Dec 2020 14:18:21 +0100 Subject: [PATCH] changed the IIO --- .../com/example/aped/communication/IIO.java | 19 +++++++++++++++---- .../example/aped/communication/TestIO.java | 6 +++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/APED/app/src/main/java/com/example/aped/communication/IIO.java b/APED/app/src/main/java/com/example/aped/communication/IIO.java index 7b178a3..9c7f5b5 100644 --- a/APED/app/src/main/java/com/example/aped/communication/IIO.java +++ b/APED/app/src/main/java/com/example/aped/communication/IIO.java @@ -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); } diff --git a/APED/app/src/main/java/com/example/aped/communication/TestIO.java b/APED/app/src/main/java/com/example/aped/communication/TestIO.java index 3ddfc0c..eb07aae 100644 --- a/APED/app/src/main/java/com/example/aped/communication/TestIO.java +++ b/APED/app/src/main/java/com/example/aped/communication/TestIO.java @@ -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; } }