/packages/apps/Nfc/src/com/android/nfc/snep/ |
D | SnepMessenger.java | 47 public void sendMessage(SnepMessage msg) throws IOException { in sendMessage() 51 remoteContinue = SnepMessage.RESPONSE_CONTINUE; in sendMessage() 53 remoteContinue = SnepMessage.REQUEST_CONTINUE; in sendMessage() 71 SnepMessage snepResponse; in sendMessage() 73 snepResponse = SnepMessage.fromByteArray(responseBytes); in sendMessage() 95 snepResponse = SnepMessage.fromByteArray(responseBytes); in sendMessage() 118 snepResponse = SnepMessage.fromByteArray(responseBytes); in sendMessage() 134 public SnepMessage getMessage() throws IOException, SnepException { in getMessage() 146 fieldContinue = SnepMessage.REQUEST_CONTINUE; in getMessage() 147 fieldReject = SnepMessage.REQUEST_REJECT; in getMessage() [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 (NfcService.sIsDtaMode && ((request.getLength() > SnepMessage.MAL_IUT) || in handleRequest() 159 request.getLength() == SnepMessage.MAL)) { in handleRequest() [all …]
|
D | SnepMessage.java | 31 public final class SnepMessage { class 70 public static SnepMessage getGetRequest(int acceptableLength, NdefMessage ndef) { in getGetRequest() 71 return new SnepMessage(VERSION, REQUEST_GET, 4 + ndef.toByteArray().length, in getGetRequest() 75 public static SnepMessage getPutRequest(NdefMessage ndef) { in getPutRequest() 76 return new SnepMessage(VERSION, REQUEST_PUT, ndef.toByteArray().length, 0, ndef); in getPutRequest() 79 public static SnepMessage getMessage(byte field) { in getMessage() 80 return new SnepMessage(VERSION, field, 0, 0, null); in getMessage() 83 public static SnepMessage getSuccessResponse(NdefMessage ndef) { in getSuccessResponse() 85 return new SnepMessage(VERSION, RESPONSE_SUCCESS, 0, 0, null); in getSuccessResponse() 87 return new SnepMessage(VERSION, RESPONSE_SUCCESS, ndef.toByteArray().length, 0, ndef); in getSuccessResponse() [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/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/sneptest/ |
D | DtaSnepClient.java | 35 import com.android.nfc.snep.SnepMessage; 98 put(SnepMessage.getSmallNdef()); in DtaClientOperations() 99 dtaServiceConnector.sendMessage(SnepMessage.getSmallNdef().toString()); in DtaClientOperations() 113 put(SnepMessage.getSmallNdef()); in DtaClientOperations() 114 dtaServiceConnector.sendMessage(SnepMessage.getSmallNdef().toString()); in DtaClientOperations() 128 put(SnepMessage.getSmallNdef()); in DtaClientOperations() 129 dtaServiceConnector.sendMessage(SnepMessage.getSmallNdef().toString()); in DtaClientOperations() 143 put(SnepMessage.getSmallNdef()); in DtaClientOperations() 144 dtaServiceConnector.sendMessage(SnepMessage.getSmallNdef().toString()); in DtaClientOperations() 158 put(SnepMessage.getLargeNdef()); in DtaClientOperations() [all …]
|
D | ExtDtaSnepServer.java | 30 import com.android.nfc.snep.SnepMessage; 55 public SnepMessage doPut(NdefMessage msg); in doPut() 56 public SnepMessage doGet(int acceptableLength, NdefMessage msg); in doGet() 114 SnepMessage request; in handleRequest() 120 messenger.sendMessage(SnepMessage.getMessage( in handleRequest() 121 SnepMessage.RESPONSE_BAD_REQUEST)); in handleRequest() 126 if (((request.getVersion() & 0xF0) >> 4) != SnepMessage.VERSION_MAJOR) { in handleRequest() 127 messenger.sendMessage(SnepMessage.getMessage( in handleRequest() 128 SnepMessage.RESPONSE_UNSUPPORTED_VERSION)); in handleRequest() 129 …} else if ((request.getLength() > SnepMessage.MAL_IUT) || request.getLength() == SnepMessage.MAL) { in handleRequest() [all …]
|
/packages/apps/Nfc/src/com/android/nfc/ |
D | P2pLinkManager.java | 36 import com.android.nfc.snep.SnepMessage; 865 SnepMessage snepResponse = snepClient.get(request); in doHandover() 996 public SnepMessage doPut(NdefMessage msg) { 1001 return SnepMessage.getMessage(SnepMessage.RESPONSE_SUCCESS); 1005 public SnepMessage doGet(int acceptableLength, NdefMessage msg) { 1021 return SnepMessage.getSuccessResponse(response); 1023 return SnepMessage.getMessage(SnepMessage.RESPONSE_NOT_IMPLEMENTED); 1029 public SnepMessage doPut(NdefMessage msg) { 1031 return SnepMessage.getMessage(SnepMessage.RESPONSE_SUCCESS); 1035 public SnepMessage doGet(int acceptableLength, NdefMessage msg) { [all …]
|