Tag: 32feet

C#建立从笔记本电脑内部蓝牙4.0到蓝牙低功耗(BLE)外设的流

我正在尝试编写一个连接到蓝牙低功耗设备(BLE)的程序,然后在更新或给定间隔内读取特征。 我的外设是德州仪器CC2540 BLE设备。 我的出发点是查看TI的示例程序,它有一个心率监视器: http : //processors.wiki.ti.com/index.php/Category : HealthDemo 然而,这使用加密狗,我的任务是使用内部蓝牙4.0调制解调器(稍后将在Android上制作它,但是现在,我只使用Windows)。 现在我的问题是加密狗创建了一个COM端口,但内部调制解调器没有。 我仍然设法使用32feet API扫描并成功找到CC2540。 但是,从这里我不知道该怎么办。 我试过调用connect()方法,但它总是无法连接,无论是超时还是声明存在死网络。 任何想法为什么会这样? 我应该做些什么而不是调用我的device.connect()? 代码段: BluetoothClient cli; BluetoothDeviceInfo[] peers; BluetoothDeviceInfo device; BluetoothAddress adr; //… skipping code that finds the device and assigns the address to it. if (device.InstalledServices.Length != 0) { try { //MessageBox.Show(“attempting to connect”); cli.Connect(device.DeviceAddress, device.InstalledServices[2]); //tbDeviceInfo.AppendText(“\n\nConnected ” + device.Connected); […]

从C#中的蓝牙设备获取数据

我正在尝试从医疗BT设备获取数据,我已经配对了代码和通信协议。 寻找一些代码,我有这个代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using InTheHand.Net.Sockets; using InTheHand.Net; using InTheHand.Net.Bluetooth; using InTheHand.Windows.Forms; using System.Net.Sockets; using System.Diagnostics; using System.Threading; namespace dConsoleApp { static class Program { // My BT USB adapter private static BluetoothEndPoint EP = new BluetoothEndPoint(BluetoothAddress.Parse(“00:02:72:CD:9A:33”), BluetoothService.BluetoothBase); private static BluetoothClient BC = new BluetoothClient(EP); // The BT device […]

Windows 10上使用32feet.NET的蓝牙配对(SSP)

我刚刚开始了一个项目,要求我将Windows 10平板电脑与另一个蓝牙设备配对。 我决定从一个简单的Windows窗体应用程序开始,以熟悉这个过程。 我在我的解决方案中添加了32feet.NET NuGet包,并且很快就成功搜索了设备并填充了列表框。 client = new BluetoothClient(); devices = client.DiscoverDevices(); if (devices.Length > 0) { foreach (var device in devices) { lstBTDevices.Items.Add(device.DeviceName); } } else { MessageBox.Show(“Unable to detect any bluetooth devices”); } 然后我添加了一个事件处理程序,以便我可以选择一个检测到的设备并尝试与它配对。 private void LstBTDevices_SelectedIndexChanged(object sender, EventArgs e) { BluetoothDeviceInfo selectedDevice = devices[lstBTDevices.SelectedIndex]; if (MessageBox.Show(String.Format(“Would you like to attempt to pair […]