//-----***-unsigned char ReadBinary(bool SysKind,unsigned char FileId, unsigned char OffSet, unsigned char Length)-***-----// //---功能描述:获取数据,CosBuf[5]={0x00/04,0xb0,0x80+namel,offset,le};。 //---输入条件:SysKind=0--->EasmChip的操作,SysKind=1-->CpuCard的操作,FileId二进制文件标识符,Length:要读取的长度 //---输出项目:RetData=0x00操作成功;RetData=0xFF此操作失败。 unsigned char ReadBinary(bool SysKind,unsigned char FileId, unsigned char OffSet, unsigned char Length) { unsigned char i; CmdBuf[CLA] = 0x00; CmdBuf[INS] = 0xb0; CmdBuf[P01] = 0x80 + FileId; CmdBuf[P02] = OffSet; CmdBuf[P03] = Length; for(i = 0; i < 3; i ++) { CosCommand(SysKind,3,Length); if( (SwBuf[0] == 0x90) && (SwBuf[1] == 0x00) ) { break; } } if(i < 3) { return 0x00; } else { return 0xff; } } MSP430操作CPU卡原程序-----本人作品禁止任何形式的转载
相关链接:http://blog.21ic.com/user1/405/archives/2009/54990.html |