printer: Fix the device path
On chameleon, the printer device created by g_printer is at
/dev/printer0. Fix the path in printer.c.
The full usage scenario:
1.. On Chameleon, emulate a printer.
Connect middle USB port on Chameleon to Cros device.
On Chameleon console:
$ modprobe g_printer idVendor=0x03f0 idProduct=0x0004 iManufacturer=Chameleon
Select idProduct from
http://www.gstatic.com/chromeos_printing/metadata_v2/usb-03f0.json
idVendor 0x03f0 is HP. Here we choose the first model with
idProduct=0x0004.
2. On Cros deivce, check the device is detected with specified properties.
$ lsusb -t, check
Bus 001 Device 009: ID 03f0:0004 Hewlett-Packard DeskJet 895c
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x03f0 Hewlett-Packard
idProduct 0x0004 DeskJet 895c
bcdDevice 4.02
iManufacturer 1 Chameleon
iProduct 2 Printer Gadget
3. On Cros device, install this printer.
chrome://settings -> Advanced -> Printering -> Add printer ->
-> Add manually -> Add nearby printers -> Select
"Chameleon Printer Gadget (USB) Printer Gadget.
4. Download a PDF sample file:
http://che.org.il/wp-content/uploads/2016/12/pdf-sample.pdf
5. On Chameleon, read in data from Cros device to /tmp/read1.bin
$ printer -read_data > /tmp/read1.bin
6. On Cros device: print the PDF file
Ctrl + P -> Select destination to be Chameleon Printer Gadget -> Print.
The printing job should be finished in 1~2 seconds. There will be successful messages
pop out.
7. On Chameleon, stop printer process in 5. Get /tmp/read1.bin
8. Repeat 5 and 6 and 7, the recorded binary should be the same.
root@socfpga:~# md5sum /tmp/read1.bin
a5ceb7aba2283143b29387e9a7a799ed /tmp/read1.bin
root@socfpga:~# md5sum /tmp/read2.bin
a5ceb7aba2283143b29387e9a7a799ed /tmp/read2.bin
BUG=chromium:787414
TEST=Follow the test scenario as above.
Change-Id: I42b45384597eaa7088cbe8a10da9f4386b8c99ec
Reviewed-on: https://chromium-review.googlesource.com/787515
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Sean Kau <skau@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
1 file changed