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
HealthCardCommandfrom this builder instance. Returns:HealthCardCommandDeclaration
Swift
public func build() throws -> HealthCardCommand -
Deconstruct(s) a given
HealthCardCommandback into a builder. Parameter: - healthCardCommand: theHealthCardCommandtheHealthCardCommandBuilderwill copy the parameters from Returns:HealthCardCommandBuilderholding the properties of the givenHealthCardCommandDeclaration
Swift
public static func builder(from healthCardCommand: HealthCardCommand) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith cla set.Declaration
Swift
public func set(cla: UInt8) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith ins set.Declaration
Swift
public func set(ins: UInt8) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith p1 set.Declaration
Swift
public func set(p1: UInt8) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith p2 set.Declaration
Swift
public func set(p2: UInt8) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith data set.Declaration
Swift
public func set(data: Data?) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith data appended to existing data.Declaration
Swift
public func add(data: Data) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith ne set.Declaration
Swift
public func set(ne: Int?) -> HealthCardCommandBuilder -
Returns a
HealthCardCommandBuilderwith responseStatuses set.Declaration
Swift
public func set(responseStatuses: [UInt16 : ResponseStatus]) -> HealthCardCommandBuilder
-
Marker for setting the first bit (i.e. 0x80) when working with
ShortFileIdentifierDeclaration
Swift
public static let sfidMarker: UInt8 -
Undocumented
See moreDeclaration
Swift
public enum InvalidArgument : Swift.Error, Equatable