HealthCardCommandBuilder
public class HealthCardCommandBuilder
Builder to assemble an instance of HealthCardCommand
which is holding a CommandType
and a dictionary responseStatuses [UInt16: ResponseStatus].
Note
This builder is extended by static convenience functions which provide fully configured instances ofHealthCardCommandBuilder
for their respective use cases (e.g. Select, Activate, …)
Usage Example:
let hcc: HealthCardCommand = try HealthCardCommandBuilder.Erase.eraseFileCommand().build()
-
Constructor of this builder containing all parameters.
Declaration
Swift
public init(cla: UInt8, ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, ne: Int? = nil, responseStatuses: [UInt16: ResponseStatus])
-
Convenience constructor initializing this class with some default values to be overwritten.
Declaration
Swift
public convenience init()
-
Constructs a
HealthCardCommand
from this builder instance. Returns:HealthCardCommand
Declaration
Swift
public func build() throws -> HealthCardCommand
-
Deconstruct(s) a given
HealthCardCommand
back into a builder. Parameter: - healthCardCommand: theHealthCardCommand
theHealthCardCommandBuilder
will copy the parameters from Returns:HealthCardCommandBuilder
holding the properties of the givenHealthCardCommand
Declaration
Swift
public static func builder(from healthCardCommand: HealthCardCommand) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with cla set.Declaration
Swift
public func set(cla: UInt8) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with ins set.Declaration
Swift
public func set(ins: UInt8) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with p1 set.Declaration
Swift
public func set(p1: UInt8) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with p2 set.Declaration
Swift
public func set(p2: UInt8) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with data set.Declaration
Swift
public func set(data: Data?) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with data appended to existing data.Declaration
Swift
public func add(data: Data) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with ne set.Declaration
Swift
public func set(ne: Int?) -> HealthCardCommandBuilder
-
Returns a
HealthCardCommandBuilder
with responseStatuses set.Declaration
Swift
public func set(responseStatuses: [UInt16 : ResponseStatus]) -> HealthCardCommandBuilder
-
Marker for setting the first bit (i.e. 0x80) when working with
ShortFileIdentifier
Declaration
Swift
public static let sfidMarker: UInt8
-
Undocumented
See moreDeclaration
Swift
public enum InvalidArgument : Swift.Error, Equatable