從命令提示字元透過藍牙傳送文件

從命令提示字元透過藍牙傳送文件

我正在使用命令提示符,我想將文件發送到我的手機。是否可以從命令提示字元透過藍牙發送檔案?

答案1

是否可以從命令提示字元透過藍牙發送檔案?

對的,這是可能的。請參閱下文以了解 Windows、Ubuntu 和 Linux 解決方案。


Windows XP、Windows Vista、Windows 7、Windows 8 或 Windows 10(x86、x64)

使用布托貝克斯

藍牙命令列工具是一套適用於 Microsoft Windows 的命令列實用程序,可用於設定藍牙適配器、發現遠端藍牙裝置和服務、將檔案傳輸到支援 OBEX 的裝置。

所有實用程式都可以作為批次腳本或其他自動後台進程的一部分調用,或從 Windows 命令提示字元手動啟動。

系統需求

  • Windows XP、Windows Vista、Windows 7、Windows 8 或 Windows 10(x86、x64)
  • Microsoft 藍牙堆疊相容藍牙轉接器

來源藍牙命令列工具

Btobex 將檔案傳送至支援 OBEX 的遠端裝置(電腦、手機等)。

用法:

btobex {-bBluetoothAddress | -nFriendlyName} [-cChannel] [-pPIN [-e]] 
         [-rRetries] [-fFileName] [file1 [file2 [...]]] 

    -b  Bluetooth address of target device in (XX:XX:XX:XX:XX:XX) format.  
    -n  Friendly name of target device.
    -c  RFCOMM channel (1-30). If specified, service lookup is not performed. 
    -p  PIN code for authenticating with remote device.
    -e  Use encrypted connection (only if PIN authentication is used)
    -r  Make specified number of attempts is case of error
    -f  Use this file name for the data from STDIN (standard input)      
    -h  Prints help screen.

樣品:

  1. 將檔案「picture.jpg」從目前資料夾傳送到名為「Nokia 6300」的裝置:

    btobex -n"Nokia 6300" picture.jpg
    
  2. 將所有文字檔案從目前資料夾傳送到具有已知位址的裝置:

    btobex -b(11:11:22:22:33:33) *.txt
    
  3. 將其他程式的輸出傳送為名為「message.txt」的檔案:

    echo This is a test | btobex -b(11:11:22:22:33:33) -f"message.txt"
    

btobex 維護 ERRORLEVEL 環境變數。零表示執行成功,任何其他值表示錯誤。詳細的錯誤描述被印到標準錯誤輸出。

來源布托貝克斯


烏班圖

使用藍牙發送

bluetooth-sendto --device=12:34:56:78:9A:BC filename對我有用。

「12:34:56:78:9A:BC」是裝置的藍牙裝置位址(bdaddr)。您可以透過 取得 bdaddr hcitool scan

來源shell腳本中的藍牙檔案傳輸, 回答由埃爾米查


Linux

使用OBEXFTP

obexftp –nopath –noconn –uuid none –bluetooth <BTAddr> –channel <OPUSHChann elNo> –put <FileToPut>

  • 允許在不指定遠端設備端的 pin 的情況下傳送文件
  • 設備的 OPush 頻道號碼是從上面的 sdptool 取得的

obexftp -b <BTAddr> -v -p <FileToPut>

  • 允許將檔案放到指定的 BT 裝置上
  • obexftp 也可用於取得或列出 BT 設備上的文件
  • 還允許只需提供 -b 選項即可識別附近的 BT 設備

來源低級藍牙實用程式, 回答由永續發展管理

也可以看看用於藍牙操作的Linux腳本


免責聲明

我不隸屬於藍牙命令列工具以任何方式。

相關內容