Datalogic .NET SDK

PostRequestWait (Method)

 

Syntax

 

    public int PostRequestWait(DecodeRequest reqType);

 

 

Class                           : DecodeHandle

Namespace                : Datalogic.API

Assembly                   : Datalogic.API.DLL

 

 

Description

Posts a request for data from a decoding device. The method will block the calling thread and not return until the request is fulfilled.

 

Parameters Table

 

Type

Parameter

Description

[in]

DecodeRequest

 

Type of request being posted.

It is a logical OR of any of the values.

 

 

 

 

[return]

int

 

On success, a request ID is returned. This should be used in a subsequent call to Datalogic.API.DecodeHandle.ReadString.

[on error]

-1

 

-

 

 

 

Example

 

 

reqID = hDcd.PostRequestWait((DecodeRequest)1);

 

 if (reqID != -1)

 {

       // Obtain the string, code id and code id modifier.

       try

       {

             /* Example #9: DecodeHandle.ReadString (overload 1)

                            DecodeHandle.GetAimIdentifier()

                            DecodeHandle.GetCodeId()    */

             cID = hDcd.GetCodeId(reqID);

             strAimIdentifier = hDcd.GetAimIdentifier(reqID);

             modChar += strAimIdentifier[strAimIdentifier.Length - 1];

             codeIDMod = Convert.ToInt32(modChar, 16);

             dcdData = hDcd.ReadString(reqID);

       }

       catch (Exception)

       {

              MessageBox.Show("Error reading string!");

              return;

       }

}

 

 

See Also

ReadString(1), GetAimIdentifier, Example #009.

 

Copyright © Datalogic ADC. All Right Reserved