Class: ISO7816::Card::Card
- Inherits:
-
Object
- Object
- ISO7816::Card::Card
- Defined in:
- lib/7816/card.rb
Overview
Dummy implementation of ‘Card` to describe the provided interface
Direct Known Subclasses
Instance Attribute Summary collapse
-
#atr ⇒ Object
readonly
Returns the value of attribute atr.
Instance Method Summary collapse
-
#connect ⇒ Object
Set up a connection to this card and return the ATR String.
-
#disconnect ⇒ Object
disconnect from the card and free all resources.
-
#receive(le = 1024) ⇒ Object
receive a response from the card, optionally pass in the number of expected bytes in the response, this value will be 1024 by default, which should be enough to hold most responses sent by a card.
- #reconnect ⇒ Object
-
#send(bytes = "") ⇒ Object
Send bytes to the card.
- #t0? ⇒ Boolean
Instance Attribute Details
#atr ⇒ Object (readonly)
Returns the value of attribute atr.
7 8 9 |
# File 'lib/7816/card.rb', line 7 def atr @atr end |
Instance Method Details
#connect ⇒ Object
Set up a connection to this card and return the ATR String. May be called with a block which will be passed ‘self`. Card will call `disconnect` at the end of the block
11 12 13 |
# File 'lib/7816/card.rb', line 11 def connect raise "not implemented, use a subclass of `Card`!" end |
#disconnect ⇒ Object
disconnect from the card and free all resources.
16 17 18 |
# File 'lib/7816/card.rb', line 16 def disconnect raise "not implemented, use a subclass of `Card`!" end |
#receive(le = 1024) ⇒ Object
receive a response from the card, optionally pass in the number of expected bytes in the response, this value will be 1024 by default, which should be enough to hold most responses sent by a card.
34 35 36 |
# File 'lib/7816/card.rb', line 34 def receive le=1024 raise "not implemented, use a subclass of `Card`!" end |
#reconnect ⇒ Object
25 26 27 28 |
# File 'lib/7816/card.rb', line 25 def reconnect disconnect connect end |
#send(bytes = "") ⇒ Object
Send bytes to the card.
21 22 23 |
# File 'lib/7816/card.rb', line 21 def send bytes="" raise "not implemented, use a subclass of `Card`!" end |
#t0? ⇒ Boolean
38 39 40 |
# File 'lib/7816/card.rb', line 38 def t0? raise "not implemented, use a subclass of `Card`!" end |