// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/controller/api/RFIDSegmentController.java
// public interface RFIDSegmentController extends SegmentController {
// 
// 	/**
// 	 * Return the last seen RFID
// 	 */
// 	String lastRFID();
// 	
// 	/**
// 	 * Read an RFID. Resolves the promise when a new RFID is read.
// 	 * @return
// 	 */
// 	Promise<String> nextRFID();
// }


import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.metatype.annotations.Designate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.osgi.util.promise.Deferred;
import org.osgi.util.promise.Promise;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioPin;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.Pin;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import osgi.enroute.debug.api.Debug;
import osgi.enroute.trains.controller.api.RFIDSegmentController;
package osgi.enroute.trains.hw.provider;




/**
 * The MicroSwitch segment controller listens for microswitches to be triggered when a train
 * moves over them...
 * 
 * @deprecated As of CeBit 2016 we have changed to another locator system where an RFID reader is mounted 
 * on the train and RFID tags are spread around the track.
 *
 * @author tverbele
 *
 */
@Designate(ocd = MicroSwitchSegmentImpl.Config.class, factory = true)
@Component(name = "osgi.enroute.trains.hw.microswitch", immediate = true, property = { "service.exported.interfaces=*", //
		Debug.COMMAND_SCOPE + "=rfid", //
		Debug.COMMAND_FUNCTION + "=lastrfid" }, //
		configurationPolicy = ConfigurationPolicy.REQUIRE)
// Path: osgi.enroute.trains.api/src/osgi/enroute/trains/controller/api/RFIDSegmentController.java
// public interface RFIDSegmentController extends SegmentController {
// 
// 	/**
// 	 * Return the last seen RFID
// 	 */
// 	String lastRFID();
// 	
// 	/**
// 	 * Read an RFID. Resolves the promise when a new RFID is read.
// 	 * @return
// 	 */
// 	Promise<String> nextRFID();
// }


// Path: osgi.enroute.trains.hw.provider/src/osgi/enroute/trains/hw/provider/MicroSwitchSegmentImpl.java
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.metatype.annotations.Designate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.osgi.util.promise.Deferred;
import org.osgi.util.promise.Promise;
import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioPin;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.Pin;
import com.pi4j.io.gpio.PinPullResistance;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import osgi.enroute.debug.api.Debug;
import osgi.enroute.trains.controller.api.RFIDSegmentController;

package osgi.enroute.trains.hw.provider;




/**
 * The MicroSwitch segment controller listens for microswitches to be triggered when a train
 * moves over them...
 * 
 * @deprecated As of CeBit 2016 we have changed to another locator system where an RFID reader is mounted 
 * on the train and RFID tags are spread around the track.
 *
 * @author tverbele
 *
 */
@Designate(ocd = MicroSwitchSegmentImpl.Config.class, factory = true)
@Component(name = "osgi.enroute.trains.hw.microswitch", immediate = true, property = { "service.exported.interfaces=*", //
		Debug.COMMAND_SCOPE + "=rfid", //
		Debug.COMMAND_FUNCTION + "=lastrfid" }, //
		configurationPolicy = ConfigurationPolicy.REQUIRE)
public class MicroSwitchSegmentImpl implements RFIDSegmentController {