Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

SmartCardMBS constants

Attribute IDs

Constant Value Description
kAttributeAtrString 590595 Answer to reset (ATR) string.
kAttributeChannelId 131344 DWORD encoded as &hDDDDCCCC, where DDDD = data channel type and CCCC = channel number.

The following encodings are defined for DDDD:
&h01 serial I/O; CCCC is a port number.
&h02 parallel I/O; CCCC is a port number.
&h04 PS/2 keyboard port; CCCC is zero.
&h08 SCSI; CCCC is SCSI ID number.
&h10 IDE; CCCC is device number.
&h20 USB; CCCC is device number.
&hFy vendor-defined interface with y in the range zero through 15; CCCC is vendor defined.
kAttributeCharacteristics 393552 Integer indicating which mechanical characteristics are supported. If zero, no special characteristics are supported.
Note that multiple bits can be set:
&h00000001 Card swallowing mechanism
&h00000002 Card ejection mechanism
&h00000004 Card capture mechanism
All other values are reserved for future use (RFU).
kAttributeCurrentBwt 524809 Current block waiting time.
kAttributeCurrentClk 524802 Current clock rate, in kHz.
kAttributeCurrentCwt 524810 Current character waiting time.
kAttributeCurrentD 524804 Bit rate conversion factor.
kAttributeCurrentEbcEncoding 524811 Current error block control encoding.
0 = longitudinal redundancy check (LRC)
1 = cyclical redundancy check (CRC)
kAttributeCurrentF 524803 Clock conversion factor.
kAttributeCurrentIfsc 524807 Current byte size for information field size card.
kAttributeCurrentIfsd 524808 Current byte size for information field size device.
kAttributeCurrentIoState 590594 Current IO state
kAttributeCurrentN 524805 Current guard time.
kAttributeCurrentProtocolType 524801 Integer encoded as 0x0rrrpppp where rrr is RFU and should be 0x000. pppp encodes the current protocol type. Whichever bit has been set indicates which ISO protocol is currently in use. (For example, if bit zero is set, T=0 protocol is in effect.)
kAttributeCurrentW 524806 Current work waiting time.
kAttributeDefaultClk 196897 Default clock rate, in kHz.
kAttributeDefaultDataRate 196899 Default data rate, in bps.
kAttributeDeviceFriendlyNameA 2147418115 Reader's display name. Windows ANSI encoding.
kAttributeDeviceFriendlyNameW 2147418117 Reader's display name. Unicode encoding.
kAttributeDeviceInUse 2147418114 Reserved for future use.
kAttributeDeviceSystemNameA 2147418116 Reader's system name. Windows ANSI encoding.
kAttributeDeviceSystemNameW 2147418118 Reader's system name. Unicode encoding.
kAttributeDeviceUnit 2147418113 Instance of this vendor's reader attached to the computer. The first instance will be device unit 0, the next will be unit 1 (if it is the same brand of reader) and so on. Two different brands of readers will both have zero for this value.
kAttributeEscAuthrequest 499717 Esc authentication request
kAttributeEscCancel 499715 Esc cancel
kAttributeEscReset 499712 Esc reset
kAttributeExtendedBwt 524812 Extended block wait time.
kAttributeIccInterfaceStatus 590593 Single byte. Zero if smart card electrical contact is not active; nonzero if contact is active.
kAttributeIccPresence 590592 Single byte indicating smart card presence:
0 = not present
1 = card present but not swallowed (applies only if reader supports smart card swallowing)
2 = card present (and swallowed if reader supports smart card swallowing)
4 = card confiscated.
kAttributeIccTypePerAtr 590596 Single byte indicating smart card type.
0 = unknown type
1 = 7816 Asynchronous
2 = 7816 Synchronous
Other values RFU.
kAttributeMaxClk 196898 Maximum clock rate, in kHz.
kAttributeMaxDataRate 196900 Maximum data rate, in bps.
kAttributeMaxIfsd 196901 Maximum bytes for information file size device.
kAttributeMaxinput 499719 Maximum input
kAttributePowerMgmtSupport 262449 Zero if device does not support power down while smart card is inserted. Nonzero otherwise.
kAttributeProtocolTypes 196896 Integer encoded as 0x0rrrpppp where rrr is RFU and should be 0x000.
pppp encodes the supported protocol types. A '1' in a given bit position indicates support for the associated ISO protocol, so if bits zero and one are set, both T=0 and T=1 protocols are supported.
kAttributeSupressT1IfsRequest 2147418119 Supress T1 information file size request.
kAttributeUserAuthInputDevice 328002 User authentication input device.
kAttributeUserToCardAuthDevice 328000 User to card authentication device
kAttributeVendorIfdSerialNo 65795 Vendor-supplied interface device serial number.
kAttributeVendorIfdType 65793 Vendor-supplied interface device type (model designation of reader).
kAttributeVendorIfdVersion 65794 Vendor-supplied interface device version (DWORD in the form 0xMMmmbbbb where MM = major version, mm = minor version, and bbbb = build number).
kAttributeVendorName 65792 Vendor name.

Card States

Constant Value Description
kCardStateAbsent 2 There is no card in the reader.
kCardStateNegotiable 32 The card has been reset and is awaiting PTS negotiation.
kCardStatePowered 16 Power is being provided to the card, but the reader driver is unaware of the mode of the card.
kCardStatePresent 4 There is a card in the reader, but it has not been moved into position for use.
kCardStateSpecific 64 The card has been reset and specific communication protocols have been established.
kCardStateSwallowed 8 There is a card in the reader in position for use. The card is not powered.
kCardStateUnknown 1 Unknown state.

Card Initialization Modes

Constant Value Description
kEjectCard 3 Eject card.
kLeaveCard 0 Do not do anything special on reconnect.
kResetCard 1 Reset the card (Warm Reset).
kUnpowerCard 2 Power down the card and reset it (Cold Reset).


Constant Value Description
kProtocolAny 3 Any protocol is welcome
kProtocolRAW 4 Raw protocol
kProtocolT0 1 T=0 is the active protocol.
kProtocolT1 2 T=1 is the active protocol.
kProtocolT15 8 T=15 protocol (not on Windows)
kProtocolUndefined 0 kShareDirect has been specified, so that no protocol negotiation has occurred. It is possible that there is no card in the reader.
kProtocolUnset 0 Unset

Share Modes

Constant Value Description
kShareDirect 3 This application is allocating the reader for its private use, and will be controlling it directly. No other applications are allowed access to it.
kShareExclusive 1 This application is not willing to share the card with other applications.
kShareShared 2 This application is willing to share the card with other applications.

MBS Xojo blog