59
2.13 SLE4442 special Functions
int fw_read_4442(int icdev,unsigned char _Adr,unsigned char *_Data,int length);
Description
Read data from 4442 card.
Parameters
icdev:Value of Device Handle.
_Adr:
Start address for reading(0~255)
_Data:
Data returned.
length:
Length of Data to read(0~255)
Return Value
0 if successful; otherwise, Nonzero.
Example
// Read 20 chars start from address:0
int st;
unsigned char rbuf[300]={0};
st= fw_read_4442(icdev,0,rbuf,20);
Remarks: 1.Length should not exceed 256, otherwise the whole 256 bytes will be
read.
int
fw_write_4442(int icdev,unsigned char _Adr,unsigned char *_Data,int length);
Description
Write data to 4442 card.
Parameters
i
cdev:Value of Device Handle.
_Adr:
Starting address for writing(0x30~0xff).
_Data:
Data for writing.
length:
Length of data to write.
Return Value
0 if successful; otherwise, Nonzero.
Example
// write 4 chars start from address:0x30
int st;
unsigned char sbuf[4]={0x01,0x02,0x03,0x04};
st= fw_ write _4442(icdev,0x30,sbuf,4);
Remark
1: the value of parameter _Adr should be set between 0x30 and 0xff;
2: the value of parameter “length” should be less than the actual length of
data to be written;
int fw_getProtectData_4442(int icdev,unsigned char _Adr,unsigned char *_Data,int
length);
Description
Read protected bits.
Parameters