自己写android代码,能找到其他蓝牙设备但是找不到cc2541蓝牙模块,新手求大神指导
BluetoothAdapter badapter = BluetoothAdapter.getDefaultAdapter();
if(badapter != null ){
System.out.println("本机拥有蓝牙设备");
if(badapter.isEnabled()){
Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivity(intent);
}
Set<BluetoothDevice> devise =badapter.getBondedDevices();
if(devise.size()>0){
for (Iterator iterator =devise.iterator();iterator.hasNext();){
BluetoothDevice bluetoothDevice = (BluetoothDevice) iterator.next();
System.out.println(bluetoothDevice.getName());
System.out.println(bluetoothDevice.getAddress());
}
}
}
else{
System.out.println("没有蓝牙设备");
}
///////////////////////////////////////////////////////
02-26 13:27:54.414 18241-18241/com.example.zj.z I/System.out﹕ 本机拥有蓝牙设备
02-26 13:27:54.444 18241-18241/com.example.zj.z I/System.out﹕ SCH-i929
02-26 13:27:54.444 18241-18241/com.example.zj.z I/System.out﹕ 04:FE:31:64:5C:DF
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ V9180
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ 98:6C:F5:B7:32:C1
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ GT-I9103
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ 6C:83:36:FE:D5:41
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ GT-S5820
02-26 13:27:54.454 18241-18241/com.example.zj.z I/System.out﹕ BC:B1:F3:E1:3C:C6
02-26 13:27:54.464 18241-18241/com.example.zj.z I/System.out﹕ HUAWEI NXT-AL10
02-26 13:27:54.464 18241-18241/com.example.zj.z I/System.out﹕ 48:DB:50:2A:64:3C
02-26 13:31:52.364 18241-18247/com.example.zj.z D/dalvikvm﹕ GC_FOR_ALLOC freed 494K, 47% free 5086K/9468K, paused 167ms, total 191ms
////
但是用网上的程序能搜到:CC41-A
00:15:83:00:61:6E