0% found this document useful (0 votes)
29 views23 pages

SC-350 DLL Specification

The document provides specifications for a DLL that supports reading various card types on Windows 32-bit systems. It includes details on opening and closing communication ports, executing commands, and code examples.

Uploaded by

Carlos Polanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views23 pages

SC-350 DLL Specification

The document provides specifications for a DLL that supports reading various card types on Windows 32-bit systems. It includes details on opening and closing communication ports, executing commands, and code examples.

Uploaded by

Carlos Polanco
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Room 716, Yiben E-Commerce Tel: +86-755-82706901

and Industrial Park, Chaguang Road Fax: +86-755-82706900


Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

SC-350 DLL Specification

WINDOWS DLL Specification:


Our company provides DLL for Windows32 and include following files:
1. SC_350.H 32 digit DLL header file
2. SC_350.LIB 32 digit input libraries
3. SC_350.DLL WINDOWS 32 digit libraries

SC-350 Support card type:


1. RFID Card: ISO/IEC 14443 TYPE A / B, MIFARE one (S50, S70, UL)
2. IC Card:
SLE4428, SLE4442
24C01A, 24C02, 24C04, 24C08, 24C16, 24C32, 24C64
Contact CPU Card (T=0/T=1)
SAM/SIM Card(T=0/T=1)
3. Magnetic Card
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

Contents

1. API Specification (RS232 Mode) ..................................................................................................................... 3


1.1 Open Com function (Default baud rate38400bps) ....................................................................................... 3
1.2 Open Com Port by Specified baud rate........................................................................................................ 4
1.3 Close Com Port Function............................................................................................................................. 5
1.4 Command Function ..................................................................................................................................... 6
1.6 Cancel Command Function ......................................................................................................................... 7
3 Code Example......................................................................................................................................................... 9
3.1 Part of Code Example .................................................................................................................................. 9
3.2 Call Function Specification ....................................................................................................................... 10
3.3 Code Example 1 (Magnetic card operation) ...............................................................................................11
3.4 Code Example 2 (CPU Card Operation)................................................................................................. 18
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

1. API Specification (RS232 Mode)

1.1 Open Com function (Default baud rate38400bps)

HANDLE APIENTRY SC350ROpen (char *Port)

Parameter:

Port: Serial Number String


E.g.: SC350ROpen("COM1")
Return:
· 0 (Com open error)
Possible reason:
① Invalid Serial Number String
② The com occupies by other device
· <>0 Com Open Success

Notes: 1) Call this function before others.


2) Enable to open several com ports to get serial number string, but disable to open one port
twice at same time.
3) Close com port by using SC350RClose() after the completion of all operations.
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

1.2 Open Com Port by Specified baud rate

HANDLE APIENTRY SC350ROpenWithBaut (char *Port, unsigned int Baud rate);


Parameter:
Port: Serial port string
Baud rate: Baud rate
Baud rate=9600,19200,38400,57600,115200。
Eg: SC350ROpenWithBaut ("COM1", 38400)
Return:
· 0 (Com open error)
Possible reason:
① Invalid Serial Number String
② The com occupies by other device
· <>0 Com Open Success

Notes: 1) Call this function before others.


2) Enable to open several com ports to get serial number string, but disable to open one port
twice at same time.
3) Close com port by using SC350RClose() after the completion of all operations.
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

1.3 Close Com Port Function

int APIENTRY SC350RClose (HANDLE ComHandle)

Patameter:
ComHandle:Com Handle
Return:
=0 Success
<>0 Fail

Notes: Combined application with SC350ROpen () or SC350RopenWithBaut function,Close com port


after usage of com port.
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

1.4 Command Function


int APIENTRY RS232_ExeCommand (HANDLE ComHandle, BYTE TxCmCode, BYTETxPmCode, int
TxDataLen, BYTE TxData, BYTE *RxReplyType, BYTE *RxStCode1,BYTE *RxStCode0, int
*RxDataLen, BYTE RxData);
Function:
Execute command and return the result
Parameter:
ComHandle:Com handle
TxCmCode: Command Code
TxPmCode: Parameter Code
TxDataLen: Extra command data length
TxData: Extra command data package
RxReplyType: Reply Type
0x50 : Execute successful
0x4E : Execute fail
0x10 : Communication is cancel by slave (NAK )
0x20 : Communication failure
0x30 : Command is cancel by HOST (DLE, EOT)
RxStCode1: Return State code 1 // Pls see more detain from Status code and error code of
communication protocol
RxStCode0: Return State code 0 //Pls see more detain from Status code and error code of
communication protocol
RxDataLen: Return Package length
RxData: Return package data
Return:
=0 Successful
<>0 Fail
Parameter example base on communication protocol
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

