亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? psgdrv.c

?? SIM卡的驅(qū)動(dòng)程序,有利于開(kāi)發(fā)一些與SIM相通的一些工具,或者手機(jī)軟件SIM驅(qū)動(dòng)的開(kāi)發(fā)
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):


/*------------------------------------------------------------------------*/

/*
Name:    PSWaitStatusByteByByte
Desc:    Interrupt action for RX interrupt when a Status Byte, SW1 is expected
         See ISO/IEC 7816-3 8.2.2.
         Once correctly received, the interrupt handler is changed to expect
         the second status byte.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSWaitStatusByteByByte(void)
   {
   UINT8 RXByte, RXAck;

   RXByte = PSGet();
      if (RXByte!=0x60) /* Its a NULL byte - must be patient */
      {                                                    
      RXAck = RXByte&0xF0;
      if (RXAck==0x60||RXAck==0x90)
         {
         PSStatusBuffer.SW1 = RXByte;
		 PSIntAction = PSWaitSW2;
#if SIM_DEBUG == SIM_DEBUG_MAX
         //PS Debug...
         OldIntAction_Dbg = NewIntAction_Dbg;
         NewIntAction_Dbg = _PSWaitSW2;
         //End PS Debug
#endif
         }
      /* else it is a mystery byte - ignore it ?????? */
      }
   }


/*------------------------------------------------------------------------*/

/*
Name:    PSWaitSW2
Desc:    Interrupt action for RX interrupt when the second Status Byte, SW2
         is expected.  See ISO/IEC 7816-3 8.2.2.
         Once correctly received, the command sequence is complete and
         interrupt handler is changed to the Idle interrupt handler.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSWaitSW2(void)
   {                                /* Received bad SIM status */
/*
   if (PSBadSIMStatus)              
      { PSStatusBuffer.SW2 = PSGet(); }
   else   
      { PSStatusBuffer.SW2 = *SIMbuffPtr; }
*/
   //GSMcprintf( MEMPutChar, "PSWaitSW2\n" );   
   PSStatusBuffer.SW2=PSGet();
   PSReturnToIdle(PSNormalCompletion);
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSInitChar
Desc:    Interrupt action for RX interrupt when the Initial Character is
         expected during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.1.
         Once correctly received, the interrupt action is changed to expect
         The T0 Interface Character.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSInitChar(void)
   {                                                                    
   UINT8 RXByte;

   RXByte = PSGet();
   if (RXByte==0x03 || RXByte==0x3F)  /* What you get with inverse when direct is set */
      {
      PSSetInverse();
//    PSRemainingWorkTime = 2;      //to speed up inverse SIM detection
//    2 is too fast -> slowing it to 50 frames
      PSRemainingWorkTime = 50;
      }
   else if (RXByte==0x3B)
      {
      PSSetDirect();
      }
   else
      return; /* Something screwy - ignore it */
#if defined(HW_SIM) 
    if ( *(UINT16 *)SIM_STAT_REG & SIM_ME_RX_FAIL)    /* Parity error - ignore it */
      {
      PSFoundInitChar = FALSE;    
      PSIntAction = PSInitChar;
#if SIM_DEBUG == SIM_DEBUG_MAX   
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSInitChar;
      //End PS Debug
#endif
        
      }
    else                                                 
      {
      PSFoundInitChar = TRUE;
      PSIntAction = PST0Char;
#if SIM_DEBUG == SIM_DEBUG_MAX  
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PST0Char;
      //End PS Debug
#endif
       
      }
#else
   PSFoundInitChar = TRUE;
   PSIntAction = PST0Char;
#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg = _PST0Char;
   //End PS Debug
#endif
#endif
   PSErrAction = PSParityErr;
#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldErrAction_Dbg = NewIntAction_Dbg;
   NewErrAction_Dbg = _PSParityErr;
   //End PS Debug
#endif

   PSDisableRxFailInterrupt(); /* to deal with inverse mode SIM */
   }

/*------------------------------------------------------------------------*/

/*
Name:    PST0Char
Desc:    Interrupt action for RX interrupt when the Interface Character T0 is
         expected during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.1.
         Once correctly received, the interrupt action is changed to expect
         subsequent interface characters, as determined by the helper procedure
         DetermineNextResetAnswer.
Params:  None
Returns: Nothing
Caveats: Note that this routine sets up PSTByteFlags, PSNoHistChars and
         PSTByteMask to deal with the first block of Interface characters,
         TA1..TD1, so that DetermineNextResetAnswer can predict what the SIM
         is going to send.
*/

