added ability to read buffered values from the raspberry
This commit is contained in:
parent
3cb012d86b
commit
9c30a011e8
@ -77,6 +77,27 @@ public class Communicator {
|
||||
requestQueue.add(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to read a device value buffer from the raspberry.
|
||||
* @param deviceName the name of the device
|
||||
* @param responseListener the {@link Response.Listener} for defining
|
||||
* actions to be performed on response
|
||||
*/
|
||||
public void readBuffer(final String deviceName,
|
||||
final Response.Listener<JSONObject> responseListener) {
|
||||
String url = "http://" + address
|
||||
+ ":" + port
|
||||
+ "/device/" + deviceName + "/buffer/";
|
||||
JsonObjectRequest request = new JsonObjectRequest(
|
||||
Request.Method.GET,
|
||||
url,
|
||||
null,
|
||||
responseListener,
|
||||
error -> handleError(error, "READ")
|
||||
);
|
||||
requestQueue.add(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes an api call to the endpoint of a device.
|
||||
* @param deviceName the name of the device
|
||||
|
Loading…
x
Reference in New Issue
Block a user