1.6 Cancel Command Function


int APIENTRY CancelCommand (HANDLE ComHandle);
Function:
Cancel recent operation, finish following operation
① Send "DLE,EOT" control code to slave and waiting for "DLE,EOT"
② Cancel the command. For example, card-in command, it can be cancel when the card is inserting by
this command.
Parameter:

ComHandle:Com Handle

Return:

=0 Success

=-1 Fail
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

3 Code Example

3.1 Part of Code Example

cm: Command code pm: Parameters


Command cm Function pm Details of operation
30H If card is inside ICRW, move card to gate
31H If card is inside ICRW, capture card backward
If card is inside ICRW, retain the card inside of
32H
ICRW.
INITIALIZE 30H Initialize ICRW
33H If card is inside ICRW, does not move the card
34H Same as 30H. And Retract counter will work
35H Same as 31H. And Retract counter will work
36H Same as 32H. And Retract counter will work
30H Report presence of card and its position
31H Report presence of sensor status in detail
STATUS Report presence of sensor status in detail
31H Inquire status 32H
REQUEST (Exp.)
Report presence of sensor status in detail
33H
(Exp.)
30H Accepts all card In
CARD IN 3AH Disable/Enable 31H Disable
32H Enable with referring pre-head
CARD CARRY 33H Eject 30H Move card to Gate from inside ICRW
RETRIEVE 34H Retrieve 30H Retrieve card, which is in Gate position
Move card 30H Only card movement
ISO #1 read 31H ISO Track #1 reads Transmit read data
Mag-Track READ 36H ISO #2 read 32H ISO Track #2 reads Transmit read data
ISO #3 read 33H ISO Track #3 reads Transmit read data
All tracks read 35H Transmit All channel data
IC contact set 30H Move card to IC contact position
IC CONTACT 40H
IC cont. release 32H Release IC contact
Activate 30H To cold reset IC card
Deactivate 31H To deactivate IC card
IC CARD
49H Status 32H To inquire IC card status
CONTROL
Automatic To exchange data between IC card
39H
Communication by protocol T=0 orT=1
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

3.2 Call Function Specification


USB interface is as the same as RS232
1、Equipment Connection
RS232 interface call SC350Ropen function.
2、Communication Procedure
RS232 interface call RS232_ExeCommand function.
3、Close Com Port
RS232 interface call SC350RClose function.
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

3.3 Code Example 1 (Magnetic card operation)

HANDLE hCom; // Target device's HANDLE


int rc=0; //Result
unsigned char CmCode;
unsigned char PmCode;
int CmDataLen;
unsigned char CmData[1024];

unsigned char ReType;


unsigned char St1;
unsigned char St0;
int ReDataLen;
unsigned char ReData[1024];
// Open Comm. port
{
hCom=SC350ROpenWithBaut (“COM1”,38400);
if(hCom<=0)
{
// failed

}
else
{
// successfully.

}
}
// Initialize
{
memset(CmData,0x00,sizeof(CmData));
CmCode=0x30; // Initialize command
PmCode=0x36; // Parameter code
CmDataLen=11; // Data size (bytes)
CmData[0]=0x33;
CmData[1]=0x32;
CmData[2]=0x34;
CmData[3]=0x30;
CmData[4]=0x30;// fm Not use. Always 30H
CmData[5]=0x33;// Pd
CmData[6]=0x30;// Wv
CmData[7]=0x30;// Sh
CmData[8]=0x31;// Ds
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

CmData[9]=0x30;// Ty
CmData[10]=0x31;// Cp

rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
// Initialize command successfully finished.
if (ReType==0x50)
{
// Received positive reply

}
else (ReType==0x4e)
{
// Received negative reply
...
}
else
{
//Communication Error
// Initialize command failed.

}
}
// Setting Card In by Mag card
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x3a; // Card In
PmCode=0x32; // by Mag card
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0) || ReType != 0x50)
{
// Command sending failed or command execution failed
ResErrMsg(St1,St0); // ResErrMsg is a function to show the reason of error
// Details please see from error code of communication protocol

}
}
// Request Status
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x31; // Status request command
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