static void PST0Char(void)
   {
   PSTByteFlags = PSGet();
   PSNoHistChars = PSTByteFlags&0x0F;
   PSTByteMask = 0x10;
   PSCheckSum ^= PSTByteFlags;

   DetermineNextResetAnswer();
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSTABCiChar
Desc:    Interrupt action for RX interrupt when the Interface Characters TAi,
         TBi or TCi is expected during Answer to Reset.
         See ISO/IEC 7816-3 6.1.4.1.
         Once correctly received, the interrupt action is changed to expect
         subsequent interface characters, as determined by the helper procedure
         DetermineNextResetAnswer.
Params:  None
Returns: Nothing
Caveats: Note that only the first two groups of interface characters are
         stored for protocol T=0.  These are the only ones rquired for a GSM
         SIM.
*/

static void PSTABCiChar(void)
   {
   UINT8 RXByte;
   RXByte = PSGet();
   PSCheckSum ^= RXByte;

   if (PSCurrProtType==0&&PSTi<2) /* We are only interested in TA1..TC2
                                     for Protocol T=0 */
      *PSTBytePtr = RXByte;
   DetermineNextResetAnswer();
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSTDiChar
Desc:    Interrupt action for RX interrupt when the Interface Character TDi is
         expected during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.1.
         Once correctly received, the interrupt action is changed to expect
         subsequent interface characters, as determined by the helper procedure
         DetermineNextResetAnswer.
Params:  None
Returns: Nothing
Caveats: Note that this routine resets up PSTByteFlags, PSCurrProtType and
         PSTByteMask to deal with the subsequent block of Interface characters,
         TAi..TDi, so that DetermineNextResetAnswer can predict what the SIM
         is going to send.
*/

static void PSTDiChar(void)
   {
   PSTByteFlags = PSGet();
   PSCheckSum ^= PSTByteFlags;

   if (PSTi==0) /* TD1 is present - cannot assume T=0 is available */
      PSCardProtocols = 0;
   PSCurrProtType = PSTByteFlags&0x0F;
   PSCardProtocols |= 1<<PSCurrProtType;
   PSTByteMask = 0x10;
   PSTi++;
   DetermineNextResetAnswer();
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSHistChar
Desc:    Interrupt action for RX interrupt when an Historical Character Ti is
         expected during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.1.
         Once all the Historical Characters have been received, the interrupt
         action is changed to expect the Checksum TCK or return to the idle
         state, as determined by the detection of a card supporting protocols
         other than T=0.
Params:  None
Returns: Nothing
Caveats: Note that the Historical Characters are ignored for GSM operation.
*/

static void PSHistChar(void)
   {
   UINT8 RXByte;
   RXByte = PSGet();
   PSCheckSum ^= RXByte;
   PSNoHistChars--;
   if (PSNoHistChars==0)
      {
      if (PSCardProtocols>1)            /* Protocol other than T=0 */
         {
         PSIntAction = PSWaitTCK;       /* Expect a checksum byte */
#if SIM_DEBUG == SIM_DEBUG_MAX
         //PS Debug...
         OldIntAction_Dbg = NewIntAction_Dbg;
         NewIntAction_Dbg = _PSWaitTCK;
         //End PS Debug
#endif
		 }
      else                              /* Answer to reset is complete */
         {
         PSCheckSum = 0;                /* In this case SIM doesn't send one */
         PSReturnToIdle(PSNormalCompletion);
         }
      }
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSWaitTCK
Desc:    Interrupt action for RX interrupt when a ChackSum Character TCK is
         expected during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.1.
         Having received this character, the interrupt action returns to idle.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSWaitTCK(void)
   {
   UINT8 RXByte;
   RXByte = PSGet();
   PSCheckSum ^= RXByte;

   PSReturnToIdle(PSNormalCompletion);
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSSendPTS0
Desc:    Interrupt action for TX interrupt to send The PTS0 character when
         Protocol Type Selection (PTS) must be performed.  See ISO/IEC 7816-3
         7.1.  Note that the Startup procedure for PTS will send the PTSS
         character.
         Having sent the PTS0 character, the interrupt action changes to send
         the PCK character on the next interrupt.
Params:  None
Returns: Nothing
Caveats: Note that for the current versions of GSM SIMs only PTS0=0 may be sent.
         See GSM 11.11 5.2.
*/

static void PSSendPTS0(void)
   {
   // Don't do a PTS1 if it needs to do a default speed PTS or
   // if extra guard time is requested by the SIM
    currentPTSState = PTS_DEFAULT_RETRY_STARTED;
   if (currentPTSState == PTS_DEFAULT_RETRY_STARTED)
      {
      // Make sure TA1 is set back to the default
      PSIFChars[0] = 0x11;
      PSSend(0x00);
      PSIntAction = PSSendPCK;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSSendPCK;
      //End PS Debug
#endif
      }
   else
   	  {
      // Turn on the TA1 bit for the F and D values
      PSSend(0x10);    
      PSIntAction = PSSendPTS1;
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSSendPTS1;
      //End PS Debug
#endif
      }
   }


/*------------------------------------------------------------------------*/

/*
Name:    PSSendPTS1
Desc:    Interrupt action for TX interrupt to send The PTS1 character when
         Protocol Type Selection (PTS) must be performed.  See ISO/IEC 7816-3
         7.1.  Note that the Startup procedure for PTS will send the PTSS
         character.
         Having sent the PTS1 character, the interrupt action changes to send
         the PCK character on the next interrupt.
Params:  None
Returns: Nothing
Caveats: Note that for the current versions of GSM SIMs only PTS0=0 may be sent.
         See GSM 11.11 5.2.
*/

static void PSSendPTS1(void)
   {
   // Send whatever F/D value the SIM is capable of - we could handle it!
   PSSend(PSIFChars[0]);
   PSIntAction = PSSendPCK;
#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg = _PSSendPCK;
   //End PS Debug
#endif
   }

/*------------------------------------------------------------------------*/

/*
Name:    PSSendPCK
Desc:    Interrupt action for TX interrupt to send The PCK character when
         Protocol Type Selection (PTS) must be performed.  See ISO/IEC 7816-3
         7.1, 7.2.  Note that the preceding PTS0 is sent byte the interrupt
         action PSTXPTS0.
         Having sent the PCK character, the interrupt action changes to setting
         the UART mode to Input to receive the PTS acknowledgement.
Params:  None
Returns: Nothing
Caveats: Note that for the current versions of GSM SIMs only PTS0=0 may be sent.
         As a result this checksum is ALWAYS 0xFF! See GSM 11.11 5.2.
*/

static void PSSendPCK(void)
   {
   UINT

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级一区二区三区| 国产91精品一区二区麻豆亚洲| 福利视频网站一区二区三区| 欧美电视剧在线看免费| 秋霞成人午夜伦在线观看| 555www色欧美视频| 亚洲午夜三级在线| 欧美日韩另类国产亚洲欧美一级| 亚洲人成在线观看一区二区| 91论坛在线播放| 亚洲人妖av一区二区| 91精品91久久久中77777| 亚洲777理论| 国产日韩亚洲欧美综合| 粉嫩嫩av羞羞动漫久久久| 1024精品合集| 欧美一区二区三区喷汁尤物| 国产一区在线精品| 自拍偷拍亚洲欧美日韩| 欧美浪妇xxxx高跟鞋交| 男女男精品视频| 国产精品免费视频观看| 欧美日韩成人综合| 丁香六月综合激情| 亚洲韩国精品一区| 国产农村妇女精品| 欧美日韩精品欧美日韩精品一| 久久精品国产99久久6| 中文字幕一区二区日韩精品绯色| 欧美日韩国产一区| 成人免费高清视频在线观看| 性做久久久久久免费观看欧美| 久久久久久久久久久久久女国产乱| 国产98色在线|日韩| 另类小说综合欧美亚洲| 亚洲一区精品在线| 欧美韩国一区二区| 日韩精品一区二区在线| 欧美日韩一卡二卡三卡| 91丨porny丨国产| 9色porny自拍视频一区二区| 国精品**一区二区三区在线蜜桃| 亚洲综合在线五月| 亚洲欧洲综合另类在线| 国产精品福利一区| 国产精品久久777777| 欧美极品少妇xxxxⅹ高跟鞋| 欧美一区二区三区白人| 在线亚洲一区二区| 欧美伊人久久久久久久久影院| 91偷拍与自偷拍精品| 91久久奴性调教| 色婷婷国产精品久久包臀| 色婷婷一区二区三区四区| 99国产欧美久久久精品| 日本久久一区二区| 欧美高清激情brazzers| 91精品啪在线观看国产60岁| 欧美丰满美乳xxx高潮www| 欧美精品久久天天躁| 日韩欧美亚洲一区二区| 久久嫩草精品久久久精品| 国产精品毛片a∨一区二区三区| 国产女人aaa级久久久级| 亚洲人成网站在线| 日本欧美一区二区三区| 国产在线视频不卡二| www.欧美亚洲| 91精品婷婷国产综合久久性色| 久久精子c满五个校花| 亚洲精品高清视频在线观看| 亚洲gay无套男同| 成人av在线播放网址| 51精品视频一区二区三区| 久久久久久久综合日本| 亚洲一区二区三区激情| 国产一区二区三区高清播放| 欧美性欧美巨大黑白大战| 日韩三级.com| 亚洲图片自拍偷拍| 国产精品一区二区不卡| 欧美揉bbbbb揉bbbbb| 国产精品理论片在线观看| 精品亚洲aⅴ乱码一区二区三区| 91在线观看视频| 国产欧美一区二区在线| 日韩精品91亚洲二区在线观看| 不卡av在线免费观看| 精品国产一区二区三区四区四| 亚洲一区二区精品3399| 国产激情偷乱视频一区二区三区| 欧美剧在线免费观看网站| 自拍偷拍亚洲激情| 成人一区二区视频| 国产精品久久久久久福利一牛影视| 久久精品国产第一区二区三区| 欧美日韩免费电影| 午夜精品久久一牛影视| 欧美日韩高清不卡| 日韩专区在线视频| 欧美一级国产精品| 精品一区二区久久久| 日韩精品一区二区三区在线| 另类的小说在线视频另类成人小视频在线| 91久久精品一区二区| 亚洲成人一区在线| 精品三级在线观看| 国产一区二区三区久久久| 欧美激情一区在线| 99久久精品免费看| 爽爽淫人综合网网站| 日韩色在线观看| 成人性生交大合| 亚洲成人激情综合网| 欧美电影免费观看高清完整版| 国产精品综合在线视频| 国产精品伦理一区二区| 欧美猛男gaygay网站| 韩国理伦片一区二区三区在线播放| 中文字幕乱码日本亚洲一区二区| 91污片在线观看| 麻豆精品一区二区av白丝在线| 久久久久久久久久看片| 欧美日韩精品欧美日韩精品| 国内精品伊人久久久久av一坑 | 亚洲欧美影音先锋| 欧美久久久久久久久久| 成人午夜激情片| 日本系列欧美系列| 一区二区三区中文免费| 久久久噜噜噜久噜久久综合| 欧美在线你懂得| av中文字幕在线不卡| 美女一区二区视频| 亚洲3atv精品一区二区三区| 国产精品久久久久一区二区三区 | 九九精品视频在线看| 一区二区久久久| 国产精品乱人伦中文| 久久久精品天堂| 精品国产乱码久久久久久牛牛 | 国产精品一线二线三线| 美女爽到高潮91| 奇米一区二区三区| 免费人成黄页网站在线一区二区| 亚洲综合丝袜美腿| 亚洲最大成人网4388xx| 依依成人精品视频| 夜夜精品浪潮av一区二区三区| 亚洲欧美国产高清| 亚洲午夜日本在线观看| 亚洲午夜久久久久中文字幕久| 一区二区欧美视频| 日韩精品成人一区二区在线| 亚洲www啪成人一区二区麻豆| 一区二区三区中文免费| 亚洲高清不卡在线观看| 日韩黄色免费电影| 国产原创一区二区| 成人黄色av网站在线| 欧美色中文字幕| 欧美日韩电影在线| 久久久久久久综合日本| 亚洲欧美日韩系列| 日本美女一区二区三区| 国产成人8x视频一区二区| 91亚洲精华国产精华精华液| 欧美视频中文字幕| 久久久久久毛片| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲国产综合色| 国产精品中文字幕日韩精品| 欧美亚洲综合另类| 国产午夜精品久久| 日韩成人免费看| 91网上在线视频| 久久精品人人做人人爽人人| 亚洲精品ww久久久久久p站| 精品午夜久久福利影院| 欧美在线不卡视频| 日韩毛片在线免费观看| 久久精品二区亚洲w码| 欧美视频在线观看一区二区| 国产精品日产欧美久久久久| 亚洲一区二区三区视频在线播放| 久久99国产精品免费| 欧美日韩国产一级片| 一个色妞综合视频在线观看| 国产二区国产一区在线观看| 欧美大片国产精品| 亚洲成人一二三| 欧美丰满少妇xxxbbb| 日韩和欧美一区二区| 欧美蜜桃一区二区三区| 亚洲色图欧美在线| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品视频观看| 粉嫩13p一区二区三区| 国产精品国产成人国产三级 | 欧美亚洲动漫制服丝袜|