pairing public
This commit is contained in:
parent
3f8ce4fdda
commit
4f3b21efc6
|
@ -4,8 +4,8 @@ import CryptoSwift
|
||||||
public class KeycardCommandSet {
|
public class KeycardCommandSet {
|
||||||
let cardChannel: CardChannel
|
let cardChannel: CardChannel
|
||||||
let secureChannel: SecureChannel
|
let secureChannel: SecureChannel
|
||||||
var info: ApplicationInfo?
|
public var info: ApplicationInfo?
|
||||||
var pairing: Pairing? { get { secureChannel.pairing } set { secureChannel.pairing = newValue }}
|
public var pairing: Pairing? { get { secureChannel.pairing } set { secureChannel.pairing = newValue }}
|
||||||
|
|
||||||
public init(cardChannel: CardChannel) {
|
public init(cardChannel: CardChannel) {
|
||||||
self.cardChannel = cardChannel
|
self.cardChannel = cardChannel
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
struct Pairing {
|
public struct Pairing {
|
||||||
let pairingKey: [UInt8]
|
public let pairingKey: [UInt8]
|
||||||
let pairingIndex: UInt8
|
public let pairingIndex: UInt8
|
||||||
|
|
||||||
var bytes: [UInt8] {
|
public var bytes: [UInt8] {
|
||||||
get {
|
get {
|
||||||
return [pairingIndex] + pairingKey
|
return [pairingIndex] + pairingKey
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init(pairingKey: [UInt8], pairingIndex: UInt8) {
|
public init(pairingKey: [UInt8], pairingIndex: UInt8) {
|
||||||
self.pairingKey = pairingKey
|
self.pairingKey = pairingKey
|
||||||
self.pairingIndex = pairingIndex
|
self.pairingIndex = pairingIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
init(pairingData: [UInt8]) {
|
public init(pairingData: [UInt8]) {
|
||||||
self.pairingIndex = pairingData[0]
|
self.pairingIndex = pairingData[0]
|
||||||
self.pairingKey = Array(pairingData[1...])
|
self.pairingKey = Array(pairingData[1...])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue