0

Motorola MC32N0에서 새로 구매 한 Zebra ZQ 510 모바일 프린터와 블루투스를 통해 연결하는 데 문제가 있습니다 (InTheHand.Net.Personal 참조). DLL) :Motorola MC32NO (Windows Embedded Compact 7.0)와 호환되는 Zebra ZQ 510 모바일 프린터

using InTheHand.Net; 
using InTheHand.Net.Bluetooth; 
using InTheHand.Net.Sockets; 
using InTheHand.Net.Ports; 

BluetoothAddress mac = BluetoothAddress.Parse("B0B44879581D"); 
BluetoothEndPoint btEndPoint = new BluetoothEndPoint(mac, BluetoothService.SerialPort); 
BluetoothClient bluetoothClient = new BluetoothClient(); 
bluetoothClient.Connect(btEndPoint); 

내 해결 방법은 BTUI 응용 프로그램을 사용하여 직렬 포트 (COM5 또는 COM9) 중 하나를 할당 프린터를 수동으로 페어링 BluetoothSecurity.PairRequest() 함수를 사용하지만,하는 것입니다. 그런 다음 (얼룩말 링크 OS SDK (ZSDK_API.dll) 참조) 코드를 다음 사용

using ZSDK_API.Comm; 
// Instantiate connection for ZPL Serial port on COM5. 
ZebraPrinterConnection thePrinterConn = new SerialPrinterConnection("COM5"); 
// Open the connection - physical connection is established here. 
thePrinterConn.Open(); 

인쇄에 연결 할 수 있습니다.

질문 할 질문이 두 개 있습니다. 1. Smart Bluetooth가 장착 된 Zebra ZQ 510 모바일 프린터가 Motorola MC32NO (Windows Embedded Compact 7.0에서 실행 가능)와 호환 가능합니까? 2. Windows CE에서 프로그래밍 방식으로 가상 COM 포트를 만드는 방법이 있습니까?

답변

0

마지막으로 해결책을 찾아보십시오. Motorola EMDK for .NET v2.9을 다운로드했으며 Symbol.WPAN.dll을 참조했습니다. 다음 코드를 사용하여 Zebra ZQ510 프린터에 연결하여 예상대로 레이블을 인쇄합니다. BTInterface.dll을 EMDK에서 프로그램 폴더로 복사하는 것을 잊지 마십시오.

 using Symbol.WPAN.Bluetooth; 
     Bluetooth m_Bluetooth = new Bluetooth(); 
     m_Bluetooth.Enable(); 
     RemoteDevice rd = new RemoteDevice("", currentBTPrinterMacAdd, ""); 
     rd.LocalComPort = LocalComPortForZebraPrinterZQ510; 
     m_Bluetooth.RemoteDevices.Add(rd); 

     if (!rd.IsPaired) 
      rd.Pair(); 

     rd.OpenPort(); 
     rd.Write(Encoding.Default.GetBytes(template)); 

     rd.ClosePort(); 
     rd.UnPair(); 

     m_Bluetooth.Disable(); 
     m_Bluetooth.Dispose();