// Get Response on IMSI File ---------------------------------------------
if(((SC_Responce.SW1 << 8) | (SC_Responce.SW2)) == SC_OP_TERMINATED) //9000
{
USART_SendData(USART1,0x13);
delay1(2);
SC_ADPU.Header.CLA = SC_CLA_GSM11; //A0
SC_ADPU.Header.INS = SC_SELECT_FILE; //A4
SC_ADPU.Header.P1 = 0x00;
SC_ADPU.Header.P2 = 0x00;
SC_ADPU.Body.LC = 0x02;
for(i = 0; i < SC_ADPU.Body.LC; i++)
{
SC_ADPU.Body.Data[i] = DF[i];
}
SC_ADPU.Body.LE = 0;
SC_Handler(&SCState, &SC_ADPU, &SC_Responce);
}
if(SC_Responce.SW1 == SC_EF_SELECTED) //9F
{
USART_SendData(USART1,0X14);
delay1(2);
SC_ADPU.Header.CLA = SC_CLA_GSM11; //A0
SC_ADPU.Header.INS = SC_SELECT_FILE; //A4
SC_ADPU.Header.P1 = 0x00;
SC_ADPU.Header.P2 = 0x00;
SC_ADPU.Body.LC = 0x02;
for(i = 0; i < SC_ADPU.Body.LC; i++)
{
SC_ADPU.Body.Data[i] = DF4[i];
}
SC_ADPU.Body.LE = 0;
SC_Handler(&SCState, &SC_ADPU, &SC_Responce);
}
if(SC_Responce.SW1 == SC_EF_SELECTED) //9F
{
USART_SendData(USART1,0X24);
delay1(2);
SC_ADPU.Header.CLA = SC_CLA_GSM11; //A0
SC_ADPU.Header.INS = SC_WRITE_BINARY; //D0
SC_ADPU.Header.P1 = 0x00;
SC_ADPU.Header.P2 = 0x01;
SC_ADPU.Body.LC = 0x0f; //40以内不对 0x1c(94 02)
SC_ADPU.Body.Data[0]=0x55;
SC_ADPU.Body.Data[1]=0xaa;
SC_ADPU.Body.Data[2]=0x15;
SC_ADPU.Body.Data[3]=0x06;
SC_ADPU.Body.Data[4]=0x26;
i=5;
while(i < LC_MAX)
{
SC_ADPU.Body.Data[i++] = 0xff;
}
SC_ADPU.Body.LE = 00;
SC_Handler(&SCState, &SC_ADPU, &SC_Responce);
}
我试图写SIM卡的短消息服务参数,可是不成功。
上面是我的程序,返回的错误代码是0x6d,0x00。大神看看是怎么回事?谢谢!
|