cancel
Showing results for 
Search instead for 
Did you mean: 

PIOSException(ErrorCode:2) Attempt to start a read when one is pending - ?

Former Member
0 Kudos

I' ve created a prototype NWM 7.1 Client app that leverages PIOS framework to connect to a Motorola MC-9090 device scanner.

I'm able to retrieve the correct driver and connect, however when my code calls

<conn obj>.startRead(); method i get the exception:

PIOSException - Attempt to start a read when one is pending . It has an error code 2 assigned to it.

<r id="1294849767217" t="11:29:27" d="2011-01-12" s="P" c="000" u="USER" g="en" m="Called method: ScannerConnectionImpl::startRead">

<f n="LocationName" v=" (MI/PIOS:ScannerConnectionImpl::startRead)"/>

<f n="ThreadName" v="com.sap.tc.mobile.cfs.startup.pda.Startup"/>

</r>

<r id="1294849767232" t="11:29:27" d="2011-01-12" s="E" c="000" u="USER" g="en" m="PIOSException(ErrorCode:2) Attempt to start a read when one is pending.">

<f n="LocationName" v=" (MI/PIOS:)"/>

<f n="ThreadName" v="com.sap.tc.mobile.cfs.startup.pda.Startup"/>

</r>

<r id="1294849767237" t="11:29:27" d="2011-01-12" s="P" c="000" u="USER" g="en" m="Called method: ScannerConnectionImpl::getScannerException">

<f n="LocationName" v=" (MI/PIOS:ScannerConnectionImpl::getScannerException)"/>

<f n="ThreadName" v="com.sap.tc.mobile.cfs.startup.pda.Startup"/>

</r>

<r id="1294849767242" t="11:29:27" d="2011-01-12" s="D" c="000" u="USER" g="en" m="getScannerException">

<f n="LocationName" v=" (MI/PIOS:ScannerConnectionImpl::getScannerException)"/>

<f n="ThreadName" v="com.sap.tc.mobile.cfs.startup.pda.Startup"/>

</r>

<r id="1294849767250" t="11:29:27" d="2011-01-12" s="D" c="000" u="USER" g="en" m="getScannerException">

<f n="LocationName" v=" (MI/PIOS:ScannerConnectionImpl::getScannerException)"/>

Any Ideas? I'm using the sample code provided in SAP help.

Here's a bit of the source:

//--


(4)--


public void scanBarcode() throws Exception {

scannerConnection.startRead(); // - Exception thown here

while (!barcodeScanned)

{

Thread.sleep(500);

}

if (lastException != null) {

debug("scanBarcode() - Exception: " + lastException.getLocalizedMessage());

throw lastException;

}

//--


(5)--


private void openScanAwareConnection() throws PIOSException {

Connector connector = Connector.getInstance();

DriverInfo[] scanners = connector.listDrivers(ConnectionType.SCANNER);

setDriverDetail(driverdetail);

ScannerParameters parameters = new ScannerParameters(scanners[0]);

parameters.setMode(ScannerParameters.SCAN_AWARE);

scannerConnection = (ScannerConnection) connector.open(parameters);

}

//--


(6)--


public void activateSymbologies() throws PIOSException {

scannerConnection.addSymbology(new Code39(Code39.FULLASCII));

scannerConnection.addSymbology(new Code128());

}

Thanks,

Chiedu

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I changed the scanner parameter to Wedge mode from Scan aware and get the same results.

parameters.setMode(ScannerParameters.SCAN_AWARE);

parameters.setMode(ScannerParameters.WEDGE);

I also tried endRead() method before calling the startRead() and that doesn't work either.