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

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

?? psgdrv.c

?? SIM卡的驅(qū)動程序,有利于開發(fā)一些與SIM相通的一些工具,或者手機軟件SIM驅(qū)動的開發(fā)
?? C
?? 第 1 頁 / 共 5 頁
字號:
      else
         currentPTSState = PTS_DEFAULT_RETRY_STARTED;
         
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSSendPTS0;
      //End PS Debug
#endif
      }
   else                         /* No need to perform PTS */
      {
      PSAcceptSIM();
      }
   }

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

/*
Name:    DetermineNextResetAnswer
Desc:    Used to determine the action to be performed on the next character
         sent by the card during Answer to Reset.  See ISO/IEC 7816-3 6.1.4.2
         for details of how things are determined.
Params:  None
Returns: Nothing
Caveats: Assumes that the contents of PSTByteFlags are the Previous TDi
         character (Inititally T0) and that PSNoHistChars contains low
         order Nibble of T0.  PSRByteMask must be reset to 0x10 whenever
         T0 or TDi is received.
*/

static void DetermineNextResetAnswer(void)
   {
   while ((PSTByteMask<0x80)&&((PSTByteMask&PSTByteFlags)==0))
      {
      PSTByteMask += PSTByteMask;
      PSTBytePtr++;
      }
   if (PSTByteMask<0x80)                   /* TAi..TCi is Expected? */
      {
      PSIntAction = PSTABCiChar;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg	= _PSTABCiChar;
      //End PS Debug
#endif
	  }
   else if ((PSTByteMask&PSTByteFlags)!=0) /* TDi is expected */
      {
      PSIntAction = PSTDiChar;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg	= _PSTDiChar;
      //End PS Debug
#endif
	  }
   else if (PSNoHistChars!=0)              /* Historic chars are expected */
      {
      PSIntAction = PSHistChar;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg = _PSHistChar;
      //End PS Debug
#endif
	  }
   else if (PSCardProtocols>1)             /* Protocol other than T=0 */
      {
      PSIntAction = PSWaitTCK;

#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;                      /* TCK is not available */
      PSReturnToIdle(PSNormalCompletion);
      }
   PSTByteFlags &= ~PSTByteMask;
   }

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

/*
Name:    PSStartSIMResetSequence
Desc:    Kicks off the initialisation sequence for a SIM, unless the number
         of reset retries has been exceeded.  The values for the Interface
         Characters are reset to their default GSM values.
Params:  None
Returns: Nothing
Caveats: The defulat values correspond to those used by GSM
*/

static void PSStartSIMResetSequence(void)
   {
   if (PSResetRemainingRetries>0)
      {
      if (PSResetRemainingRetries==PS_RESET_ALLOWED_RETRIES)
         PSEverFoundInitChar = FALSE;
      else if (PSFoundInitChar)
         PSEverFoundInitChar = TRUE;

      PSDoShutDown();          //Retry, or switch voltage, need power down
      PSTi = 0;
      PSCurrProtType = 0;
      PSCardProtocols = 1;  /* Assume T=0 available until we find TD1 */
      PSCheckSum = 0;
      PSFoundInitChar = FALSE;
      PSClockStopped = FALSE;
      PSTBytePtr = PSIFChars;
      PSIFChars[0] = 0x11; /* TA1 - Clock rates */
      PSIFChars[1] =    5; /* TB1 - Programming Current/Voltage */
      PSIFChars[2] =    0; /* TC1 - Extra guard time */
      PSIFChars[3] =    0; /* TA2 - Not specified */
      PSIFChars[4] =   50; /* TB2 - Accurate Programming Voltage */
//    PSIFChars[5] =   50; /* TC2 - The Work Waiting Time, delay 9600 etu */
      PSIFChars[5] =   PS_DEFAULT_WI; /* TC2 - The Work Waiting Time, delay 9600 etu */
      PSWorkWaitingTime = MSECS(PSIFChars[5]*PS_WORK_WAIT_FACTOR);
      PSRemainingWorkTime = PS_RESET_LO_TIMEOUT;
      PSTransferRemainingRetries = PS_TRANSFER_ALLOWED_RETRIES;
      PSIntAction = PSIdle;
      PSErrAction = PSIdle;

#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      OldIntAction_Dbg = NewIntAction_Dbg;
      NewIntAction_Dbg	= _PSIdle;
      OldErrAction_Dbg	= NewErrAction_Dbg;
      NewErrAction_Dbg	= _PSIdle;
      //End PS Debug
#endif

      PSCompleter = PSStartResetCompleter;
	  TimerAIH = SimResetTimerAIH; /* Initialize TimerA sim IH*/
#if SIM_DEBUG == SIM_DEBUG_MAX
      IntHandler_Dbg = _SimResetTimerAIH;
#endif
      PSResetRemainingRetries--;
    }

#if (__SIM_INTERFACE__== SIM_1P8V3V)
   else if (SISupplyVoltage == SI_1P8_VOLTS)
      {
      //Out of retries, start 3V reset sequence
      SISupplyVoltage = SI_3_VOLTS;
      PSDoStartUp();
      }
#endif    
	else if ( (SIMClockSpeed == SIM_CLOCK_3_9Mhz) && (PSClockSpeed == SIM_CLOCK_3_9Mhz))  // Try to change speed from 3.9Mhz to
																					   // to 1.95Mhz, if the SIM does not support
																					   // 3.9Mhz.
	{
#if (__SIM_INTERFACE__== SIM_1P8V3V)
        if (SISupplyVoltage == SI_3_VOLTS)
        {
        SISupplyVoltage = SI_1P8_VOLTS;
        }
#endif    
		PSClockSpeed = SIM_CLOCK_1_95Mhz;
		PSDoStartUp();   
	}
   else if (PSEverFoundInitChar)
      {
#if SIM_DEBUG == SIM_DEBUG_MAX
      PSDeactivateSIM_Dbg = 1;
#endif
      PSDeactivateSIM(PSDefectSIM);
      }
   else
      {
#if SIM_DEBUG == SIM_DEBUG_MAX
      PSDeactivateSIM_Dbg = 2;
#endif
      PSDeactivateSIM(PSNoSIM);
	  }
   }

/*------------------------- Interrupt Action Functions: --------------------

The SIM driver is basically a interrupt handler that must step through a
sequence of transmission and reception of bytes to and from the SIM.
This sequence is defined in ISO/IEC 7816-3.
The sequence of actions is considered to be a simple state machine controlled
in the following manner:

   There is a Function pointer PSIntAction, which points to the function
   responsible for dealing with a 'Successful' SIM interrupt, i.e. one in which
   a byte was successfully transferred.
   Each time a 'Successful' interrpt occurs, the function pointer to by
   PSIntAction is called, and the corresponding routine not only performs the
   required action but also updates PSIntAction to point to the function that
   handles next expected event from the SIM hardware.

If an 'unsuccessful' interrupt occurs, the main SIM interrupt handler is
responsible for taking appropriate actions.
In this way, the interrupt handler, together with the Successful interrupt
actions are well structured, simple and efficient.

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

/*
Name:    PSParityErr
Desc:    Interrupt action for Parity Errors.  Causes the count of
         count of retransmissions to be incremented and abort the
         command if the too many have occured.
Params:  None
Returns: Nothing
Caveats: Assumes that Character repetition is performed by hardware.
*/

static void PSParityErr(void)
   {
   if (PSTransferRemainingRetries>0)
      PSTransferRemainingRetries--;
   else /* The transmission to or from the SIM has been reattempted
           too many times.  Assume the SIM is defective */
#if SIM_DEBUG == SIM_DEBUG_MAX
      //PS Debug...
      PSCompletionCode_Dbg = PSTooManyRetries;
      //End PS Debug
#endif 
      PSReturnToIdle(PSTooManyRetries);

   }

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

/*
Name:    PSIdle
Desc:    Dummy interrupt action routine, used when the SIM driver is
         NOT expecting an interrupt, other than a SIM In or Out interrupt.
Params:  None
Returns: Nothing
Caveats: Not much to do!
         It could log the number of spurious interrupts!
         It could also say the SIM is being naughty!
*/

static void PSIdle(void)
   {
   }

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

/*
Name:    PSSendINS
Desc:    Interrupt action for TX interrupt following transmission of the
         CLA byte of a Command Header.  See ISO/IEC 7816-3 8.2.1.
         This interrupt causes the INS byte to be sent and changes interrupt
         handler to send P1 byte on next interrupt.
Params:  None
Returns: Nothing
Caveats: It should be noted that the CLA byte is sent by PSDoCommand to start
         the ball rolling.  PSSendINS is the first interrupt action in normal
         SIM command processing.
*/

void PSSendINS(void)
   {
   PSSend(PSCommandBuffer.INS);
   PSIntAction = PSSendP1;

#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg	= _PSSendP1;
   //End PS Debug
#endif
   }

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

/*
Name:    PSSendP1
Desc:    Interrupt action for TX interrupt following transmission of the
         INS byte of a Command Header.  See ISO/IEC 7816-3 8.2.1.
         This interrupt causes the P1 byte to be sent and changes interrupt
         handler to send P2 byte on next interrupt.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSSendP1(void)
   {
   PSSend(PSCommandBuffer.P1);
   PSIntAction = PSSendP2;

#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg	= _PSSendP2;
   //End PS Debug
#endif
   }

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

/*
Name:    PSSendP2
Desc:    Interrupt action for TX interrupt following transmission of a
         P1 byte of a Command Header.  See ISO/IEC 7816-3 8.2.1.
         This interrupt causes the P2 byte to be sent and changes interrupt
         handler to send P3 byte on next interrupt.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSSendP2(void)
   {
   PSSend(PSCommandBuffer.P2);
   PSIntAction = PSSendP3;

#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg	= _PSSendP3;
   //End PS Debug
#endif
   }

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

/*
Name:    PSSendP3
Desc:    Interrupt action for TX interrupt following transmission of a
         P2 byte of a Command Header.  See ISO/IEC 7816-3 8.2.1.
         This interrupt causes the P3 byte to be sent and changes interrupt
         handler to change the UART to receive the procedure byte once the
         P3 byte has been transmitted.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSSendP3(void)
   {
   PSSend(PSCommandBuffer.P3);
   PSIntAction = PSTXOneByte;

#if SIM_DEBUG == SIM_DEBUG_MAX
   //PS Debug...
   OldIntAction_Dbg = NewIntAction_Dbg;
   NewIntAction_Dbg	= _PSTXOneByte;
   //End PS Debug
#endif
   }

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

/*
Name:    PSTXOneByte
Desc:    Interrupt action for TX interrupt following transmission of a
         P3 byte of a Command Header, or any data byte in 'Single Shot' mode.
         See ISO/IEC 7816-3 8.2.2.
         This interrupt changes the UART to receive mode in order to receive
         a Procedure Byte, or Status Bytes.
         If there is no further data to transfer The interrupt handler is
         changed to wait for the status bytes.  If more data is to be
         transferred The interrupt handler is changed to wait for a procedure
         byte.
Params:  None
Returns: Nothing
Caveats:
*/

