Example #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);
        }
Example #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);
        }
Example #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;
            }
            }
        }
Example #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;
            }
            }
        }
Example #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;
				}
			}
		}
Example #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;
				}
			}
		}
Example #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);
		}
Example #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);
		}
Example #9
0
		private void ProcessBatteryNotification (NotificationCarrier notification)
		{
			BatteryLevel level = new BatteryLevel (notification.CharacteristicValue);
			OnBatteryChange (this, level, notification.Timestamp);
		}
Example #10
0
        private void ProcessBatteryNotification(NotificationCarrier notification)
        {
            BatteryLevel level = new BatteryLevel(notification.CharacteristicValue);

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