Newer
Older
import java.io.IOException;
import java.util.GregorianCalendar;
import org.josast.SIDS.HttpPostSIDS;
import org.josast.SIDS.SIDSData;
import org.josast.SIDS.Station;
/**
* @author chris
*
*/
public class TestSIDS {
private HttpPostSIDS client = null;
public TestSIDS(final String url) {
super();
client = new HttpPostSIDS(url);
}
public void send(final SIDSData sids) {
int result = client.SendSIDSBasic(sids);
System.out.println("resutats = " + result);
System.out.println("resutats = " + client.getResult());
}
/**
* @param args
*/
public static void main(String[] args) throws IOException {
// String url = "https://db.satnogs.org/api/telemetry/";
// String url = "https://db-dev.satnogs.org/api/telemetry/";
// String url = "http://127.0.0.1:9000/echoPost";
// String url = "https://amsat.electrolab.fr/SIDS";
String url = "http:/127.0.0.1:8080/SIDS";
TestSIDS test = new TestSIDS(url);
// initialise SIDS data
SIDSData sids = new SIDSData();
sids.setStation(new Station());
sids.setNoradID(99836);
sids.setTelemetryData(GregorianCalendar.getInstance().getTime(),
"8c6c96a88240e09e9c60648ca46103f0000000000801ca5c0012100319240a0d4b5f0600ff2800002822443e6fb0870d0a24c0");
System.out.println(sids.toStringBasic());
test.send(sids);