Searched refs:SnepMessage (Results 1 – 10 of 10) sorted by relevance
/packages/apps/Nfc/tests/src/com/android/nfc/snep/ |
D | SnepBasicTests.java | 55 SnepMessage response = null; in testGetSmallNdef() 57 client.sendMessage(SnepMessage.getGetRequest(ACCEPTABLE_LENGTH, getSmallNdef())); in testGetSmallNdef() 64 assertEquals(SnepMessage.RESPONSE_SUCCESS, response.getField()); in testGetSmallNdef() 86 SnepMessage response = null; in testGetLargeNdef() 88 client.sendMessage(SnepMessage.getGetRequest(ACCEPTABLE_LENGTH, getNdef(900))); in testGetLargeNdef() 95 assertEquals(SnepMessage.RESPONSE_SUCCESS, response.getField()); in testGetLargeNdef() 117 SnepMessage response = null; in testGetExcessiveNdef() 119 client.sendMessage(SnepMessage.getGetRequest(10, getSmallNdef())); in testGetExcessiveNdef() 126 assertEquals(SnepMessage.RESPONSE_EXCESS_DATA, response.getField()); in testGetExcessiveNdef() 148 SnepMessage response = null; in testPutSmallNdef() [all …]
|
D | SnepValidationServerTests.java | 22 import com.android.nfc.snep.SnepMessage; 110 public SnepMessage doPut(NdefMessage msg) { in doPut() 116 return SnepMessage.getMessage(SnepMessage.RESPONSE_SUCCESS); in doPut() 120 public SnepMessage doGet(int acceptableLength, NdefMessage msg) { in doGet() 128 return SnepMessage.getMessage(SnepMessage.RESPONSE_NOT_FOUND); in doGet() 131 return SnepMessage.getMessage(SnepMessage.RESPONSE_EXCESS_DATA); in doGet() 133 return SnepMessage.getSuccessResponse(result); in doGet()
|
D | SnepValidationClientTests.java | 22 import com.android.nfc.snep.SnepMessage; 152 SnepMessage response = client.get(msg); in testUnavailable() 153 assertEquals(SnepMessage.RESPONSE_NOT_FOUND, response.getField()); in testUnavailable() 172 SnepMessage response = client.get(msg); in testUndeliverable() 173 assertEquals(SnepMessage.RESPONSE_EXCESS_DATA, response.getField()); in testUndeliverable()
|
D | SnepDefaultClientTests.java | 22 import com.android.nfc.snep.SnepMessage; 71 SnepMessage response = client.get(getSmallNdef()); in testGetFail() 72 assertEquals(SnepMessage.RESPONSE_NOT_IMPLEMENTED, response.getField()); in testGetFail()
|
D | SnepCustomClientTests.java | 22 import com.android.nfc.snep.SnepMessage; 71 SnepMessage response = client.get(getSmallNdef()); in testGetSmall() 72 assertEquals(SnepMessage.RESPONSE_SUCCESS, response.getField()); in testGetSmall()
|
/packages/apps/Nfc/src/com/android/nfc/snep/ |
D | SnepMessenger.java | 44 public void sendMessage(SnepMessage msg) throws IOException { in sendMessage() 48 remoteContinue = SnepMessage.RESPONSE_CONTINUE; in sendMessage() 50 remoteContinue = SnepMessage.REQUEST_CONTINUE; in sendMessage() 68 SnepMessage snepResponse; in sendMessage() 70 snepResponse = SnepMessage.fromByteArray(responseBytes); in sendMessage() 91 public SnepMessage getMessage() throws IOException, SnepException { in getMessage() 102 fieldContinue = SnepMessage.REQUEST_CONTINUE; in getMessage() 103 fieldReject = SnepMessage.REQUEST_REJECT; in getMessage() 105 fieldContinue = SnepMessage.RESPONSE_CONTINUE; in getMessage() 106 fieldReject = SnepMessage.RESPONSE_REJECT; in getMessage() [all …]
|
D | SnepMessage.java | 27 public final class SnepMessage { class 53 public static SnepMessage getGetRequest(int acceptableLength, NdefMessage ndef) { in getGetRequest() 54 return new SnepMessage(VERSION, REQUEST_GET, 4 + ndef.toByteArray().length, in getGetRequest() 58 public static SnepMessage getPutRequest(NdefMessage ndef) { in getPutRequest() 59 return new SnepMessage(VERSION, REQUEST_PUT, ndef.toByteArray().length, 0, ndef); in getPutRequest() 62 public static SnepMessage getMessage(byte field) { in getMessage() 63 return new SnepMessage(VERSION, field, 0, 0, null); in getMessage() 66 public static SnepMessage getSuccessResponse(NdefMessage ndef) { in getSuccessResponse() 68 return new SnepMessage(VERSION, RESPONSE_SUCCESS, 0, 0, null); in getSuccessResponse() 70 return new SnepMessage(VERSION, RESPONSE_SUCCESS, ndef.toByteArray().length, 0, ndef); in getSuccessResponse() [all …]
|
D | SnepServer.java | 56 public SnepMessage doPut(NdefMessage msg); in doPut() 57 public SnepMessage doGet(int acceptableLength, NdefMessage msg); in doGet() 141 SnepMessage request; in handleRequest() 147 messenger.sendMessage(SnepMessage.getMessage( in handleRequest() 148 SnepMessage.RESPONSE_BAD_REQUEST)); in handleRequest() 155 if (((request.getVersion() & 0xF0) >> 4) != SnepMessage.VERSION_MAJOR) { in handleRequest() 156 messenger.sendMessage(SnepMessage.getMessage( in handleRequest() 157 SnepMessage.RESPONSE_UNSUPPORTED_VERSION)); in handleRequest() 158 } else if (request.getField() == SnepMessage.REQUEST_GET) { in handleRequest() 161 } else if (request.getField() == SnepMessage.REQUEST_PUT) { in handleRequest() [all …]
|
D | SnepClient.java | 105 messenger.sendMessage(SnepMessage.getPutRequest(msg)); in put() 113 public SnepMessage get(NdefMessage msg) throws IOException { in get() 124 messenger.sendMessage(SnepMessage.getGetRequest(mAcceptableLength, msg)); in get()
|
/packages/apps/Nfc/src/com/android/nfc/ |
D | P2pLinkManager.java | 34 import com.android.nfc.snep.SnepMessage; 763 SnepMessage snepResponse = snepClient.get(request); in doHandover() 894 public SnepMessage doPut(NdefMessage msg) { 896 return SnepMessage.getMessage(SnepMessage.RESPONSE_SUCCESS); 900 public SnepMessage doGet(int acceptableLength, NdefMessage msg) { 909 return SnepMessage.getSuccessResponse(response); 911 return SnepMessage.getMessage(SnepMessage.RESPONSE_NOT_IMPLEMENTED);
|