Connection.SendAndWaitForResponse sample's exists?

// Expert user has replied.
A Anderson Pinheiro 3 years 3 months ago
239 2 0

Hi!

Is there a sample of how to use the SendAndWaitForResponse or the SendAndWaitForValidResponse methods of Connection Class?
We using the Zebra.Printer.SDK 2.15.2634, for C# Xamarin.Forms;
We need to understanding how to get the response.
In my tests, in some situations (HeadOpen), always returns byte[0] and i doesn't understand how to pass the ResponseValidator to get a valid response.
I've searching into the web for samples, but found only the official documentation of zebra with no samples.
Thanks!

Please Register or Login to post a reply

2 Replies

S Steven Si

Here are the examples of using SendAndWaitForResponse with or without a validator.

// Send SGD and wait for the response until timeouts.
byte[] response = connection.SendAndWaitForResponse(GetBytes("! U1 getvar \"ezpl.label_length_max\"\r\n"), 300, 200);

// Send host status command (~HS) and wait for the response until timeouts or until NULL character.
byte[] data = connection.SendAndWaitForResponse(GetBytes("~HS"), 3000, 3000, "\0");

 

A Anderson Pinheiro

Hi SSi1 !
Thanks for your answer,
i'll try to implement it.

CONTACT
Can’t find what you’re looking for?