CodingMerc
CodingMerc

Reputation: 41

PPS (Protocol and Parameter Selection) command - Global Platform Scripting

I am trying to set PPS on Smartcard. The environment I am using is based on Global Platform scripting. The command description:

Boolean pps(Number protocol) 
Boolean pps(Number protocol, Number f, Number d) 

Set the physical protocol for the card. The GP scripting language provides support for contact smart cards through ISO7816. Other proprietary protocols can be supported, but depend on support by the environment implementing the GP scripting language. If the method executes successfully, then a true Boolean value is returned. Otherwise, if the parameters are valid, but the environment cannot execute the method for the smart card represented by card, then a false value is returned. If invalid values (i.e., values not specified in this specification or values not supported by the environment) for any of the parameters protocol, f, or d are provided, then a GPError object is generated with GPError.INVALID_DATA value.

Sample:

// On a card with a contact interface 
this.card.pps(Card.T1, myFrequency, myDivisor); 
// returns false value if the card doesn’t support T=1 protocol

protocol

The protocol parameter will contain the desired protocol value corresponding to a value defined as supported in the Card Profile. Valid values for contact cards (via ISO7816) are:

Card.T0
Card.T1
Card.T14

If any of the above values are specified, then the f and d parameters are also required. For a proprietary protocol supported by the card, a unique protocol value supported by the environment can be used, as long as it does not conflict with the values defined for the Card constants. The following is a default constant for representing non-standard protocols :
Card.OTHER
Refer to ISO specifications for ISO7816.

f - Clock rate conversion factor
d - Number Baud rate adjustment factor

According to GP platform description my command for baud rate 38400 looks following:

  this.card.reset( Card.RESET_COLD );
  this.card.pps(Card.T1, 372, 4);

The response I receive from PPS is false. The cold ATR is: 3B680000990200D103042201

The questions:

ATR:

Upvotes: 1

Views: 2543

Answers (1)

guidot
guidot

Reputation: 5333

Partial answer due to lack of Javacard experience:

If I understand correctly, you want to set-up your card, so it accepts PPS. (The reader has to trigger it, so the card can only indicate capabilities.)

  • Your ATR has to provide a TA1 byte to indicate its PPS support to the reader. For an external clock of 3.57 Mhz this has to be 13 if 38400 bit/s are desired maximum.
  • Note, that PPS just establishes division factors to be applied to external clock. If the reader provides a different clock than 3.57 MHz, your communication rate will scale directly proportional. (For other clock ranges the high nibble of TA1 indicating Fi has to be changed, according to ISO 7816-3)
  • PPS is only possible after reset.

Upvotes: 2

Related Questions