Skip to content

Commit

Permalink
Add FeliCa tag reset mode commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Karibash committed Jul 14, 2020
1 parent a3f06aa commit 49b4f12
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Sources/NFCTagReader/NFCFeliCaTag+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public typealias RxNFCFelicaReadWithoutEncryptionResponse = (statusFlag1: Int, s
@available(iOS 13.0, *)
public typealias RxNFCFelicaRequestSpecificationVersionResponse = (statusFlag1: Int, statusFlag2: Int, basicVersion: Data, optionVersion: Data)

@available(iOS 13.0, *)
public typealias RxNFCFelicaResetModeResponse = (statusFlag1: Int, statusFlag2: Int)

// MARK: - Extensions -

@available(iOS 13.0, *)
Expand Down Expand Up @@ -150,4 +153,19 @@ extension ObservableType where Element == NFCFeliCaTag {
}
}

public func resetMode() -> Observable<RxNFCFelicaResetModeResponse> {
flatMap { tag in
Single.create { observer in
tag.resetMode { statusFlag1, statusFlag2, error in
if error != nil {
observer(.error(error!))
} else {
observer(.success((statusFlag1, statusFlag2)))
}
}
return Disposables.create()
}
}
}

}

0 comments on commit 49b4f12

Please sign in to comment.