FX9600 Secure Mode and C Host SDK for Win

M Mogens Beltoft 2 months 1 week ago
34 1 0

I have problems connecting to an FX9600 RFID reader configured to Secure Mode.

I can connect using RFID_Login() but RFID_Connect fails.

Code for RFID_Login:

printf("RFID_Login 1 to %s %s:%s unsecure\n", loginInfo.hostName, loginInfo.userName, loginInfo.password);
RFID_STATUS status = RFID_Login(&pAdminHandle, &loginInfo, FX, FALSE, NULL);
if (status != RFID_API_SUCCESS) {
   printf("RFID_Login 2 to %s %s:%s secure\n", loginInfo.hostName, loginInfo.userName, loginInfo.password);
   status = RFID_Login(&pAdminHandle, &loginInfo, FX, TRUE, NULL);
   if (status != RFID_API_SUCCESS) {
       printf("RFID_Login failure: %s\n", RFID_GetErrorDescription(status));
   }
   else {
       printf("RFID_Login 2 success\n");
   }
}
else {
   printf("RFID_Login 1 success\n");
}

Code for RFID_Connect:

printf("RFID_Connect to %s:%d\n", readerIP_.c_str(), readerPort_);
res = RFID_Connect(&readerHandle_, const_cast<char *>(readerIP_.c_str()), readerPort_, 10000, &connectionInfo);
if (res == RFID_API_SUCCESS) {
   printf("RFID_Connect success\n");
} else {
   printf("RFID_Connect failure: %s\n", RFID_GetErrorDescription(res));
}

Output connecting to port 5084:

RFID_Login 1 to 10.93.30.25 admin:xxx unsecure
RFID_Login 2 to 10.93.30.25 admin:xxx secure
RFID_Login 2 success
RFID_Connect to 10.93.30.25:5084
RFID_Connect failure: Unable to open connection to reader

Output connecting to port 4085:

RFID_Login 1 to 10.93.30.25 admin:Default1! unsecure
RFID_Login 2 to 10.93.30.25 admin:Default1! secure
RFID_Login 2 success
RFID_Connect to 10.93.30.25:5085
RFID_Connect failure: Command Timeout

To me it was unexpected that a login can be made to a secure mode reader without setting the secure mode flag, but I can login, but I can't connect.

Please register or login to post a reply

1 Replies

M Mogens Beltoft

I have also tried adding the SEC_CONNECTION_INFO struct to CONNECTION_INFO:

CONNECTION_INFO connectionInfo;
connectionInfo.version = RFID_API3_5_1;
connectionInfo.lpSecConInfo = new SEC_CONNECTION_INFO;
memset(connectionInfo.lpSecConInfo, 0, sizeof(SEC_CONNECTION_INFO));
connectionInfo.lpSecConInfo->secureMode = TRUE;
connectionInfo.lpSecConInfo->validatePeerCert = FALSE;
connectionInfo.lpSecConInfo->sizeCertBuff = 0;
connectionInfo.lpSecConInfo->sizeKeyBuff = 0;
connectionInfo.lpSecConInfo->sizePhraseBuff = 0;
connectionInfo.lpSecConInfo->sizeRootCertBuff = 0;
printf("RFID_Connect to %s:%d\n", readerIP_.c_str(), readerPort_);
res = RFID_Connect(&readerHandle_, const_cast<char *>(readerIP_.c_str()), readerPort_, 10000, &connectionInfo);
if (res == RFID_API_SUCCESS) {
   printf("RFID_Connect success\n");
} else {
   printf("RFID_Connect failure: %s\n", RFID_GetErrorDescription(res));
}
 

Same result:

RFID_Login 1 to 10.93.30.25 admin:Default1! unsecure
RFID_Login 2 to 10.93.30.25 admin:Default1! secure
RFID_Login 2 success
RFID_Connect to 10.93.30.25:5085
RFID_Connect failure: Unable to open connection to reader

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