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