 
     }
     
-}+}
+
+#if arch(i386) || arch(x86_64)
+    class DummyCMDeviceMotion : CMDeviceMotion {
+        private let _userAcceleration: CMAcceleration!
+        private let _rotationRate: CMRotationRate!
+        
+        override init() {
+            _userAcceleration = CMAcceleration(x: 0, y: 0, z: 0)
+            _rotationRate = CMRotationRate(x: 0, y: 0, z: 0)
+            super.init()
+        }
+     
+        required init(coder aDecoder: NSCoder) {
+            fatalError("init(coder:) has not been implemented")
+        }
+   
+        override var userAcceleration: CMAcceleration {
+            get {
+                return _userAcceleration
+            }
+        }
+        
+        override var rotationRate: CMRotationRate {
+            get {
+                return _rotationRate
+            }
+        }
+    }
+    
+#endif

        private var count: Int = 0
        private var userAccelerationBuffer: NSMutableData!
        private var rotationBuffer: NSMutableData!

        init(outer: ThisDeviceSession) {
            self.outer = outer
            
            // CoreMotion initialization
            motionManager = CMMotionManager()
            motionManager.deviceMotionUpdateInterval = NSTimeInterval(0.01)         // 10 ms ~> 100 Hz
            motionManager.startDeviceMotionUpdatesToQueue(queue, withHandler: processDeviceMotionData)
            userAccelerationBuffer = emptyAccelerationLikeBuffer(0xad)
            rotationBuffer = emptyAccelerationLikeBuffer(0xbd)
        }

        func stop() {
            motionManager.stopDeviceMotionUpdates()
        }
        
        #if arch(i386) || arch(x86_64)
        
        func generateMotionData() {
            processDeviceMotionData(DummyCMDeviceMotion(), error: nil)
        }
        
        #endif
        

        func processDeviceMotionData(data: CMDeviceMotion!, error: NSError!) -> Void {
            
