summaryrefslogtreecommitdiff
path: root/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension
diff options
context:
space:
mode:
authorBarry Golden <[email protected]>2019-03-12 14:02:43 -0700
committerAdonais Romero González <[email protected]>2019-03-12 14:02:43 -0700
commitef7ec4ec9ff7ce3c53d60e1c8906915966e17e01 (patch)
tree3017523a73c6552c27947d402afa6062f4df2706 /print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension
parent35bff356ac249057f4d673d39c7f28ed348cbf0f (diff)
Update README.md for samples portal (#358)
* Update README.md for samples portal * Update README.md for samples portal * Removed installwdf * Update fork (#2) * Fix typo ture -> true * Remove InstallWdf sample * Fix typo (#340) ture -> true * Readme typo fix (#349) * Update langid
Diffstat (limited to 'print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension')
-rw-r--r--print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md29
-rw-r--r--print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/print-v4printdriversamples-v4printdriver-usbmon-bidi-extension.yml13
2 files changed, 21 insertions, 21 deletions
diff --git a/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md b/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md
index cebf8145..fc4ab7ba 100644
--- a/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md
+++ b/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/README.md
@@ -1,3 +1,14 @@
+---
+topic: sample
+name: Print Driver USB Monitor and Bidi Sample
+description: Demonstrates how to support bidirectional (Bidi) communication over the USB bus using JavaScript and XML.
+languages:
+ - javascript
+ - xml
+products:
+ - windows
+---
+
<!---
name: Print Driver USB Monitor and Bidi Sample
platform: Utility
@@ -7,16 +18,19 @@
samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=617948
--->
-
-Print Driver USB Monitor and Bidi Sample
-========================================
+# Print Driver USB Monitor and Bidi Sample
This sample demonstrates how to support bidirectional (Bidi) communication over the USB bus, using JavaScript and XML. This sample supports bidirectional status while not printing, and unsolicited status from the printer while printing.
The following files are included in the sample:
-- USBMON\_Bidi\_JavaScript\_File.js. This JavaScript file demonstrates the implementation of a Bidi support for USBMon with a v4 print driver. The JavaScript file supports three functions: getSchemas() is used to make Bidi GET queries to a device, setSchema() is used to make a single Bidi SET query to the device, and getStatus() is called repeatedly during printing in order to retrieve unsolicited status from the printer using the data from the read channel of the device.
-- USBMON\_Bidi\_XML\_File.xml. This XML file demonstrates how to build a Bidi Schema extension for USB. It describes the supported schema elements that can be queried or set, along with their restrictions.
+**USBMON\_Bidi\_JavaScript\_File.js**
+
+- This JavaScript file demonstrates the implementation of a Bidi support for USBMon with a v4 print driver. The JavaScript file supports three functions: getSchemas() is used to make Bidi GET queries to a device, setSchema() is used to make a single Bidi SET query to the device, and getStatus() is called repeatedly during printing in order to retrieve unsolicited status from the printer using the data from the read channel of the device.
+
+**USBMON\_Bidi\_XML\_File.xml**
+
+- This XML file demonstrates how to build a Bidi Schema extension for USB. It describes the supported schema elements that can be queried or set, along with their restrictions.
For more information, see [USB Bidi Extender](http://msdn.microsoft.com/en-us/library/windows/hardware/jj659903(v=vs.85).aspx).
@@ -24,7 +38,7 @@ For more information, see [USB Bidi Extender](http://msdn.microsoft.com/en-us/li
**Note** When you make calls to printerStream.read() in the sample, the printer returns an array which includes an additional element that represents the array length. The following JavaScript code can be used to copy the returned array into a new array, and also to remove the additional element.
-```
+```js
var readBuffer = [];
var readBytes = 0;
var readSize = 4096;
@@ -33,9 +47,8 @@ readBuffer = printerStream.read( readSize );
readBytes = readBuffer.length;
var cleanArray = [];
-
+
for ( i = 0; i < readBytes; i++ ) {
cleanArray[i] = readBuffer.shift();
}
```
-
diff --git a/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/print-v4printdriversamples-v4printdriver-usbmon-bidi-extension.yml b/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/print-v4printdriversamples-v4printdriver-usbmon-bidi-extension.yml
deleted file mode 100644
index 3cbf769c..00000000
--- a/print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/print-v4printdriversamples-v4printdriver-usbmon-bidi-extension.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-### YamlMime:Sample
-sample:
-- name: Print Driver USB Monitor and Bidi Sample
- description: Demonstrates how to support bidirectional (Bidi) communication over the USB bus using JavaScript and XML.
- generateZip: true
- preserveParentHierarchy: true
- author: windows-driver-samples
- languages:
- - javascript
- - xml
- technologies:
- - windows
- vssolution: /print/v4PrintDriverSamples/v4PrintDriver-USBMon-Bidi-Extension/USBMon-Bidi-Extension.sln