コード例 #1
0
        //----
        private BluetoothDeviceInfo Create2_FromInquiry_NotConnected()
        {
            BluetoothDeviceInfo bdi = new BluetoothDeviceInfo(WidcommBluetoothDeviceInfo.CreateFromHandleDeviceResponded(
                                                                  WidcommUtils.FromBluetoothAddress(Addr2), name2Bytes, devClass2Bytes, false, m_factory));

            return(bdi);
        }
コード例 #2
0
        //----
        private BluetoothDeviceInfo Create1_FromInquiry_Connected()
        {
            BluetoothDeviceInfo bdi = new BluetoothDeviceInfo(WidcommBluetoothDeviceInfo.CreateFromHandleDeviceResponded(
                                                                  WidcommUtils.FromBluetoothAddress(Addr1), name1Bytes, devClass1Bytes, true, m_factory));

            return(bdi);
        }
コード例 #3
0
ファイル: WidcommUtilsTest.cs プロジェクト: jehy/32feet.NET
        public void ToBluetoothAddress()
        {
            byte[]           bdaddr = new byte[] { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 };
            BluetoothAddress addr   = WidcommUtils.ToBluetoothAddress(bdaddr);

            Assert.AreEqual(BluetoothAddress.Parse("00:11:22:33:44:55"), addr, "1");
            bdaddr = new byte[] { 0x0F, 0x1E, 0x2D, 0x3C, 0x4B, 0x5A };
            addr   = WidcommUtils.ToBluetoothAddress(bdaddr);
            Assert.AreEqual(BluetoothAddress.Parse("0F:1E:2D:3C:4B:5A"), addr, "2");
        }
コード例 #4
0
ファイル: WidcommUtilsTest.cs プロジェクト: jehy/32feet.NET
        public void FromBluetoothAddress()
        {
            BluetoothAddress addr = BluetoothAddress.Parse("00:11:22:33:44:55");

            byte[] bdaddr = WidcommUtils.FromBluetoothAddress(addr);
            Assert.AreEqual(new byte[] { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }, bdaddr, "1");
            addr   = BluetoothAddress.Parse("0F:1E:2D:3C:4B:5A");
            bdaddr = WidcommUtils.FromBluetoothAddress(addr);
            Assert.AreEqual(new byte[] { 0x0F, 0x1E, 0x2D, 0x3C, 0x4B, 0x5A }, bdaddr, "2");
        }
コード例 #5
0
        private REM_DEV_INFO CreateREM_DEV_INFO(string name, BluetoothAddress addr)
        {
            var dev = new REM_DEV_INFO();

            if (name != null)
            {
                dev.bd_name = Encoding.UTF8.GetBytes(name + "\0");
            }
            if (addr != null)
            {
                dev.bda = WidcommUtils.FromBluetoothAddress(addr);
            }
            return(dev);
        }