PmCode= 0x30; // Parameter code


CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
if (ReType==0x50)
{
//Execute Ok
if(St1 == '0' && St1 == '2')
{
// status code="02"
// Detected a card inside of Card Reader/Writer
...
}
}
else (ReType==0x4e)
{
//Command execution failed
ResErrMsg(St1,St0);

}
else
{
//Communication Error

}
}
// Read Track 1 of Mag card’s tracks
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x36; // Read Mag Card
PmCode=0x31; // Track 1
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
if (ReType==0x50)
{
//Read track data OK
if (ReData[0]==0x50)
{
CString Tra1Buf,t;
int n;
for(n=1; n<ReDataLen; n++)
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

{
t.Format("%c",ReData[n]);
Tra1Buf += t;
t="";
}
//Tra1Buf is the buffer of track 1 data
}
else if (ReData[0]==0x4e)
{
//Read track data Error
switch(ReData[2])
{
case 36 : //No start bits (STX)
break;
case 37 //No stop bits (ETX)
break;
case 30 : //Byte Parity Error(Parity))
break;
case 38 : //Parity Bit Error(LRC)
break;
case 34 : //Card Track Data is Blank
case 33 : //Only(SS-ES-LRC)
break;
}
}
}
else (ReType==0x4e)
{
// Command execution failed
ResErrMsg(St1,St0);
}
else
{
//Communication Error
}
}
// Read Track 2 of Mag card’s tracks
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x36; // Read Mag Card
PmCode=0x32; // Track 2
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

if(rc==0)
if (ReType==0x50)
{
//Read track data OK
if (ReData[0]==0x50)
{
CString Tra1Buf,t;
int n;
for(n=1; n<ReDataLen; n++)
{
t.Format("%c",ReData[n]);
Tra1Buf += t;
t="";
}
//Tra1Buf is the buffer of track 2 data
}
else if (ReData[0]==0x4e)
{
//Read track data Error
switch(ReData[2])
{
case 36 : //No start bits (STX)
break;
case 37 //No stop bits (ETX)
break;
case 30 : //Byte Parity Error(Parity))
break;
case 38 : //Parity Bit Error(LRC)
break;
case 34 : //Card Track Data is Blank
case 33 : //Only(SS-ES-LRC)
break;
}
}
}
else (ReType==0x4e)
{
// Command execution failed
ResErrMsg(St1,St0);
}
else
{
//Communication Error
}
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

}
// Read Track 3 of Mag card’s tracks
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x36; // Read Mag Card
PmCode=0x33; // Track 3
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
if (ReType==0x50)
{
//Read track data OK
if (ReData[0]==0x50)
{
CString Tra1Buf,t;
int n;
for(n=1; n<ReDataLen; n++)
{
t.Format("%c",ReData[n]);
Tra1Buf += t;
t="";
}
//Tra1Buf is the buffer of track 3 data
}
else if (ReData[0]==0x4e)
{
//Read track data Error
switch(ReData[2])
{
case 36 : //No start bits (STX)
break;
case 37 //No stop bits (ETX)
break;
case 30 : //Byte Parity Error(Parity))
break;
case 38 : //Parity Bit Error(LRC)
break;
case 34 : //Card Track Data is Blank
case 33 : //Only(SS-ES-LRC)
break;
}
}
}
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

else (ReType==0x4e)
{
// Command execution failed
ResErrMsg(St1,St0);
}
else
{
//Communication Error
}
}
// Closes communications between the Host Computer and the Card Reader/Writer
{
SC350RClose (hCom);
}
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

3.4 Code Example 2 (CPU Card Operation)


HANDLE hCom; // Target device's HANDLE
int rc=0; //Result
unsigned char CmCode;
unsigned char PmCode;
int CmDataLen;
unsigned char CmData[1024];

unsigned char ReType;


