c 讀藍芽資料 通過藍芽接收資料到c 程式

2021-10-13 14:36:03 字數 1425 閱讀 6339

我正在使用thehand庫(32feet.net) .

我有乙個啟用藍芽的裝置,我想將裝置連線到我的計算機,然後將資料從裝置傳送到計算機 . 然後我想用我的程式捕獲這些資訊並進行處理 . 裝置將傳送3個變數(全部3個浮點數) .

我如何用藍芽捕獲這些資訊?我之前從未在電腦上使用藍芽 .

但是不知道我在做什麼,所以我不能讓它發揮作用 .

我正在使用visual studio 2017和windows 10.我聽說windows 10存在問題並對藍芽裝置進行身份驗證 .

更新:static string domaciaddress = "my_address";

static string tujadress = "device_address";

//reciever

private static bluetoothendpoint ep = new bluetoothendpoint(bluetoothaddress.parse(domaciaddress), bluetoothservice.bluetoothbase);

private static bluetoothclient bc = new bluetoothclient(ep);

//sender

private static bluetoothdeviceinfo btdevice = new bluetoothdeviceinfo(bluetoothaddress.parse(tujadress));

private static networkstream stream = null;

static void neke231(string args)

string paircode = "paircode";

if (bluetoothsecurity.pairrequest(btdevice.deviceaddress, paircode))

console.writeline("pairrequest: ok");

if (btdevice.authenticated)

console.writeline("authenticated: ok");

bc.setpin(paircode);

bc.beginconnect(btdevice.deviceaddress, bluetoothservice.serialport, new asynccallback(connect), btdevice);

else

console.writeline("authenticated: no");

else

console.writeline("pairrequest: no");

console.readline();

我現在就像這樣連線到我的藍芽 . 但是我仍然不知道如何獲得我的裝置傳送的那3個浮點數,並將它儲存在浮點數中,所以我以後可以在程式中使用它們 .

c 讀藍芽資料 C 如何接收藍芽字元資料

公司買了個藍芽吊秤,想將重量傳到系統,我在網上找了一些資料,有以下一段 裝置是之前與藍芽匹配了的,可以找到 藍芽guid也是正確的 但在接收資料時,在這句 停住了,也不報其它錯誤 bluetoothclient bluetoothlistener.acceptbluetoothclient 應該是不...

Android藍芽接收分包資料

最近在開發乙個安卓和藍芽光譜儀裝置通訊的程式,用的是傳統藍芽,下位機藍芽傳送的光譜資料比較大,分成了15個包傳送。其中14個包大小290個byte,最後1個包大於100個byte,而且一整個資料報由資料頭 資料長度 資料 資料尾這幾個部分組成,所以接受的時候做了乙個判斷,定義了乙個大容量陣列,用笨方...

c 讀藍芽資料 C 程式設計連線藍芽裝置,檔案收發

public partial class form1 form bluetoothradio radio null 藍芽介面卡 string sendfilename null 傳送檔名 bluetoothaddress sendaddress null 傳送目的位址 obexlistener li...