/**
 * 
 */
package org.josast.SIDS.app;

import java.io.IOException;
import java.util.GregorianCalendar;

import org.apache.log4j.BasicConfigurator;
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(String url) {
		super();
		 client = new HttpPostSIDS(url);
		 
	}

	
	public void Send(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 {

		BasicConfigurator.configure();

	//	 String url = "https://db.satnogs.org/api/telemetry/";
	//	String url = "http://127.0.0.1:9000/echoPost";	
		String url = "https://amsat.electrolab.fr/SIDS";
		
		
		TestSIDS test = new TestSIDS(url);
		
			
		// initialise SIDS data

		SIDSData sids = new SIDSData();
		sids.setStation(new Station());
		sids.setNoradID(99991);
		sids.setTelemetryData(GregorianCalendar.getInstance().getTime(),
				"8c6c96a88240e09e9c60648ca46103f0000000000801ca5c0012100319240a0d4b5f0600ff2800002822443e6fb0870d0a24c0");
		System.out.println(sids.toStringBasic());
		test.Send(sids);

	}

}
