Java Code Examples for org.eclipse.californium.core.network.CoapEndpoint#start()

The following examples show how to use org.eclipse.californium.core.network.CoapEndpoint#start() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CaptureImageV2Driver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public CaptureImageV2Driver() throws Exception {
	//NetworkConfig.getStandard().set(NetworkConfig.Keys.MAX_RESOURCE_BODY_SIZE,10000000);
	bdLogger.log(Level.FINEST, "In Constructor");
	cs = new CoapServer(); //initilize the server
	InetSocketAddress bindToAddress =
			new InetSocketAddress( LISTEN_PORT);//get the address
	CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
	cs.addEndpoint(tmp);//add endpoint to server
	startTime = System.currentTimeMillis();
	tmp.start();//Start this endpoint and all its components.
	driverPort = tmp.getAddress().getPort();
	cs.add(new bdResource());

	try {
		Class.forName("org.h2.Driver");
		Connection conn = DriverManager.getConnection("jdbc:h2:mem:CaptureImageV2Driver;DATABASE_TO_UPPER=false;DB_CLOSE_DELAY=-1",
				"user", "password");
		conn.createStatement().executeUpdate("CREATE TABLE data (" +" key  INTEGER AUTO_INCREMENT,"
				+" time BIGINT, "
				+" X VARCHAR(16), "
				+" Y VARCHAR(16), "
				+" Z VARCHAR(16), "
				+" Filename VARCHAR(1023) )");
		conn.close();
	}
	catch(Exception e) {
		e.printStackTrace();
	}

}
 
Example 2
Source File: FlyDroneDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public FlyDroneDriver() throws Exception {
		fddLogger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress = new InetSocketAddress( LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();

		cs.add(new fddResource());

}
 
Example 3
Source File: MissionDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public MissionDriver() throws Exception {
mdLogger.log(Level.FINEST, "In Constructor");
cs = new CoapServer(); //initilize the server
InetSocketAddress bindToAddress =
		new InetSocketAddress("localhost", LISTEN_PORT);//get the address
CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
cs.addEndpoint(tmp);//add endpoint to server
tmp.start();//Start this endpoint and all its components.
driverPort = tmp.getAddress().getPort();
cs.add(new mdResource());
}
 
Example 4
Source File: LocationDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public LocationDriver() throws Exception {
		bdLogger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress =
				new InetSocketAddress( LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		startTime = System.currentTimeMillis();
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();
		cs.add(new bdResource());
		makeH2();
}
 
Example 5
Source File: PicTraceDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public PicTraceDriver() throws Exception {
		bdLogger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress =
				new InetSocketAddress( LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		startTime = System.currentTimeMillis();
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();
		cs.add(new bdResource());
		makeH2();
}
 
Example 6
Source File: DroneGimbalDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public DroneGimbalDriver() throws Exception {
		dgdLogger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress = new InetSocketAddress( LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();

		cs.add(new dgdResource());

}
 
Example 7
Source File: VisionDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public VisionDriver() throws Exception {
		fddLogger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress = new InetSocketAddress( LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();

		cs.add(new fddResource());
}
 
Example 8
Source File: TemplateDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public TemplateDriver() throws Exception {
		logger.log(Level.FINEST, "In Constructor");
		cs = new CoapServer(); //initilize the server
		InetSocketAddress bindToAddress =
				new InetSocketAddress("localhost", LISTEN_PORT);//get the address
		CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
		cs.addEndpoint(tmp);//add endpoint to server
		tmp.start();//Start this endpoint and all its components.
		driverPort = tmp.getAddress().getPort();
		cs.add(new Resource());
}
 
Example 9
Source File: BatteryDriver.java    From SoftwarePilot with MIT License 5 votes vote down vote up
public BatteryDriver() throws Exception {
	bdLogger.log(Level.FINEST, "In Constructor");
	cs = new CoapServer(); //initilize the server
	InetSocketAddress bindToAddress =
			new InetSocketAddress("localhost", LISTEN_PORT);//get the address
	CoapEndpoint tmp = new CoapEndpoint(bindToAddress); //create endpoint
	cs.addEndpoint(tmp);//add endpoint to server
	startTime = System.currentTimeMillis();
	tmp.start();//Start this endpoint and all its components.
	driverPort = tmp.getAddress().getPort();
	cs.add(new bdResource());

	try {
			Class.forName("org.h2.Driver");
			Connection conn = DriverManager.getConnection("jdbc:h2:mem:BatteryDriver;DB_CLOSE_DELAY=-1",
																						 "user", "password");
			conn.createStatement().executeUpdate("CREATE TABLE data ("
																					 +" key  INTEGER AUTO_INCREMENT,"
																					 +" time BIGINT, "
																					 +" type VARCHAR(16), "
																					 +" value VARCHAR(1023) )");
			conn.close();
	}
	catch(Exception e) {
									e.printStackTrace();
	}

}