kopia lustrzana https://github.com/bertrik/ttnhabbridge
remove listener upload function in amatuersondehub version
It will be uploaded along with the telemetry payloadpull/8/head
rodzic
f54fb58494
commit
4a1d2f7424
|
@ -159,51 +159,4 @@ public final class AmateurSondehubUploader {
|
|||
return DatatypeConverter.printHexBinary(hash).toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules new listener data to be sent to amateurSondehub.
|
||||
*
|
||||
* @param receiver the receiver data
|
||||
* @param instant the current date/time
|
||||
*/
|
||||
public void scheduleListenerDataUpload(HabReceiver receiver, Instant instant) {
|
||||
executor.execute(() -> uploadListener(receiver, instant));
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads listener data (information and telemetry)
|
||||
*
|
||||
* @param receiver the receiver/listener
|
||||
* @param instant the current date/time
|
||||
*/
|
||||
private void uploadListener(HabReceiver receiver, Instant instant) {
|
||||
LOG.info("Upload listener data for {}", receiver);
|
||||
try {
|
||||
// get two uuids
|
||||
LOG.info("Getting UUIDs for listener data upload...");
|
||||
UuidsList list = restClient.getUuids(2).execute().body();
|
||||
List<String> uuids = list.getUuids();
|
||||
if ((uuids != null) && (uuids.size() >= 2)) {
|
||||
LOG.info("Got {} UUIDs", uuids.size());
|
||||
|
||||
// upload payload listener info
|
||||
LOG.info("Upload listener info using UUID {}...", uuids.get(0));
|
||||
ListenerInformationDoc info = new ListenerInformationDoc(instant, receiver);
|
||||
UploadResult infoResult = restClient.uploadDocument(uuids.get(0), info.format()).execute().body();
|
||||
LOG.info("Result listener info: {}", infoResult);
|
||||
|
||||
// upload payload telemetry
|
||||
LOG.info("Upload listener telemetry using UUID {}...", uuids.get(1));
|
||||
ListenerTelemetryDoc telem = new ListenerTelemetryDoc(instant, receiver);
|
||||
UploadResult telemResult = restClient.uploadDocument(uuids.get(1), telem.format()).execute().body();
|
||||
LOG.info("Result listener telemetry: {}", telemResult);
|
||||
} else {
|
||||
LOG.warn("Did not receive UUIDs for upload");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.warn("Caught IOException: {}", e.getMessage());
|
||||
} catch (Exception e) {
|
||||
LOG.error("Caught Exception: {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue