diff --git a/index.html b/index.html index 759467a..3c20c6b 100644 --- a/index.html +++ b/index.html @@ -881,6 +881,8 @@

Web Smart Card API

  • Set connection.[[comm]] to comm.
  • Set connection.[[context]] to this. +
  • Set connection.[[activeProtocol]] to + activeProtocol.
  • Set result["connection"] to connection.
  • If activeProtocol is a valid protocol value, set @@ -1054,6 +1056,12 @@

    Web Smart Card API

    null The SmartCardContext that created this instance. + + [[activeProtocol]] + 0 + The active protocol DWORD, as returned by the platform's + [PCSC5] implementation. +

    5.1 disconnect() method

    @@ -1125,13 +1133,66 @@

    Web Smart Card API

    5.2 transmit() method

    -
    Issue 1
    Write an algorithm for this method.
    +

    The transmit(sendBuffer) method steps + are:

    +
      +
    1. Let promise be a new promise.
    2. +
    3. If + this.[[context]].[[operationInProgress]] + is true, reject promise with a "InvalidStateError" + DOMException and return promise.
    4. +
    5. If this.[[comm]] is null, reject + promise with a "InvalidStateError" DOMException and return + promise.
    6. +
    7. If this.[[activeProtocol]] is not a + valid protocol value, reject promise + with a "InvalidStateError" DOMException and return + promise.
    8. +
    9. Set + this.[[context]].[[operationInProgress]] + to true.
    10. +
    11. Let sendPci be the platform's [PCSC5] + SCARD_IO_HEADER corresponding to + this.[[activeProtocol]].
    12. +
    13. Let pcscSendBuffer be a [PCSC5] BYTE[] + containing sendBuffer.
    14. +
    15. Let recvPci be the platform's SCARD_IO_HEADER + equivalent of empty or null.
    16. +
    17. Let recvBuffer be a BYTE[] big enough to hold + the largest [ISO7186-3] extended response APDU (65538 bytes).
    18. +
    19. Let recvLength be a DWORD set to 0.
    20. +
    21. Run the following steps in parallel: +
        +
      1. Call this.[[comm]].Transmit() + with sendPci, pcscSendBuffer, recvPci, recvBuffer and + recvLength as arguments.
      2. +
      3. Let responseCode be the returned + RESPONSECODE.
      4. +
      5. Queue a global task on the relevant global object of + this using the smart card task source which performs the + following steps: +
          +
        1. Set + this.[[context]].[[operationInProgress]] + to false.
        2. +
        3. If responseCode is not SCARD_S_SUCCESS, reject + promise with a DOMException + corresponding to responseCode and abort + these steps.
        4. +
        5. Resolve promise with an ArrayBuffer containing + the first recvLength bytes of recvBuffer.
        6. +
        +
      6. +
      +
    22. +
    23. Return promise.
    24. +

    5.3 startTransaction() method

    Starts a transaction. The Transaction is ended when the Promise returned by the given callback settles.

    -
    Issue 2
    Write an algorithm for this method.
    +
    Issue 1
    Write an algorithm for this method.

    5.3.1 SmartCardTransactionOptions dictionary

    WebIDLdictionary SmartCardTransactionOptions {
    @@ -1148,7 +1209,7 @@ 

    Web Smart Card API

    5.4 status() method

    Queries the host's PC/SC stack about the current connection status.

    -
    Issue 3
    Write an algorithm for this method.
    +
    Issue 2
    Write an algorithm for this method.

    5.4.1 SmartCardConnectionStatus dictionary

    WebIDLdictionary SmartCardConnectionStatus {
    @@ -1210,17 +1271,17 @@ 

    Web Smart Card API

    commands. The returned Promise might contain output data, if applicable for the given control code. Otherwise the returned buffer will be empty.

    -
    Issue 4
    Write an algorithm for this method.
    +
    Issue 3
    Write an algorithm for this method.

    5.6 getAttribute() method

    Queries a card reader's attribute or capability value, given its tag.

    -
    Issue 5
    Write an algorithm for this method.
    +
    Issue 4
    Write an algorithm for this method.

    5.7 setAttribute() method

    Sets a card reader's attribute or capability.

    -
    Issue 6
    Write an algorithm for this method.
    +
    Issue 5
    Write an algorithm for this method.
    @@ -1475,6 +1536,8 @@

    Web Smart Card API

    § 4.3 connect() method
  • § 5.1 disconnect() method +
  • + § 5.2 transmit() method