小编exa*_*ert的帖子

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);
     }
     catch (Exception ex)
     {                        
          MessageBox.Show(ex.Message);
          // i always get this exception.
     }
}
Run Code Online (Sandbox Code Playgroud)

.net c# bluetooth-lowenergy 32feet

7
推荐指数
1
解决办法
4972
查看次数

DelimitedLineTokenizer制表符

我该如何解决这个问题:

<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)

java tabs

5
推荐指数
1
解决办法
2321
查看次数

在Windows应用程序中格式化标签内的文本

我想在我的标签上添加文字:area(m ^ 2)但是2应该是m的幂.

是否可以在.NET中执行此操作?

.net wpf winforms

5
推荐指数
1
解决办法
807
查看次数

Application.DoEvents();

我如何保持我的C#表单,让我们说是一个for循环,从锁定?我是否调用Application.DoEvents(); 在循环之前或之后?从我所听到的使用DoEvents方法将保持我的应用程序锁定.

c# multithreading

4
推荐指数
1
解决办法
2341
查看次数

标签 统计

.net ×2

c# ×2

32feet ×1

bluetooth-lowenergy ×1

java ×1

multithreading ×1

tabs ×1

winforms ×1

wpf ×1