public override void OnConnectionStateChange(BluetoothGatt gatt, GattStatus status, ProfileState newState)
            {
                string intentAction;

                if (newState == ProfileState.Connected)
                {
                    intentAction = ACTION_GATT_CONNECTED;
                    Service.SetmConnectionState(STATE_CONNECTED);
                    Service.BroadcastUpdate(intentAction);
                    System.Console.WriteLine(TAG, "Connected to GATT server.");
                    // Attempts to discover services after successful connection.
                    System.Console.WriteLine(TAG, "Attempting to start service discovery:" + Service.Gatt.DiscoverServices());
                }
                else if (newState == ProfileState.Disconnected)
                {
                    intentAction = ACTION_GATT_DISCONNECTED;
                    Service.SetmConnectionState(STATE_DISCONNECTED);
                    System.Console.WriteLine(TAG, "Disconnected from GATT server.");
                    Service.BroadcastUpdate(intentAction);
                }
            }