예제 #1
0
        /// <summary>
        /// 连接
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public bool Connect(string address)
        {
            if (!isopen)
            {
                return(false);
            }
            BluetoothDevice device = bluetoothAdapter.GetRemoteDevice(address);

            chatService.Connect(device);
            return(true);
        }
        /// <summary>
        /// 连接
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public int Connect(string address)
        {
            int err = 0;

            if (!isopen)
            {
                err = (int)PrintError.OpenFailure;
                return(err);
            }
            this.address = address;
            BluetoothDevice device = bluetoothAdapter.GetRemoteDevice(address);

            chatService.Connect(device);
            err = 1;
            return(err);
        }