private void button2_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
if (BluetoothClient.RadioMode == RadioMode.PowerOff) {
BluetoothClient.RadioMode = RadioMode.Connectable;
}
try
{
devices = client.DiscoverDevices();
Cursor.Current = Cursors.Default;
this.listBox1.Items.Clear();
if (devices != null && devices.Length > 0)
{
for (int i = 0; i < devices.Length; i++)
{
if (devices[i].DeviceName != null)
{
this.listBox1.Items.Add(devices[i].DeviceName);
}
}
}
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
//连接
private void button3_Click(object sender, EventArgs e)
{
try
{
Cursor.Current = Cursors.WaitCursor;
////测试插入
//byte[] addressByte = new byte[6];
//addressByte[0] = 0x21;
//addressByte[1] = 0x52;
//addressByte[2] = 0x65;
//addressByte[3] = 0x62;
//addressByte[4] = 0x00;
//addressByte[5] = 0x00;
//this.address = new BluetoothAddress(addressByte);
////测试插入
this.EpGps = new BluetoothEndPoint(this.address, BluetoothService.SerialPort, 8);
this.client.Connect(this.EpGps);
Cursor.Current = Cursors.Default;
}
catch (System.Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
分享到:
相关推荐
在wince6.0系统里搜索蓝牙并链接 可以将打印信息发送到蓝牙设备上进行打印
WINCE 蓝牙 NCF_BlueTooth WINCE 蓝牙 NCF_BlueTooth
wince5.0模拟器连接蓝牙详细教程 因为刚刚接触wince模拟器,像俺这种菜鸟级别的人根本弄不懂!各大论坛上也搜遍了,没有一个关于wince模拟器连接蓝牙的教程!又自行研究了N天N夜后,未果,决定放弃!郁闷到了极点!在...
wince 通过蓝牙 连接外设(包含搜索、配对、连接等操作)
本文提供了一个类 用于在wince平台使用 便于开发蓝牙 包含 搜索蓝牙设备 建立蓝牙连接 建立蓝牙虚拟串口 等 拿了直接可以使用 基于 mfc 开发
wince 蓝牙开发的demo,里面包括查找蓝牙列表,连接,通信
WinCE下的蓝牙打印应用程序源代码,另附红外连接打印源代码。
C#开发的wince蓝牙打印程序
WinCE中蓝牙协议栈的架构图 WINCE5.O对USB蓝牙适配器服务的支持
WinCE平台下蓝牙开发的代码实例,需要的同志可以下载下来看看
wince5.0 下用C#写的蓝牙打印测试程序。程序使用MC3000手持和Zebra MZ220便携式打印机测试通过。 程序是建立serialport对象,指定com口连接打印机,界面上open打开蓝牙端口,close关闭蓝牙端口 打印时向蓝牙端口发送...
wince5.0 下用C#写的蓝牙打印测试程序。程序使用MC3000手持和Zebra MZ220便携式打印机测试通过。 程序是建立serialport对象,指定com口连接打印机,界面上open打开蓝牙端口,close关闭蓝牙端口 打印时向蓝牙端口发送...
C# wince 蓝牙控制、搜索设备、文件发送
WinCE上的串口蓝牙驱动,和CE上的蓝牙Socket代码,PC上的蓝牙控制代码,关于蓝牙驱动的使用请参考我的博客。
wince系统下调用wifi连接,在wince5和wince6下均测试过,wince6下通过SID连接有点小问题,通过mac连接可以通过。
wince设备上查找蓝牙设备的一般方法及思路,希望对初学者有所帮助。
关于在wince操作系统中的扫描识别,应用扫描算法。识别文字
蓝牙 通信 程序 利用两个蓝牙,就可以实现PC之间的无联网通信,但是蓝牙的距离是受限制的,10米以内。
一款WinCE手机蓝牙软件 源代码.zip