我有一臺打印機RW420和Zsdk'm使用打印出來,因爲我通過斑馬線的設置實用程序的詳細配置引腳,當我嘗試打開穿過運行MAC地址與它的連接軟件的Android 4.0它打開屏幕,詢問腳兩次,不能在logcat中返回bluez.Error.AlreadyExists日食的連接,然後第二個錯誤connectionAttemptFailed(主機關閉)。任何人都設法使用這臺打印機和Android執行打印?有什麼不同嗎?使用Zsdk或類爲android的本地通信?斑馬rw420錯誤的Android藍牙的Xperiaü
我測試的代碼是這樣的:
MacAdd String = "00037A67EF08";
BluetoothPrinterConnection myConn = new BluetoothPrinterConnection (macAdd);
PrinterCommandImpl cmdGetFirmware PrinterCommandImpl = new ("! U1 getvar \" appl.name \ "\ r \ n");
try {
// Open connection to printer. This requires que
// The devices already be paired.
myConn.open();
// Send command to printer and wait for 8000 ms response
byte [] response = cmdGetFirmware.sendAndWaitForResponse (myConn, 8000, 200);
// Display the responses in a TextView
// Status.setText (new String (response));
String s = new String (response);
// Close connection
myConn.close();
} Catch (Exception ex) {
// Catch error here
}
什麼可以幫助的,因爲我對這個問題的一個星期,無法脫身的地方!也許是一個實際工作的代碼示例。
謝謝