Esempio n. 1
0
        private void ProcessImuDataNotification(NotificationCarrier notification)
        {
            ProtocolImuDataType imuData = new ProtocolImuDataType();

            imuData.DeSerialize(notification.CharacteristicValue);

            OnImuDataReceived(this, imuData.OrientationW, imuData.OrientationX, imuData.OrientationY, imuData.OrientationZ,
                              imuData.Accelerometer, imuData.Gyroscope, notification.Timestamp);
        }
Esempio n. 2
0
        private void ProcessEmgDataNotification(NotificationCarrier notification)
        {
            byte sensorNumber = (byte)(notification.CharacteristicUUID.ToArray()[13] - 1);

            ProtocolEmgDataType emgData = new ProtocolEmgDataType();

            emgData.DeSerialize(notification.CharacteristicValue);

            OnEmgDataReceived(this, emgData.EmgData.ToArray(), sensorNumber, notification.Timestamp);
        }
Esempio n. 3
0
        private void ProcessMotionEventNotification(NotificationCarrier notification)
        {
            ProtocolMotionEventType motionEvent = new ProtocolMotionEventType();

            motionEvent.DeSerialize(notification.CharacteristicValue);

            switch (motionEvent.Event)
            {
            case ProtocolMotionEvent.Tap:
            {
                OnTapDetected(this, motionEvent.TapDirection, motionEvent.TapCount, notification.Timestamp);
                break;
            }
            }
        }
Esempio n. 4
0
        private void ProcessClassifierEventNotification(NotificationCarrier notification)
        {
            ProtocolClassifierEventType classifierEvent = new ProtocolClassifierEventType();

            classifierEvent.DeSerialize(notification.CharacteristicValue);

            switch (classifierEvent.Event)
            {
            case ProtocolClassifierEvent.ArmSynced:
            {
                OnArmSynced(this, (Arm)classifierEvent.Arm, (BraceletDirection)classifierEvent.Direction, notification.Timestamp);
                break;
            }

            case ProtocolClassifierEvent.ArmUnsynced:
            {
                OnArmUnsynced(this, notification.Timestamp);
                break;
            }

            case ProtocolClassifierEvent.SyncFailed:
            {
                OnSyncFailed(this, notification.Timestamp);
                break;
            }

            case ProtocolClassifierEvent.Locked:
            {
                OnLocked(this, notification.Timestamp);
                break;
            }

            case ProtocolClassifierEvent.Unlocked:
            {
                OnUnLocked(this, notification.Timestamp);
                break;
            }

            case ProtocolClassifierEvent.Pose:
            {
                OnPoseChanged(this, (Pose)classifierEvent.Pose, notification.Timestamp);
                break;
            }
            }
        }
Esempio n. 5
0
		private void ProcessClassifierEventNotification (NotificationCarrier notification)
		{
			ProtocolClassifierEventType classifierEvent = new ProtocolClassifierEventType ();
			classifierEvent.DeSerialize (notification.CharacteristicValue);

			switch (classifierEvent.Event)
			{
			case ProtocolClassifierEvent.ArmSynced:
				{
					OnArmSynced (this, (Arm) classifierEvent.Arm, (BraceletDirection) classifierEvent.Direction, notification.Timestamp);
					break;
				}
			case ProtocolClassifierEvent.ArmUnsynced:
				{
					OnArmUnsynced (this, notification.Timestamp);
					break;
				}
			case ProtocolClassifierEvent.SyncFailed:
				{
					OnSyncFailed (this, notification.Timestamp);
					break;
				}
			case ProtocolClassifierEvent.Locked:
				{
					OnLocked (this, notification.Timestamp);
					break;
				}
			case ProtocolClassifierEvent.Unlocked:
				{
					OnUnLocked (this, notification.Timestamp);
					break;
				}
			case ProtocolClassifierEvent.Pose:
				{
					OnPoseChanged (this, (Pose) classifierEvent.Pose, notification.Timestamp);
					break;
				}
			}
		}
Esempio n. 6
0
		private void ProcessMotionEventNotification (NotificationCarrier notification)
		{
			ProtocolMotionEventType motionEvent = new ProtocolMotionEventType ();
			motionEvent.DeSerialize (notification.CharacteristicValue);

			switch (motionEvent.Event)
			{
			case ProtocolMotionEvent.Tap:
				{
					OnTapDetected (this, motionEvent.TapDirection, motionEvent.TapCount, notification.Timestamp);
					break;
				}
			}
		}
Esempio n. 7
0
		private void ProcessImuDataNotification (NotificationCarrier notification)
		{
			ProtocolImuDataType imuData = new ProtocolImuDataType ();
			imuData.DeSerialize (notification.CharacteristicValue);

			OnImuDataReceived (this, imuData.OrientationW, imuData.OrientationX, imuData.OrientationY, imuData.OrientationZ,
				imuData.Accelerometer, imuData.Gyroscope, notification.Timestamp);
		}
Esempio n. 8
0
		private void ProcessEmgDataNotification (NotificationCarrier notification)
		{
			byte sensorNumber = (byte) (notification.CharacteristicUUID.ToArray ()[13] - 1);

			ProtocolEmgDataType emgData = new ProtocolEmgDataType ();
			emgData.DeSerialize (notification.CharacteristicValue);

			OnEmgDataReceived (this, emgData.EmgData.ToArray (), sensorNumber, notification.Timestamp);
		}
Esempio n. 9
0
		private void ProcessBatteryNotification (NotificationCarrier notification)
		{
			BatteryLevel level = new BatteryLevel (notification.CharacteristicValue);
			OnBatteryChange (this, level, notification.Timestamp);
		}
Esempio n. 10
0
        private void ProcessBatteryNotification(NotificationCarrier notification)
        {
            BatteryLevel level = new BatteryLevel(notification.CharacteristicValue);

            OnBatteryChange(this, level, notification.Timestamp);
        }