static void PSTXOneByte(void)
   {
   INT16 APDULength;

   PSChangeTXtoRX();

   // Check for FETCH command for which P3 is encoded as 0 for a 256 byte transfer.
   if (PSCommandBuffer.INS == 0x12) 
   {
      APDULength = (INT16)GetAPDULength(PSCommandBuffer.P3);
   }
   else
   {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产无一区二区| 欧美日韩亚洲丝袜制服| 91丨九色丨国产丨porny| 色婷婷久久综合| 91精品福利在线一区二区三区| 久久综合成人精品亚洲另类欧美| 欧美激情综合在线| 亚洲高清视频中文字幕| 美女视频第一区二区三区免费观看网站| 国产在线精品免费| 91老师片黄在线观看| 欧美高清精品3d| 亚洲国产成人在线| 日本最新不卡在线| 国产99久久精品| 欧美日韩精品免费观看视频| 欧美精品一区二区三区一线天视频| 亚洲欧美综合色| 免费在线观看成人| bt欧美亚洲午夜电影天堂| 欧美日韩大陆一区二区| 欧美国产精品v| 日本三级韩国三级欧美三级| 风间由美一区二区av101| 欧美日韩中文字幕一区| 久久精品在线观看| 视频一区免费在线观看| 91欧美一区二区| 久久婷婷一区二区三区| 亚洲午夜久久久久中文字幕久| 韩国精品久久久| 欧美日韩美女一区二区| 国产精品色眯眯| 极品少妇xxxx精品少妇偷拍| 91成人免费在线视频| 国产欧美一区二区三区沐欲| 日韩影视精彩在线| 色婷婷亚洲综合| 中文字幕欧美区| 激情综合网av| 91精品福利在线一区二区三区 | 日韩av一区二区在线影视| 粉嫩13p一区二区三区| 91精品国产综合久久久蜜臀粉嫩| 亚洲色图欧洲色图| 成人午夜av电影| 久久影院电视剧免费观看| 日韩精品一二区| 欧美日韩不卡一区二区| 亚洲免费在线观看视频| 成人综合婷婷国产精品久久蜜臀 | 麻豆91在线观看| 欧美日韩性生活| 亚洲人妖av一区二区| 成人性生交大合| 久久精品男人天堂av| 奇米影视7777精品一区二区| 欧美日韩一区久久| 亚洲一区二区三区视频在线| 成人国产精品免费观看| 国产农村妇女精品| 国产精品1区2区3区| 精品国产91亚洲一区二区三区婷婷| 五月激情综合色| 欧美日韩国产成人在线免费| 一区二区三区毛片| 色综合久久久久网| 亚洲视频免费在线| 91丨porny丨首页| 亚洲男女毛片无遮挡| 99久久久无码国产精品| 国产精品久久久久影视| 成人黄色免费短视频| 国产精品传媒视频| 99久久伊人网影院| 亚洲欧美日韩中文播放| 91福利视频久久久久| 亚洲网友自拍偷拍| 欧美性猛交xxxxxxxx| 亚洲国产精品精华液网站| 色一区在线观看| 亚洲成在线观看| 91精品国产综合久久久久久| 免费一级片91| 久久综合国产精品| 成人av在线资源网| 亚洲欧美日本在线| 欧美三电影在线| 麻豆91精品91久久久的内涵| 欧美成人性战久久| 国产成人在线影院 | 在线观看日韩精品| 亚洲成人免费影院| 精品污污网站免费看| 久久精品欧美一区二区三区不卡| 亚洲成人免费av| 欧美不卡视频一区| 亚洲欧洲av色图| 欧美videossexotv100| 亚洲免费观看高清在线观看| 肉色丝袜一区二区| 日韩欧美一级在线播放| **欧美大码日韩| 亚洲免费视频中文字幕| 日韩精品一区二区三区视频| 中文字幕一区在线观看| 精品一区二区三区不卡| 在线观看国产日韩| 99久免费精品视频在线观看| 欧美一区二区三区免费观看视频| 国产精品456| 91视频你懂的| 亚洲国产成人精品视频| 一区二区三区中文字幕| 国产女同性恋一区二区| 国产精品狼人久久影院观看方式| 欧美影院一区二区| 欧美色涩在线第一页| 欧美午夜在线一二页| 国产精品一区三区| 成人免费视频播放| 色综合久久中文字幕| 国产调教视频一区| 国产综合久久久久久鬼色| 最新欧美精品一区二区三区| 亚洲色图欧洲色图| 在线免费观看日本欧美| 欧美一卡2卡三卡4卡5免费| 国产日韩亚洲欧美综合| 亚洲精品日产精品乱码不卡| 亚洲午夜私人影院| 午夜视频久久久久久| 六月丁香综合在线视频| 无码av中文一区二区三区桃花岛| 国产ts人妖一区二区| 91在线观看污| 欧美三级三级三级爽爽爽| 一区二区不卡在线视频 午夜欧美不卡在 | 日韩欧美国产系列| 久久99精品一区二区三区三区| 久久精品水蜜桃av综合天堂| 精品视频1区2区3区| 日本不卡视频在线| 丰满亚洲少妇av| 亚洲自拍欧美精品| 久久成人免费网| 成人av在线一区二区三区| 国产麻豆精品视频| 欧美一卡二卡三卡| 欧美日韩国产系列| 日韩视频在线永久播放| 一区二区在线免费| 亚洲国产日韩一区二区| 精品久久免费看| 日韩精品一区在线观看| 亚洲一卡二卡三卡四卡无卡久久 | 欧美一级爆毛片| 久久国产欧美日韩精品| 欧美一区二区精美| 国产一区二区三区香蕉| 青青草原综合久久大伊人精品| 国产亚洲福利社区一区| 91女厕偷拍女厕偷拍高清| 欧美精选在线播放| 日韩美女一区二区三区四区| 高清不卡在线观看av| 亚洲丰满少妇videoshd| 精品国产91久久久久久久妲己| 欧美精品一区二区在线观看| 欧美最猛黑人xxxxx猛交| 国产一区二区福利| 亚洲黄一区二区三区| 欧美三级三级三级爽爽爽| 在线中文字幕不卡| 91免费精品国自产拍在线不卡| 国产一区二区中文字幕| 青青草原综合久久大伊人精品优势| 91蝌蚪porny九色| 精品一区二区在线看| 欧美国产在线观看| 中文字幕一区二区三| 亚洲风情在线资源站| 午夜天堂影视香蕉久久| 日韩一区二区免费在线观看| 精品视频999| 26uuu国产一区二区三区| 日韩欧美aaaaaa| 午夜精品福利一区二区三区av| 免费成人av在线| 99在线精品免费| 色欧美88888久久久久久影院| 777xxx欧美| 日韩一区二区在线播放| 中文字幕亚洲在| 偷拍日韩校园综合在线| 国产在线精品一区二区夜色| 成人一区二区三区在线观看| 成人精品国产一区二区4080| www.亚洲精品| 欧美日韩国产区一|