unsigned char St1;
unsigned char St0;
int ReDataLen;
unsigned char ReData[1024];
// Open Comm. port
{
hCom= SC350ROpenWithBaut (“COM1”,38400);
if(hCom<=0)
{
// failed

}
else
{
// successfully.

}
}
// Initialize
{
memset(CmData,0x00,sizeof(CmData));
CmCode=0x30; // Initialize command
PmCode=0x30; // Parameter code
CmDataLen=11; // Data size (bytes)
CmData[0]=0x33;
CmData[1]=0x32;
CmData[2]=0x34;
CmData[3]=0x30;
CmData[4]=0x30;// fm Not use. Always 30H
CmData[5]=0x33;// Pd
CmData[6]=0x30;// Wv
CmData[7]=0x30;// Sh
CmData[8]=0x31;// Ds
CmData[9]=0x30;// Ty
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

CmData[10]=0x31;// Cp
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
// Initialize command successfully finished.
if (ReType==0x50)
{
// Received positive reply

}
else (ReType==0x4e)
{
// Received negative reply
...
}
else
{
//Communication Error
// Initialize command failed.

}
}
// Setting Card In by Switch
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x3a; // Card In
PmCode=0x30; // by Switch
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
{
// Command successfully finished.
if (ReType==0x50)
{
// Received positive reply

}
else (ReType==0x4e)
{
// Received negative reply
ResErrMsg(St1,St0); // ResErrMsg is a function ,please see the error code of communication
protocol

Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

}
else
{
//Communication Error, Command failed.

}
}
}
// Request Status
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x31; // Status request command
PmCode= 0x30; // Parameter code
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc==0)
if (ReType==0x50)
{
//Execute Ok
if(St1 == '0' && St1 == '2')
{
// status code="02"
// Detected a card inside of Card Reader/Writer
...
}
}
else (ReType==0x4e)
{
//Command execution failed
ResErrMsg(St1,St0);

}
else
{
//Communication Error

}
}
// Switches IC contact on
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x40; // IC contact
PmCode=0x30; // IC contact set
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

CmDataLen=0; // Data size


rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0) || ReType != 0x50)
{
// Command sending failed or command execution failed
goto _EXIT1;
}
}
// Activates CPU card
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x49; // IC card control
PmCode=0x30; // Activate
CmDataLen=1; // Data size
If (true) //Choice Mode
{
CmData[0]=0x30; //EMV2000 V4.0 Vcc=5v
}
else
{
CmData[0]=0x33; // ISO/IEC7816-3
}
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0))
{
// Command sending failed or command execution failed
goto _EXIT2;
}
else
{
if (ReType==0x50)
{
CString t;
CString TempBuf="";
for(int n=1; n<ReDataLen; n++) // ATR= start from n= 1
{
t.Format("%02x",ReData[n]);
TempBuf += t;
t="";
}
//TempBuf is the buffer of ATR data
}
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

else //(ReType==0x4e)
{
// Command execution failed
SANKYOErrMsg(St1,St0);
}
}
}
// Exchanges data between the Host Computer and IC card
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x49; // IC card control
PmCode=0x39; // Deactivate
CmDataLen=5; // Data size
CmData[0]=0x00;
CmData[1]=0x84;
CmData[2]=0x00;
CmData[3]=0x00;
CmData[4]=0x08;
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0)
{
// ICCardTransmit failed
...
}
else
{
if (ReType==0x50)
{
CString t;
CString TempBuf="";
for(int n=0; n<ReDataLen; n++) // R-APDU= start from n=0
{
t.Format("%02x",ReData[n]);
TempBuf += t;
t="";
}
// TempBuf is the buffer of R-APDU data
}
else //(ReType==0x4e)
{
// Command execution failed
SANKYOErrMsg(St1,St0);
}
Room 716, Yiben E-Commerce Tel: +86-755-82706901
and Industrial Park, Chaguang Road Fax: +86-755-82706900
Nanshan District, Shenzhen, China Email: [email protected]
Post Code: 518055 Http://www.syncotek.com

}
}
// Deactivates IC card
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x49; // IC card control
PmCode=0x31; // Deactivate
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0) || ReType != 0x50)
{
// Command sending failed or command execution failed

}
}
_EXIT2:
// Switches IC contact off
{
memset(CmData,0x00,sizeof(CmData));
CmCode= 0x40; // IC contact
PmCode=0x32; // IC contact release
CmDataLen=0; // Data size
rc=RS232_ExeCommand(hCom,CmCode,PmCode,CmDataLen,CmData,
&ReType,&St1,&St0,&ReDataLen,ReData);
if(rc!=0) || ReType != 0x50)
{
// Command sending failed or command execution failed
….
}
}
_EXIT1:
// Closes communications between the Host Computer and the Card Reader/Writer
SC350RClose (hCom);
_EXIT:

You might also like