public void PhoneConnection()
        {
            BTListener = new BluetoothListener(guid);
            BTListener.Start();
            client = BTListener.AcceptBluetoothClient();

            connected = true;
            Stream mStream = client.GetStream();

            startTime = mts.GetTime();
            updateConnection();
            while (connected)
            {
                ReceivingData(mStream);
            }
        }
        public void setup()
        {
            int enabledSensors = ((int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_GSR) | (int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_A_ACCEL | (int)ShimmerBluetooth.SensorBitmapShimmer3.SENSOR_INT_A13;

            //devName,bluetoothAddress, samplingRate, accelRange, gsrRange, setEnabledSensors, enableLowPowerAccel, enableLowPowerGyro, enableLowPowerMag, gyroRange, magRange, exg1configuration, exg2configuration, internalexppower
            shimmer             = new ShimmerLogAndStream32Feet("ShimmerID1", address, 10, 0, ShimmerBluetooth.GSR_RANGE_AUTO, enabledSensors, true, false, false, 1, 0, Shimmer3Configuration.EXG_EMG_CONFIGURATION_CHIP1, Shimmer3Configuration.EXG_EMG_CONFIGURATION_CHIP2, true);
            shimmer.UICallback += this.HandleEvent;
            shimmer.Connect();
            FirstTime = true;
            if (shimmer.GetState() == ShimmerBluetooth.SHIMMER_STATE_CONNECTED)
            {
                shimmer.WriteSensors(enabledSensors);
                updateMessage("Shimmer device is connected");
                updateBtn();
                shimmer.StartStreaming();
                startTime = mts.GetTime();
            }
        }