我正在尝试编写一个连接到蓝牙低功耗设备(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);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
// i always get this exception.
}
}
Run Code Online (Sandbox Code Playgroud) 我该如何解决这个问题:
<bean id=" productLineTokenizer" class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer">
<property name="delimiter" value="\t"/>
Run Code Online (Sandbox Code Playgroud)
引起:
java.lang.IllegalArgumentException:
String [\t] with length 2 cannot be converted to char type
Run Code Online (Sandbox Code Playgroud) 我想在我的标签上添加文字:area(m ^ 2)但是2应该是m的幂.
是否可以在.NET中执行此操作?
我如何保持我的C#表单,让我们说是一个for循环,从锁定?我是否调用Application.DoEvents(); 在循环之前或之后?从我所听到的使用DoEvents方法将保持我的应用程序锁定.