This is a wrapper plugin that allows you to read different cards with a Sunmi device through a Cordova App
cordova plugin add https://github.com/PirataFrancis/sunmi-card-reader.git
Start reading cards info
- cardsTypeToRead: Array of Integers (one Int for each card type, see Appendix 1)
window.SunmiCardReader.startReadCard([8])
.then(function(payload){
console.log(payload);
}).catch(function (error) {
console.log(error);
});
Authenticate a Mifare Cards Should be called after startReadCard
- cardBlockPassword: String
- cardKey: Integer (0 for Key A || 1 for Key B)
- blockNumber: Integer
window.SunmiCardReader.authMifare("ffffffffffff",0,5)
.then(function(payload){
console.log(payload);
}).catch(function (error) {
console.log(error);
});
Read a card block Should be called after AuthMifare
- blockToRead: Integer
window.SunmiCardReader.readBlockMifare(5)
.then(function(payload){
console.log(payload);
}).catch(function (error) {
console.log(error);
});
Write Hex into a card block Should be called after AuthMifare
- blockToRead: Integer
- stringToWrite: String
window.SunmiCardReader.writeBlockMifare(5,"12111100000000000000000000000000")
.then(function(payload){
console.log(payload);
}).catch(function (error) {
console.log(error);
});
- 0.0.1
- Work in progress, pushed first 4 functions
I'm Francesco Borrelli an Italian Android Dev, I love coding, software engineering and pizza so feel free contact me about anything 👊 Email Facebook
Distributed under the MIT
license. See LICENSE
for more information.
- Fork it (https://github.com/PirataFrancis/sunmi-card-reader/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request