문제

I'm developing an application in C# in Visual Studio 2008 with the EMDK v2.3 to read tags with a RFID reader integrated in the HandHeld MC9090G with Windows Mobile 6.1. I've read the documentation to perform this task, but when I run the code it's throwing exceptions that I couldn't find the cause. I'm using the Symbol.RFID3 assembly.

When I use

1) Throws the exception: "OperationFailureException"

string hostname = "localhost";//localhost because the RFID reader is included in the HandHeld
RFIDReader rfid3 = new RFIDReader(hostname, 0, 0);
rfid3.Connect(); // line that throws the Exception

2) Throws the exception: "InvalidUsageException"

string hostname = "localhost";//localhost because the RFID reader is included in the HandHeld
RFIDReader rfid3 = new RFIDReader(hostname, 5084, 10);
rfid3.Connect(); //line that throws the Exception"

Any ideas regarding the cause?

도움이 되었습니까?

해결책

The first one is wrong as you are not connecting to port 0. Use the second one. I suggest trying 127.0.0.1 instead of localhost. You should also double check that the port that the RFID component is listening on is indeed 5084. You are currently specifiying too shot of a timeout. Try 10000 milliseconds, not 10. Finally, the RFID component needs to be running.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top