locked
Several questions about BiDi usage for USB devices

    Question

  • Hello,

    I'm developing Print Extention App which should interact with USB device by means BiDi Queries in Win8.

    And I have several questions about BiDi usage:

    1. Is it possible to customize BiDi query?

    For example can I set some parameters into Queue Property bag from App and then retreive and use them in BiDi extention JavaScript?

    2. In my case response on BiDi query is big portion of binaries data. How to transfer big portion of binary data from BiDi to Print Extention Application?

    Are there any limitation on size of data of BIDI_TEXT and BIDI_STRING types?

    3. Is it possible to set up timeouts on BiDi Read/Write operations?

    Thanks!

    Thursday, April 5, 2012 2:37 PM

All replies

  • Hi,

    Did you project based on metro style app or general application.

    On the other hand, you can check this document to find if the function can be used in metro style app.
    http://msdn.microsoft.com/en-us/library/windows/desktop/hh464945.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 6, 2012 6:26 AM
  • Hi d0nsergio,

    I think you're coming at the problem in the wrong way. A few observations and questions:

    - You should never need to get binary data from your bidi extension. The point of a Bidi is to isolate your app from knowing the protocol level details about your device. You should use your Bidi extension JS file to parse the data into a data model. For example, say you want to know your consumable status. Your app simply needs to query \Printer.Consumables.

    Over USB, that data may come back as a binary blob, but you should parse it out into the set of colors and the percentage values for the consumables.

    Over WSD, that's a SOAP message, but we automatically put that into the Bidi Schema.

    Over TCP, we'd query an OID and put those values into the Bidi schema for you.

    - What kind of parameters are you talking about? Bidi GET operations can support a limited amount of variable data (eg \Printer.Consumables.[InkName] or \Printer.Configuration.[InputBin]). We do not support a sideband communication channel between apps and Bidi JS.

    - What's the scenario for a timeout?

    Thanks

    Justin [MSFT]

    Friday, April 6, 2012 6:27 PM
  • Hello Justin,

    Thank you for your answer.

    1. Actually I need to get some binary data (ex. image in jpg format) from printer device via USB. As I understand  there is the only one legacy way to exectute custom USB queries in Metro App - it is Bidi. It is possible to send special USB query to printer device (via Bidi) and get binary data on Bidi side. But is there a way to transfer binary data from Bidi to Application?

    2. Scenarios for timeouts can be the following:

    • Due to printer device features, two USB queries need for getting some data: first query is for getting data size and second one is for getting actual data. And some pause are required between two queries.
    • Also it is possible that device will take some time for query processing (slow device)and I need to set up timeout certain value for query of such types. By the way, what is default timeout value for USB query processing.

    Thanks!

    Monday, April 9, 2012 2:37 PM
  • D0nsergio,

    Thanks for describing the scenario. We have some changes that will be available in the next public release that address your concerns. We will have updated documentation and samples for your scenario.

    Thanks!

    Justin

    Friday, April 13, 2012 6:26 PM