// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/camera/Camera.java
// public interface Camera extends Thing {
// 
//     public final static String STATE = "state";
// 
//     public static enum State {
//     	OFF, RECORDING;
//     }
// 
//     public static enum Format {
//     	YUV, RGB, GRAYSCALE, MJPEG;
//     }
// 
//     /**
//      * Get the state of the camera
//      *
//      * @return state of the camera
//      */
//     public State getState();
//     
//     /**
//      * Return boolean if the camera is on
//      */
//     public boolean isOn();
// 
//     /**
//      * Get the width of the frames the camera is fetching
//      *
//      * @return frame width or -1 if not initialized
//      */
//     public int getWidth();
// 
//     /**
//      * Get the height of the frames the camera is fetching
//      *
//      * @return frame height or -1 if not initialized
//      */
//     public int getHeight();
//     
//     /**
//      * Get the current capturing format
//      * 
//      * @return frame format
//      */
//     public Format getFormat();
//     
//     /**
//      * Return the framerate (frames per second) that is aimed for when having a CameraListener
//      * 
//      * @return framerate
//      */
//     public float getFramerate();
//     
//     /**
//      * Set framerate
//      * 
//      * @param f framerate to set
//      */
//     public void setFramerate(float f);
//     
//     /**
//      * Return the latest camera frame when the camera is turned on
//      * @return byte array in the camera's current format
//      */
//     public byte[] getFrame();
//     
//     /**
//      * Turn the camera on
//      */
//     public void start();
// 
//     /**
//      * Turn the camera on with preferred width,height capture ratio
//      *
//      * @param width
//      * @param height
//      */
//     public void start(int width, int height, Format format);
// 
//     /**
//      * Stop capturing
//      */
//     public void stop();
//     
//     /**
//      * Toggle
//      */
//     public void toggle();
// }
// 
// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/camera/CameraListener.java
// public interface CameraListener {
// 
//     public final static String CAMERA_ID = "be.iminds.iot.thing.camera.id";
//     public final static String CAMERA_FORMAT = "be.iminds.iot.thing.camera.format";
// 
//     public void nextFrame(UUID id, Format format, byte[] data);
// 
// }
// 
// Path: be.iminds.iot.things.dyamand.adapter/src/be/iminds/iot/things/dyamand/adapter/ServiceAdapter.java
// public interface ServiceAdapter {
// 
// 	/**
// 	 * @return the type string
// 	 */
// 	public String getType();
// 	
// 	/**
// 	 * @return The target interfaces to adapt to 
// 	 */
// 	public String[] getTargets();
// 	
// 	/**
// 	 * Translate the ServicePojo source to an object that implements all target interfaces 
// 	 * @param source The source service
// 	 * @return an object implementing all target interfaces
// 	 */
// 	public Object getServiceObject(final Object source) throws Exception;
// 	
// 	/**
// 	 * Translate a variable name and value to a new state variable
// 	 * @param variable state variable name
// 	 * @param value state variable value
// 	 * @return translated state variable
// 	 */
// 	public StateVariable translateStateVariable(final String variable,
// 		    final Object value) throws Exception;
// 	
// }
// 
// Path: be.iminds.iot.things.dyamand.adapter/src/be/iminds/iot/things/dyamand/adapter/StateVariable.java
// public class StateVariable {
// 
// 	public final String name;
// 	public final Object value;
// 
// 	public StateVariable(final String n, final Object v) {
// 		this.name = n;
// 		this.value = v;
// 	}
// 
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public Object getValue() {
// 		return this.value;
// 	}
// }


import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import org.dyamand.v4l2.api.V4L2CameraFormat;
import org.dyamand.v4l2.api.V4L2CameraListener;
import org.dyamand.v4l2.api.V4L2CameraServicePOJO;
import org.dyamand.v4l2.api.V4L2CameraServiceType;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import aQute.lib.collections.MultiMap;
import be.iminds.iot.things.api.camera.Camera;
import be.iminds.iot.things.api.camera.CameraListener;
import be.iminds.iot.things.dyamand.adapter.ServiceAdapter;
import be.iminds.iot.things.dyamand.adapter.StateVariable;
			
			@Override
			public boolean isOn(){
				return pojo.isOn();
			}
			
			@Override
			public Format getFormat() {
				return Format.values()[pojo.getFormat()];
			}

			@Override
			public byte[] getFrame() {
				return pojo.getFrame();
			}

			@Override
			public float getFramerate() {
				return pojo.getFramerate();
			}
			
			@Override
			public void setFramerate(float f) {
				pojo.setFramerate(f);
			}

		};
	}

	@Override
// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/camera/Camera.java
// public interface Camera extends Thing {
// 
//     public final static String STATE = "state";
// 
//     public static enum State {
//     	OFF, RECORDING;
//     }
// 
//     public static enum Format {
//     	YUV, RGB, GRAYSCALE, MJPEG;
//     }
// 
//     /**
//      * Get the state of the camera
//      *
//      * @return state of the camera
//      */
//     public State getState();
//     
//     /**
//      * Return boolean if the camera is on
//      */
//     public boolean isOn();
// 
//     /**
//      * Get the width of the frames the camera is fetching
//      *
//      * @return frame width or -1 if not initialized
//      */
//     public int getWidth();
// 
//     /**
//      * Get the height of the frames the camera is fetching
//      *
//      * @return frame height or -1 if not initialized
//      */
//     public int getHeight();
//     
//     /**
//      * Get the current capturing format
//      * 
//      * @return frame format
//      */
//     public Format getFormat();
//     
//     /**
//      * Return the framerate (frames per second) that is aimed for when having a CameraListener
//      * 
//      * @return framerate
//      */
//     public float getFramerate();
//     
//     /**
//      * Set framerate
//      * 
//      * @param f framerate to set
//      */
//     public void setFramerate(float f);
//     
//     /**
//      * Return the latest camera frame when the camera is turned on
//      * @return byte array in the camera's current format
//      */
//     public byte[] getFrame();
//     
//     /**
//      * Turn the camera on
//      */
//     public void start();
// 
//     /**
//      * Turn the camera on with preferred width,height capture ratio
//      *
//      * @param width
//      * @param height
//      */
//     public void start(int width, int height, Format format);
// 
//     /**
//      * Stop capturing
//      */
//     public void stop();
//     
//     /**
//      * Toggle
//      */
//     public void toggle();
// }
// 
// Path: be.iminds.iot.things.api/src/be/iminds/iot/things/api/camera/CameraListener.java
// public interface CameraListener {
// 
//     public final static String CAMERA_ID = "be.iminds.iot.thing.camera.id";
//     public final static String CAMERA_FORMAT = "be.iminds.iot.thing.camera.format";
// 
//     public void nextFrame(UUID id, Format format, byte[] data);
// 
// }
// 
// Path: be.iminds.iot.things.dyamand.adapter/src/be/iminds/iot/things/dyamand/adapter/ServiceAdapter.java
// public interface ServiceAdapter {
// 
// 	/**
// 	 * @return the type string
// 	 */
// 	public String getType();
// 	
// 	/**
// 	 * @return The target interfaces to adapt to 
// 	 */
// 	public String[] getTargets();
// 	
// 	/**
// 	 * Translate the ServicePojo source to an object that implements all target interfaces 
// 	 * @param source The source service
// 	 * @return an object implementing all target interfaces
// 	 */
// 	public Object getServiceObject(final Object source) throws Exception;
// 	
// 	/**
// 	 * Translate a variable name and value to a new state variable
// 	 * @param variable state variable name
// 	 * @param value state variable value
// 	 * @return translated state variable
// 	 */
// 	public StateVariable translateStateVariable(final String variable,
// 		    final Object value) throws Exception;
// 	
// }
// 
// Path: be.iminds.iot.things.dyamand.adapter/src/be/iminds/iot/things/dyamand/adapter/StateVariable.java
// public class StateVariable {
// 
// 	public final String name;
// 	public final Object value;
// 
// 	public StateVariable(final String n, final Object v) {
// 		this.name = n;
// 		this.value = v;
// 	}
// 
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public Object getValue() {
// 		return this.value;
// 	}
// }


// Path: be.iminds.iot.things.dyamand.adapter/src/be/iminds/iot/things/dyamand/adapters/V4L2CameraAdapter.java
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import org.dyamand.v4l2.api.V4L2CameraFormat;
import org.dyamand.v4l2.api.V4L2CameraListener;
import org.dyamand.v4l2.api.V4L2CameraServicePOJO;
import org.dyamand.v4l2.api.V4L2CameraServiceType;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;
import aQute.lib.collections.MultiMap;
import be.iminds.iot.things.api.camera.Camera;
import be.iminds.iot.things.api.camera.CameraListener;
import be.iminds.iot.things.dyamand.adapter.ServiceAdapter;
import be.iminds.iot.things.dyamand.adapter.StateVariable;

			
			@Override
			public boolean isOn(){
				return pojo.isOn();
			}
			
			@Override
			public Format getFormat() {
				return Format.values()[pojo.getFormat()];
			}

			@Override
			public byte[] getFrame() {
				return pojo.getFrame();
			}

			@Override
			public float getFramerate() {
				return pojo.getFramerate();
			}
			
			@Override
			public void setFramerate(float f) {
				pojo.setFramerate(f);
			}

		};
	}

	@Override
	public StateVariable translateStateVariable(final String variable,