Last active
August 29, 2015 14:10
-
-
Save miguelcardo/3c35f015b2c8a6b0c002 to your computer and use it in GitHub Desktop.
Sending an operation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read block 1 of sector 1 of the virtual MIFARE card | |
public int readBlock(String sessionId, HashMap<String, String> pendingOperations) { | |
String url = "https://api.fidesmo.com/mifare/read"; | |
String callbackUrl = Constants.rootUrl + Constants.readBlockCallbackUrl; | |
// Encode the JSON structure with the trailer data for one sector | |
JSONObject payload = new JSONObject(); | |
JSONArray blockData = new JSONArray(); | |
blockData.add(Utils.encodeBlockToRead(1, 1)); | |
payload.put("blocks", blockData); | |
return sendOperationAndProcessResponse(url, callbackUrl, payload, sessionId, pendingOperations); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment