Esempio n. 1
0
            public void ObexPush()
            {
                BluetoothEndPoint ep = new BluetoothEndPoint(
                    new BluetoothAddress(TestBluetoothAddress.Ctor.SixLengthBytes),
                    BluetoothService.ObexObjectPush);
                String       result   = ep.ToString();
                const String expected = TestBluetoothAddress.Ctor.SixLengthString + ":"
                                        + GuidOppAsString;

                Assert.AreEqual(expected, result);
            }
Esempio n. 2
0
            public void SerialPort()
            {
                BluetoothEndPoint ep = new BluetoothEndPoint(
                    new BluetoothAddress(TestBluetoothAddress.Ctor.SixLengthBytes),
                    BluetoothService.SerialPort);
                String       result   = ep.ToString();
                const String expected = TestBluetoothAddress.Ctor.SixLengthString + ":"
                                        + GuidSerialPortAsString;

                Assert.AreEqual(expected, result);
            }
Esempio n. 3
0
            public void EmptyWithZeroPort()
            {
                BluetoothEndPoint ep = new BluetoothEndPoint(
                    new BluetoothAddress(TestBluetoothAddress.Ctor.SixLengthBytes),
                    BluetoothService.Empty,
                    0);
                String       result   = ep.ToString();
                const String expected = TestBluetoothAddress.Ctor.SixLengthString + ":"
                                        + "0";

                Assert.AreEqual(expected, result);
            }
Esempio n. 4
0
        private void SetupListener(BluetoothEndPoint bep, out BluetoothEndPoint liveLocalEP)
        {
            if (bep == null)
            {
                throw new ArgumentNullException("bep");
            }
            int requestedScn;

            if ((bep.Port == 0 || bep.Port == -1))
            {
                // Let the stack choose one
                requestedScn = 0;
            }
            else
            {
                // Requesting a specific port, check it's valid.
                VerifyPortIsInRange(bep);
                requestedScn = bep.Port;
            }
            //
            SetupListener(bep, requestedScn, out liveLocalEP);
            Debug.Assert(liveLocalEP != null, "null: out liveLocalEP!!!");
            Debug.WriteLine("Listening on " + liveLocalEP.ToString());
        }