The question is similar to question in this thread Windows IoT - Zebra Bluetooth Printer .
I have a Zebra GX420d printer. The only difference is, it is not connected via Bluetooth but via USB. I can't seem to get it paired with my raspberry pi 2. I need to print something out (like "Hello world"). Please help.
Update: So, i installed the usb driver for the printer, now the Raspberry can see it, but i still can't write anything to the printer. Now i get the "Attempted to read or write protected memory" Exception. My code:
private async void getObject()
{
var devices = await DeviceInformation.FindAllAsync();
UInt32 vid = 0x0A5F;
UInt32 pid = 0x0084;
//Guid winusbInterfaceGuid = new Guid("532C0D5D-1122-4378-96D3-1BCDF8FB31A2");
string aqs = UsbDevice.GetDeviceSelector(vid, pid);
var myDevices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(aqs, null);
if (myDevices.Count == 0)
{
return;
}
String str = "ABCDEFGH";
IBuffer buffUTF8 = CryptographicBuffer.ConvertStringToBinary(str, BinaryStringEncoding.Utf8);
UsbDevice device = await UsbDevice.FromIdAsync(myDevices[0].Id);
var send = await device.SendControlOutTransferAsync(new UsbSetupPacket(buffUTF8));
You likely need to also allow the USB capability. Here's how:
Details here: https://msdn.microsoft.com/en-us/library/windows/apps/dn263092.aspx and here: https://msdn.microsoft.com/en-us/library/windows/hardware/dn303351(v=vs.85).aspx