public static void main(String[] args) {
		RFIDPhidget rfid;
		try {
			rfid = new RFIDPhidget();

			initPhidget(rfid);

			rfid.openAny();
			System.out.println("RFIDSensor: waiting for RFID attachment...");
			rfid.waitForAttachment();

			// connect to sens-sation server
			server = new XmlRpcClient("http://localhost:"
					+ SENSATION_XML_RPC_PORT + "/RPC2");

			// check server status
			System.out.println("RFIDSensor: Pinging server at port:"
					+ SENSATION_XML_RPC_PORT);
			try {
				String ok = (String) server.execute("SensorPort.ping",
						new Vector<String>());
				if (ok.equals("Server running")) {
					System.out.println("RFIDSensor: Server is running...");
				}
			} catch (Exception e) {
				System.err.println("RFIDSensor: XML request failed: "
						+ e.getMessage());
				System.exit(0);
			}

			// register phidget via xml description
			System.out.println("RFIDSensor: Registering sensor...");
			try {
				Vector<String> xml = new Vector<>();
				xml.add("<Sensor id=\""
						+ SENSOR_ID
						+ "\" class=\"Presence\"><Description>RFID Reader, reports scanned tags (String)</Description><HardwareID /><Command /><LocationID>WE5/01.045</LocationID><Owner>Mutti</Owner><Comment /><AvailableSince>2005-01-01 10:00:00</AvailableSince><AvailableUntil>3014-12-01 12:00:00</AvailableUntil><SensorActivity activity=\"active\" /><NativeDataType>String</NativeDataType><MaximumValue>0.0</MaximumValue><MinimumValue>0.0</MinimumValue></Sensor>");

				String response = (String) server.execute(
						"SensorPort.updateSensor", xml);
				if (response.equals(SENSOR_ID)) {
					System.out.println("RFIDSensor: Sensor with id: "
							+ SENSOR_ID + " was registered successfully");
				}
			} catch (Exception e) {
				System.err.println("RFIDSensor: XML request failed:"
						+ e.getMessage());
				System.exit(0);
			}

			System.out.println("\nRFIDSensor: Press any key to EXIT\n");
			System.out.println("RFIDSensor: Listening for events...\n");
			System.in.read();

			System.out.println("RFIDSensor: closing...");
			rfid.close();

			// unregistering sensor
			System.out.println("RFIDSensor: Unregistering sensor...");
			try {
				Vector<String> param = new Vector<>();
				param.add(SENSOR_ID);
				server.execute("SensorPort.unregisterSensor", param);
			} catch (Exception e) {
				System.err.println("RFIDSensor: XML request failed:"
						+ e.getMessage());
			}

			// DONE
			System.out.println("RFIDSensor: DONE");

		} catch (PhidgetException | IOException e) {
			System.err.println(e);
		}
	}