Esp3RdVersionResponse extends Esp3ResponsePacket { public String getAppDescription() { return appDescription; } Esp3RdVersionResponse(byte[] data); Version getAppVersion(); Version getApiVersion(); DeviceID getChipID(); String getAppDescription(); static final int ESP3_RESPONSE_RD_VERSION_APP_VERSION_INDEX; static final int ESP3_RESPONSE_RD_VERSION_API_VERSION_INDEX; static final int ESP3_RESPONSE_RD_VERSION_CHIP_ID_INDEX; static final int ESP3_RESPONSE_RD_VERSION_CHIP_VERSION_INDEX; static final int ESP3_RESPONSE_RD_VERSION_APP_DESC_INDEX; static final int ESP3_RESPONSE_RD_VERSION_APP_VERSION_LENGTH; static final int ESP3_RESPONSE_RD_VERSION_API_VERSION_LENGTH; static final int ESP3_RESPONSE_RD_VERSION_CHIP_ID_LENGTH; static final int ESP3_RESPONSE_RD_VERSION_CHIP_VERSION_LENGTH; static final int ESP3_RESPONSE_RD_VERSION_APP_DESC_LENGTH; static final int ESP3_RESPONSE_RD_VERSION_DATA_LENGTH; }
@Test public void testAppDescription() throws Exception { appDescription = "123456"; byte[] dataBytes = createResponseDataBytes(); Esp3RdVersionResponse response = new Esp3RdVersionResponse(dataBytes); Assert.assertEquals(appDescription, response.getAppDescription()); appDescription = ""; dataBytes = createResponseDataBytes(); response = new Esp3RdVersionResponse(dataBytes); Assert.assertEquals(appDescription, response.getAppDescription()); StringBuffer buf = new StringBuffer(); for(int i = 0; i < Esp3RdVersionResponse.ESP3_RESPONSE_RD_VERSION_APP_DESC_LENGTH; i++) { buf.append((char)('A' + i)); } appDescription = new String(buf); dataBytes = createResponseDataBytes(); response = new Esp3RdVersionResponse(dataBytes); Assert.assertEquals(appDescription, response.getAppDescription()); }