id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
21871478_661
{ "fields": [ { "declarator": "PARAMETER_MY = \"MY\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_MY = \"MY\";", "type": "String", "var_name": "PARAMETER_MY" }, { "declarator": "PARAMETER_C0 = \"C0\"", "modifier":...
{ "body": "@Test(expected=InterfaceNotOpenException.class)\n\tpublic void testStopListeningConnectionClosed() throws TimeoutException, XBeeException {\n\t\t// Throw an Interface not open exception when setting any parameter.\n\t\tMockito.doThrow(new InterfaceNotOpenException()).when(ipDevice).setParameter(Mockito.any...
{ "fields": [ { "declarator": "BROADCAST_IP = \"255.255.255.255\"", "modifier": "public static final", "original_string": "public static final String BROADCAST_IP = \"255.255.255.255\";", "type": "String", "var_name": "BROADCAST_IP" }, { "declarator": "OPERATION_EXCEPTI...
{ "body": "public void stopListening() throws TimeoutException, XBeeException {\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)0));\n\t\tsourcePort = 0;\n\t}", "class_method_signature": "IPDevice.stopListening()", "constructor": false, "full_signature": "public void stopListening()", "identifier"...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_374
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.IO_D...
{ "body": "@Test\n\tpublic final void testSetSourceAddressNull() {\n\t\t// Set up the resources for the test.\n\t\tIODataSampleRxIndicatorWifiPacket packet = new IODataSampleRxIndicatorWifiPacket(sourceAddress, rssi, receiveOptions, data);\n\n\t\tsourceAddress = null;\n\n\t\texception.expect(NullPointerException.clas...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"IO...
{ "body": "public void setSourceAddress(Inet4Address sourceAddress) {\n\t\tif (sourceAddress == null)\n\t\t\tthrow new NullPointerException(ERROR_SOURCE_ADDRESS_NULL);\n\n\t\tthis.sourceAddress = sourceAddress;\n\t}", "class_method_signature": "IODataSampleRxIndicatorWifiPacket.setSourceAddress(Inet4Address sourceA...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_724
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testReadBooleanFromByteOffsetNegative() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Bit offset must be between 0 and 7.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils....
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static boolean readBooleanFromByte(byte containerByte, int bitOffset) {\n\t\tif (bitOffset < 0 || bitOffset > 31)\n\t\t\tthrow new IllegalArgumentException(\"Bit offset must be between 0 and 7.\");\n\t\t\n\t\treturn isBitEnabled(containerByte, bitOffset);\n\t}", "class_method_signature": "ByteUtil...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_38
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcast() {\n\t\t// Setup the resources for the test.\n\t\tModemStatusEvent modemStatusEvent = ModemStatusEvent.STATUS_JOINED_NETWORK;\n\t\tModemStatusPacket packet = new ModemStatusPacket(modemStatusEvent);\n\t\t\n\t\t// Call the method under test and verify the result.\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 2", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 2;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "modemStatusEvent", "m...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}", "class_method_signature": "ModemStatusPacket.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean isBroadcast()", "identifier": "isBroadcast", "invocations": [], "modifiers": "@Override public", ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_677
{ "fields": [ { "declarator": "PARAMETER_MY = \"MY\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_MY = \"MY\";", "type": "String", "var_name": "PARAMETER_MY" }, { "declarator": "PARAMETER_C0 = \"C0\"", "modifier":...
{ "body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationSendDataAsync() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that shoul...
{ "fields": [ { "declarator": "BROADCAST_IP = \"255.255.255.255\"", "modifier": "public static final", "original_string": "public static final String BROADCAST_IP = \"255.255.255.255\";", "type": "String", "var_name": "BROADCAST_IP" }, { "declarator": "OPERATION_EXCEPTI...
{ "body": "@Override\n\tpublic void sendDataAsync(RemoteXBeeDevice remoteXBeeDevice, byte[] data)\n\t\t\tthrows XBeeException {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "IPDevice.sendDataAsync(RemoteXBeeDevice remoteXBee...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_227
{ "fields": [ { "declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_SR...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[38];\n\t\tpayload[0] = (byte)frameType;\n\t\tSystem.arraycopy(destAddress.getAddress(), 0, payload, 1, destAddress.getAddress().length);\n\t\tSystem.arraycopy(so...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 39", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 39;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"RX...
{ "body": "public static RXIPv6Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTy...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_732
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testNewByteArrayNullByteArray() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Data cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils.newByteArray(null, 1);\n\t}...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static byte[] newByteArray(byte[] data, int finalSize) {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data cannot be null.\");\n\t\tif (finalSize < 0)\n\t\t\tthrow new IllegalArgumentException(\"Final size must be equal or greater than 0.\");\n\t\t\n\t\tif (finalSize == 0)\n\t\t\tr...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_362
{ "fields": [ { "declarator": "frameType = APIFrameType.RX_SMS.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.RX_SMS.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "phoneNumber = \"555203203\"", ...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNotNull() {\n\t\t// Set up the resources for the test.\n\t\tRXSMSPacket packet = new RXSMSPacket(phoneNumber, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getAPIPacketParameters();\n\n\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH;", "type": "int"...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Phone number\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(phoneNumber)) + \" (\" + new String(phoneNumber).rep...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_698
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testByteArrayToIntLessThan4Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34};\n\t\tint expectedResult = 0x1234;\n\t\t\n\t\t// Call the method under test.\n\t\tint result = ByteUtils.byteArrayToInt(byteArray);\n\t\t\n\t\t// Verify t...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static int byteArrayToInt(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 4) {\n\t\t\tvalues = new byte[4];\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_509
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testEqualsWithDifferentDataBits() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters parameters1 = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\tSerialPortParameters parameters2 = new SerialPortParameters(9600, 7, 1, 0, 0);\n\t\t\n\t\t// Call the method unde...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "baudrate", "modifier": "public final", "original_str...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj instanceof SerialPortParameters)\n\t\t\treturn ((SerialPortParameters)obj).baudrate == baudrate \n\t\t\t\t&& ((SerialPortParameters)obj).dataBits == dataBits \n\t\t\t\t&& ((SerialPortParameters)obj).stopBits == stopBits\n\t\t\t\t&& ((SerialPortP...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_159
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetCommandValue() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tATCommandStatus status = ATCommandStatus.UNKNOWN;\n\t\tString valueToSet = \"newNIValue\";\n\t\tATCommandResponsePacket packet = new ATCommandResponsePack...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "status", "modifier": ...
{ "body": "public byte[] getCommandValue() {\n\t\treturn commandValue;\n\t}", "class_method_signature": "ATCommandResponsePacket.getCommandValue()", "constructor": false, "full_signature": "public byte[] getCommandValue()", "identifier": "getCommandValue", "invocations": [], "modifiers": "public", "para...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_270
{ "fields": [ { "declarator": "frameType = APIFrameType.SEND_DATA_RESPONSE.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.SEND_DATA_RESPONSE.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "frameID = ...
{ "body": "@Test\n\tpublic final void testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tSendDataResponsePacket packet = new SendDataResponsePacket(frameID, status);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet should not be broadcast\", packet.isBroadcast(), i...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 3", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Send...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}", "class_method_signature": "SendDataResponsePacket.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean isBroadcast()", "identifier": "isBroadcast", "invocations": [], "modifiers": "@Override publi...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_620
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/ATCommandExceptionTest.java", "identifier": "ATCommandExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testGetCommandStatus() {\n\t\t// Setup the resources for the test.\n\t\tATCommandStatus atCommandStatus = ATCommandStatus.INVALID_COMMAND;\n\t\tATCommandException e = new ATCommandException(atCommandStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tATCommandStatus result = ...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "DEFAULT_MESSAGE = \"There was a problem s...
{ "body": "public ATCommandStatus getCommandStatus() {\n\t\treturn atCommandStatus;\n\t}", "class_method_signature": "ATCommandException.getCommandStatus()", "constructor": false, "full_signature": "public ATCommandStatus getCommandStatus()", "identifier": "getCommandStatus", "invocations": [], "modifiers...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_80
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetParameterAsStringNullValue() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tATCommandQueuePacket packet = new ATCommandQueuePacket(frameID, command, (String)null);\n\t\t\n\t\t// Call the method under test.\n\t\tStrin...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 4", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "command", "modifier":...
{ "body": "public String getParameterAsString() {\n\t\tif (parameter == null)\n\t\t\treturn null;\n\t\treturn new String(parameter);\n\t}", "class_method_signature": "ATCommandQueuePacket.getParameterAsString()", "constructor": false, "full_signature": "public String getParameterAsString()", "identifier": "ge...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_335
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.RX_I...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete RX IPv4 packet.\")));\n\n\t\t// Call the method under test th...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"RX...
{ "body": "public static RXIPv4Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTy...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_765
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "nb...
{ "body": "@Test\n\tpublic void testGetXBeeProtocol() {\n\t\tassertEquals(nbiotDevice.getXBeeProtocol(), XBeeProtocol.CELLULAR_NBIOT);\n\t}", "class_method_signature": "NBIoTDeviceTest.testGetXBeeProtocol()", "constructor": false, "full_signature": "@Test public void testGetXBeeProtocol()", "identifier": "tes...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/NBIoTDevice.java", "identifier": "NBIoTDevice", "interfaces": "", "methods": [ { "class_method_signature": "NBIoTDevice.NBIoTDevice(String port, int baudRate)", "constructor": true, "full_signature": "public NBIoTDevice(St...
{ "body": "@Override\n\tpublic XBeeProtocol getXBeeProtocol() {\n\t\treturn XBeeProtocol.CELLULAR_NBIOT;\n\t}", "class_method_signature": "NBIoTDevice.getXBeeProtocol()", "constructor": false, "full_signature": "@Override public XBeeProtocol getXBeeProtocol()", "identifier": "getXBeeProtocol", "invocations"...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_572
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetPortDescription() {\n\t\t// Setup the resources for the test.\n\t\tString name = \"/dev/ttyS0\";\n\t\tString description = \"This is another description\";\n\t\tSerialPortInfo info = new SerialPortInfo(name, description);\n\t\t\n\t\t// Call the method under test.\n\t\tStri...
{ "fields": [ { "declarator": "portName", "modifier": "private", "original_string": "private String portName;", "type": "String", "var_name": "portName" }, { "declarator": "portDescription", "modifier": "private", "original_string": "private String portDescr...
{ "body": "public String getPortDescription() {\n\t\treturn portDescription;\n\t}", "class_method_signature": "SerialPortInfo.getPortDescription()", "constructor": false, "full_signature": "public String getPortDescription()", "identifier": "getPortDescription", "invocations": [], "modifiers": "public", ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_122
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Remote AT Command Response packet payload cannot be null.\")));\n\t\t\n\t\t// Call th...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 15", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "public static RemoteATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Remote AT Command Response packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 8 (32-bit address) + 2 (16-bit address) + 2 (AT command) +...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_437
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"FFFF\");\n\t\tint options = 40; /* bit 2 */\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\t...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "transmitOptions", "mo...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn get16bitDestinationAddress().equals(XBee16BitAddress.BROADCAST_ADDRESS);\n\t}", "class_method_signature": "TX16Packet.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean isBroadcast()", "identifier": "isBroadcast"...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_14
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testSetFrameIDBiggerThan255() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 300;\n\t\tTestXBeeAPIPacket packet = new TestXBeeAPIPacket(APIFrameType.GENERIC);\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Fr...
{ "fields": [ { "declarator": "NO_FRAME_ID = 9999", "modifier": "public final static", "original_string": "public final static int NO_FRAME_ID = 9999;", "type": "int", "var_name": "NO_FRAME_ID" }, { "declarator": "frameID = NO_FRAME_ID", "modifier": "protected", ...
{ "body": "public void setFrameID(int frameID) {\n\t\tif (frameID < 0 || frameID > 255)\n\t\t\tthrow new IllegalArgumentException(\"Frame ID must be between 0 and 255.\");\n\t\t\n\t\tif (needsAPIFrameID())\n\t\t\tthis.frameID = frameID;\n\t}", "class_method_signature": "XBeeAPIPacket.setFrameID(int frameID)", "co...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_175
{ "fields": [ { "declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDRESS" ...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[25 + data.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)options;\n\t\tpayload[2] = (byte)method.getValue();\n\t\tSystem.arraycopy(destAdd...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 26", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 26;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Co...
{ "body": "public static CoAPTxRequestPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != API...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_525
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic final void testSetPortParametersNegativeDataBits() throws InvalidConfigurationException, ConnectionException {\n\t\t// Setup the resources for the test.\n\t\tint baudrate = 115200;\n\t\tint dataBits = -7;\n\t\tint stopBits = 2;\n\t\tint parity = 1;\n\t\tint flowControl = 3;\n\t\tTestAbstrac...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "public void setPortParameters(int baudRate, int dataBits, int stopBits, int parity, int flowControl) throws InvalidConfigurationException, ConnectionException {\n\t\tSerialPortParameters parameters = new SerialPortParameters(baudRate, dataBits, stopBits, parity, flowControl);\n\t\tsetPortParameters(paramet...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_460
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"RX16 packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method under test th...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress16", "mo...
{ "body": "public static RX16Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX16 packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 2 (16-bit address) + 1 (signal strength) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_749
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testContainsLettersEmptyParameter() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"\";\n\t\tboolean expectedResult = false;\n\t\t\n\t\t// Call the method under test.\n\t\tboolean result = HexUtils.containsLetters(s);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat...
{ "fields": [ { "declarator": "HEXES = \"0123456789ABCDEF\"", "modifier": "private static final", "original_string": "private static final String HEXES = \"0123456789ABCDEF\";", "type": "String", "var_name": "HEXES" }, { "declarator": "HEX_HEADER = \"0x\"", "modif...
{ "body": "public static boolean containsLetters(String parameter) {\n\t\tif (parameter == null)\n\t\t\tthrow new NullPointerException(\"Parameter cannot be null.\");\n\t\t\n\t\tbyte[] byteArray = parameter.getBytes();\n\t\tfor (int i = 0; i < byteArray.length; i++){\n\t\t\tif (!((byteArray[i] >= '0') && (byteArray[i...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_319
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetRFDataValidData() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tGenericXBeePacket packet = new GenericXBeePacket(data);\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getRFData();\n\t\t\n\t\t/...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 1", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "rfData", "modifier": ...
{ "body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}", "class_method_signature": "GenericXBeePacket.getRFData()", "constructor": false, "full_signature": "public byte[] getRFData()", "identifier": "getRFData", "invocations...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_43
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIDataUnknownTransmitStatus() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.TRANSMIT_STATUS.getValue();\n\t\tint frameID = 0xE7;\n\t\tXBee16BitAddress address = new XBee16BitAddress(\"B45C\");\n\t\tint retryCount = 3;\n\t\tint deliveryStatu...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 7", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 7;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress16", "modi...
{ "body": "public static TransmitStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Transmit Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (16-bit address) + 1 (retry count) + 1 (delivery status) + 1 (discovery stat...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_533
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic final void testFlushNullOutputStream() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tmockOutputStream = null;\n\t\t\n\t\t// Call the method under test.\n\t\tport.flush();\n\t\t\...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "public void flush() {\n\t\tif (getOutputStream() != null) {\n\t\t\ttry {\n\t\t\t\tgetOutputStream().flush();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t}\n\t\t}\n\t}", "class_method_signature": "AbstractSerialPort.flush()", "constructor": false, "full_signature"...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_163
{ "fields": [ { "declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDR" }, ...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[15];\n\t\tpayload[0] = (byte)frameType;\n\t\t// Do not copy the complete IPv6 address.\n\t\tSystem.arraycopy(ipv6address.getAddress(), 0, payload, 1, ipv6address....
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 17", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 17;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"IP...
{ "body": "public static IPv6IODataSampleRxIndicator createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\t// 1 (Frame type) + 8 (32-bit address) + 2 (16-bit address) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthr...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_499
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testParsePacketByteArrayATOperatingMode() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = {0x7E, 0x00, 0x08, 0x08, 0x01, 0x4E, 0x49, 0x41, 0x54, 0x49, (byte)0x81, (byte)0x7E};\n\t\texception.expect(IllegalArgumentException.class);...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "checksum", "modifier": "private", "original_string":...
{ "body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_2
{ "fields": [ { "declarator": "PARAMETER_AI = \"AI\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_AI = \"AI\";", "type": "String", "var_name": "PARAMETER_AI" }, { "declarator": "RESPONSE_AI = new byte[]{0x00}", "m...
{ "body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationGetIOSamplingRate() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in Cellular protocol.\")));\n\t\t\n\t\t// Call the method ...
{ "fields": [ { "declarator": "OPERATION_EXCEPTION = \"Operation not supported in Cellular protocol.\"", "modifier": "private static final", "original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in Cellular protocol.\";", "type": "String", "v...
{ "body": "@Override\n\tpublic int getIOSamplingRate() throws TimeoutException, XBeeException {\n\t\t// Not supported in Cellular.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "CellularDevice.getIOSamplingRate()", "constructor": false, "full_signature": "@O...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_476
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGenerateByteArrayEscaped() {\n\t\t// Setup the resources for the test.\n\t\tfinal byte[] dataArray = new byte[]{0x17, 0x01, 0x00, 0x13, (byte)0xA2, 0x00, 0x40, (byte)0xAD, 0x14, 0x2E, (byte)0xFF, (byte)0xFE, 0x02, 0x4E, 0x49};\n\t\tbyte[] dataArrayEscaped = new byte[]{0x17, 0...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "checksum", "modifier": "private", "original_string":...
{ "body": "public byte[] generateByteArrayEscaped() {\n\t\tbyte[] unescapedArray = generateByteArray();\n\t\tByteArrayOutputStream os = new ByteArrayOutputStream();\n\t\t// Write header byte and do not escape it.\n\t\tos.write(SpecialByte.HEADER_BYTE.getValue());\n\t\tfor (int i = 1; i < unescapedArray.length; i++) {...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_55
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcastWithBroadcastOptionEnabled() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x46; /* bit 1 */\n\t\t...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 12", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 12;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1);\n\t}", "class_method_signature": "IODataSampleRxIndicatorPacket.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean isBroadcast()", "identifier": "isBroadcast", "i...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_134
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Explicit Addressing packet payload cannot be null.\")));\n\t\t\n\t\t// Call the metho...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 20", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 20;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress64", "mo...
{ "body": "public static ExplicitAddressingPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Explicit Addressing packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 8 (64-bit address) + 2 (16-bit address) + 1 (source endpoint) + 1 (des...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_564
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic void testToStringParityEven() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters params = new SerialPortParameters(115200, 7, 2, 2, 3);\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", params));\n\t\tString expected = \"[COM1 - 115200/7/...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "@Override\n\tpublic String toString() {\n\t\tif (parameters != null) {\n\t\t\tString parity = \"N\";\n\t\t\tString flowControl = \"N\";\n\t\t\tif (parameters.parity == 1)\n\t\t\t\tparity = \"O\";\n\t\t\telse if (parameters.parity == 2)\n\t\t\t\tparity = \"E\";\n\t\t\telse if (parameters.parity == 3)\n\t\t\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_421
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete TX64 Request packet.\")));\n\t\t\n\t\t// Call the method under...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "transmitOptions", "...
{ "body": "public static TX64Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX64 Request packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 8 (address) + 1 (transmit options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_708
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testStringToByteArrayEmptyString() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"\";\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.stringToByteArray(s);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Returned byte array must be empty...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static byte[] stringToByteArray(String value) {\n\t\tif (value == null)\n\t\t\tthrow new NullPointerException(\"Value cannot be null.\");\n\t\t\n\t\treturn value.getBytes();\n\t}", "class_method_signature": "ByteUtils.stringToByteArray(String value)", "constructor": false, "full_signature": "p...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_358
{ "fields": [ { "declarator": "frameType = APIFrameType.RX_SMS.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.RX_SMS.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "phoneNumber = \"555203203\"", ...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete RX SMS packet.\")));\n\n\t\t// Call the method under test tha...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1 /* (Frame type) */ + TXSMSPacket.PHONE_NUMBER_LENGTH;", "type": "int"...
{ "body": "public static RXSMSPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTyp...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_790
{ "fields": [ { "declarator": "MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH", "modifier": "private final static", "original_string": "private final static int MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH;", "type": "int", "var_name": "MAX_LENGTH" }, { "declarato...
{ "body": "@Test\n\tpublic void testGetFirstIPDataPacket() {\n\t\t// Create an XBeePacketsQueue of 5 slots.\n\t\tXBeePacketsQueue xbeePacketsQueue = new XBeePacketsQueue(5);\n\t\t\n\t\t// Add 2 dummy packets.\n\t\tfor (int i = 0; i < 2; i ++)\n\t\t\txbeePacketsQueue.addPacket(Mockito.mock(XBeePacket.class));\n\t\t\n\...
{ "fields": [ { "declarator": "DEFAULT_MAX_LENGTH = 50", "modifier": "public static final", "original_string": "public static final int DEFAULT_MAX_LENGTH = 50;", "type": "int", "var_name": "DEFAULT_MAX_LENGTH" }, { "declarator": "maxLength = DEFAULT_MAX_LENGTH", ...
{ "body": "public XBeePacket getFirstIPDataPacket(int timeout) {\n\t\tif (timeout > 0) {\n\t\t\tXBeePacket xbeePacket = getFirstIPDataPacket(0);\n\t\t\t// Wait for a timeout or until a IP data packet is read.\n\t\t\tLong deadLine = System.currentTimeMillis() + timeout;\n\t\t\twhile (xbeePacket == null && deadLine > S...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_75
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterString() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"NI\";\n\t\tString parameter = \"myDevice\";\n\t\tATCommandQueuePacket packet = new ATCommandQueuePacket(frameID, command, parameter);\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 4", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "command", "modifier":...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"AT Command\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(command.getBytes())) + \" (\" + command + \")\");\n\t\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_285
{ "fields": [ { "declarator": "frameType = APIFrameType.SEND_DATA_REQUEST.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.SEND_DATA_REQUEST.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "frameID = 0x...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersDataNull() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tSendDataRequestPacket packet = new SendDataRequestPacket(frameID, path, contentType, options, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String>...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 6", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 6;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Send...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tif (path != null) {\n\t\t\tparameters.put(\"Path length\", HexUtils.prettyHexString(HexUtils.integerToHexString(path.length(), 1)) + \" (\" ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_456
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0xE7;\n\t\tint status = XBeeTransmitStatus.SUCCESS.getId();\n\t\t\n\t\tbyte[] payload = new byte[3];\n\t\tpayload[0] = (byte)frameID;\n\t\tpayload[1] = (byte)status;\n\t\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 3", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 3;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "transmitStatus", "mod...
{ "body": "public static TXStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 1 (status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgum...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_513
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testEqualsIsSymetric() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters parameters1 = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\tSerialPortParameters parameters2 = new SerialPortParameters(9600, 8, 1, 0, 0);\n\t\t\n\t\t// Call the method under test.\n\t...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "baudrate", "modifier": "public final", "original_str...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj instanceof SerialPortParameters)\n\t\t\treturn ((SerialPortParameters)obj).baudrate == baudrate \n\t\t\t\t&& ((SerialPortParameters)obj).dataBits == dataBits \n\t\t\t\t&& ((SerialPortParameters)obj).stopBits == stopBits\n\t\t\t\t&& ((SerialPortP...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_143
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcastWith16BitBroadcastAndNon64BitBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 20", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 20;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress64", "mo...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\tif (get64BitDestinationAddress().equals(XBee64BitAddress.BROADCAST_ADDRESS) \n\t\t\t\t|| get16BitDestinationAddress().equals(XBee16BitAddress.BROADCAST_ADDRESS))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "class_method_signature": "ExplicitAddressingPac...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_22
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Transmit packet.\")));\n\t\t\n\t\t// Call the method under tes...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 14", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 14;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress64", "mo...
{ "body": "public static TransmitPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Transmit packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 8 (64-bit address) + 2 (16-bit address) + 1 (broadcast radious) + 1 (options)\n\t\tif (payl...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_397
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete RX64 packet.\")));\n\t\t\n\t\t// Call the method under test th...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "public static RX64Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX64 packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-bit address) + 1 (signal strength) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_728
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testReadUntilCRNullInputStream() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Input stream cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils.readUntilCR(null);...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static byte[] readUntilCR(ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\t\n\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\tbyte readByte;\n\t\twhile (((readByte = (byte)inputSt...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_378
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.IO_D...
{ "body": "@Test\n\tpublic final void testSetOptionsNegative() {\n\t\t// Set up the resources for the test.\n\t\tIODataSampleRxIndicatorWifiPacket packet = new IODataSampleRxIndicatorWifiPacket(sourceAddress, rssi, receiveOptions, data);\n\n\t\treceiveOptions = -1;\n\n\t\texception.expect(IllegalArgumentException.cla...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"IO...
{ "body": "public void setReceiveOptions(int receiveOptions) {\n\t\tif (receiveOptions < 0 || receiveOptions > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_OPTIONS_ILLEGAL);\n\n\t\tthis.receiveOptions = receiveOptions;\n\t}", "class_method_signature": "IODataSampleRxIndicatorWifiPacket.setReceiveOptions(int...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_682
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testReadBytesExactTheAvailable() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] contents = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04};\n\t\tByteArrayInputStream in = new ByteArrayInputStream(contents);\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtil...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static byte[] readBytes(int numBytes, ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\tif (numBytes < 0)\n\t\t\tthrow new IllegalArgumentException(\"Number of bytes to read must be equal or greater than 0....
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_401
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNotNull() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tint rssi = 75;\n\t\tint options = 40;\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit source address\", HexUtils.prettyHexString(sourceAddress64.toString()));\n\t\tparameters.put(\"RSSI\", HexUtils.pret...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_817
{ "fields": [ { "declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}", "modifier": "private final static", "original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};", ...
{ "body": "@Test\n\tpublic final void testEqualsIsTransitive() {\n\t\t// Setup the resources for the test.\n\t\tXBeeIMEIAddress imei1 = new XBeeIMEIAddress(\"1234\");\n\t\tXBeeIMEIAddress imei2 = new XBeeIMEIAddress(\"1234\");\n\t\tXBeeIMEIAddress imei3 = new XBeeIMEIAddress(\"1234\");\n\t\t\n\t\t// Call the method u...
{ "fields": [ { "declarator": "ERROR_IMEI_NULL = \"IMEI address cannot be null.\"", "modifier": "private static final", "original_string": "private static final String ERROR_IMEI_NULL = \"IMEI address cannot be null.\";", "type": "String", "var_name": "ERROR_IMEI_NULL" }, { ...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (!(obj instanceof XBeeIMEIAddress))\n\t\t\treturn false;\n\t\tXBeeIMEIAddress addr = (XBeeIMEIAddress)obj;\n\t\treturn addr.getValue().equals(getValue());\n\t}", "class_method_signature": "XBeeIMEIAddress....
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_114
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcastWithNon16BitAndNon64BitBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\"...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 15", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 15;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress64", "mo...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn get64bitDestinationAddress().equals(XBee64BitAddress.BROADCAST_ADDRESS) \n\t\t\t\t|| get16bitDestinationAddress().equals(XBee16BitAddress.BROADCAST_ADDRESS);\n\t}", "class_method_signature": "RemoteATCommandPacket.isBroadcast()", "constructor": fa...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_544
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic final void testWriteDataCompleteWriteIOException() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tbyte[] data = new byte[] {'h', 'e', 'l', 'l', 'o'};\n\t\tint offset = 0;\n\t\tin...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "@Override\n\tpublic void writeData(byte[] data) throws IOException {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Data to be sent cannot be null.\");\n\t\t\n\t\tif (getOutputStream() != null) {\n\t\t\t// Writing data in ports without any device connected and configured with \n\t\t\t// har...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_381
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.REMO...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[11];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 2, 4);\n\t\tSystem....
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 13", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 13;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Re...
{ "body": "public static RemoteATCommandWifiPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_34
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Modem Status packet.\")));\n\t\t\n\t\t// Call the method under...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 2", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 2;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "modemStatusEvent", "m...
{ "body": "public static ModemStatusPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Modem Status packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (Modem status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgument...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_694
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testByteArrayToLongMoreThan8Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34, (byte)0x85, (byte)0x96, 0x23, 0x47, 0x56, 0x20, 0x63, 0x67};\n\t\tlong expectedResult = 0x1234859623475620L;\n\t\t\n\t\t// Call the method under test.\n\...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static long byteArrayToLong(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 8) {\n\t\t\tvalues = new byte[8]...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_417
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetRFDataNullData() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x84; /* bit 2 */\n\t\tbyte[] receivedData = null;\n\t\tRX16IOPacket packet = new RX16IOPacket(source16A...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress16", "mo...
{ "body": "public byte[] getRFData() {\n\t\tif (rfData == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(rfData, rfData.length);\n\t}", "class_method_signature": "RX16IOPacket.getRFData()", "constructor": false, "full_signature": "public byte[] getRFData()", "identifier": "getRFData", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_552
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic final void testReadDataCompleteNegativeLength() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tbyte[] data = new byte[0];\n\t\tint offset = 0;\n\t\tint length = -6;\n\t\t\n\t\tex...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "@Override\n\tpublic int readData(byte[] data) throws IOException {\n\t\tif (data == null)\n\t\t\tthrow new NullPointerException(\"Buffer cannot be null.\");\n\t\t\n\t\tint readBytes = 0;\n\t\tif (getInputStream() != null)\n\t\t\treadBytes = getInputStream().read(data);\n\t\treturn readBytes;\n\t}", "clas...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_102
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIsBroadcastWithNonBroadcastOption() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x19;\n\t\tbyte[] receivedD...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 12", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 12;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1);\n\t}", "class_method_signature": "ReceivePacket.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean isBroadcast()", "identifier": "isBroadcast", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_801
{ "fields": [ { "declarator": "INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09}", "modifier": "private final static", "original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0...
{ "body": "@Test\n\tpublic final void testEqualsIsReflexive() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress addr = new XBee64BitAddress(\"0x0013A20040123456\");\n\t\t\n\t\t// Call the method under test.\n\t\tboolean areEqual = addr.equals(addr);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"6...
{ "fields": [ { "declarator": "COORDINATOR_ADDRESS = new XBee64BitAddress(\"0000\")", "modifier": "public static final", "original_string": "public static final XBee64BitAddress COORDINATOR_ADDRESS = new XBee64BitAddress(\"0000\");", "type": "XBee64BitAddress", "var_name": "COORDINAT...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee64BitAddress))\n\t\t\treturn false;\n\t\tXBee64BitAddress addr = (XBee64BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}", "class_method_signature": "XBee64BitAddress.equals(Object obj)", "constru...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_63
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParameters() {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint sourceEndpoint = 0xA0;\n\t\tint destEndpoint = 0...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 18", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 18;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "DATA_ENDPOINT = 0xE8", ...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"64-bit source address\", HexUtils.prettyHexString(sourceAddress64.toString()));\n\t\tparameters.put(\"16-bit source address...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_786
{ "fields": [ { "declarator": "MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH", "modifier": "private final static", "original_string": "private final static int MAX_LENGTH = XBeePacketsQueue.DEFAULT_MAX_LENGTH;", "type": "int", "var_name": "MAX_LENGTH" }, { "declarato...
{ "body": "@Test\n\tpublic void testGetFirstDataPacket() {\n\t\t// Create an XBeePacketsQueue of 5 slots.\n\t\tXBeePacketsQueue xbeePacketsQueue = new XBeePacketsQueue(5);\n\t\t\n\t\t// Add 2 dummy packets.\n\t\tfor (int i = 0; i < 2; i ++)\n\t\t\txbeePacketsQueue.addPacket(Mockito.mock(XBeePacket.class));\n\t\t\n\t\...
{ "fields": [ { "declarator": "DEFAULT_MAX_LENGTH = 50", "modifier": "public static final", "original_string": "public static final int DEFAULT_MAX_LENGTH = 50;", "type": "int", "var_name": "DEFAULT_MAX_LENGTH" }, { "declarator": "maxLength = DEFAULT_MAX_LENGTH", ...
{ "body": "public XBeePacket getFirstDataPacket(int timeout) {\n\t\tif (timeout > 0) {\n\t\t\tXBeePacket xbeePacket = getFirstDataPacket(0);\n\t\t\t// Wait for a timeout or until a data XBee packet is read.\n\t\t\tLong deadLine = System.currentTimeMillis() + timeout;\n\t\t\twhile (xbeePacket == null && deadLine > Sys...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_769
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "lp...
{ "body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationSendSMSAsync() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that should...
{ "fields": [ { "declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"", "modifier": "private static final", "original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";", "type": "String", "var_name": "O...
{ "body": "@Override\n\tpublic void sendSMSAsync(String phoneNumber, String data)\n\t\t\tthrows TimeoutException, XBeeException {\n\t\t// Not supported in Cellular.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "LPWANDevice.sendSMSAsync(String phoneNumber, Strin...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_293
{ "fields": [ { "declarator": "frameType = APIFrameType.DEVICE_REQUEST.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.DEVICE_REQUEST.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "requestID = 0x01",...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadNotIncludingFrameType() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[4 + target.length() + data.length];\n\t\tpayload[0] = (byte)requestID;\n\t\tpayload[1] = (byte)transport;\n\t\tpayload[2] = (byte)flags;\n\t\tpayload[3] = (b...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Devi...
{ "body": "public static DeviceRequestPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != API...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_339
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.RX_I...
{ "body": "@Test\n\tpublic final void testSetDestAddressNull() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv4Packet packet = new RXIPv4Packet(sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Source address ca...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"RX...
{ "body": "public void setSourceAddress(Inet4Address sourceAddress) {\n\t\tif (sourceAddress == null)\n\t\t\tthrow new NullPointerException(ERROR_SOURCE_ADDR_NULL);\n\n\t\tthis.sourceAddress = sourceAddress;\n\t}", "class_method_signature": "RXIPv4Packet.setSourceAddress(Inet4Address sourceAddress)", "constructor...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_440
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"RX64 Address IO packet payload cannot be null.\")));\n\t\t\n\t\t// Call the method un...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "sourceAddress64", "...
{ "body": "public static RX64IOPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"RX64 Address IO packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-bit address) + 1 (RSSI) + 1 (receive options)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_155
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersATCommandParameterNotNullNonStringCmd() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"DL\";\n\t\tATCommandStatus status = ATCommandStatus.UNKNOWN;\n\t\tbyte[] parameter = new byte[]{0x6D, 0x79, 0x44, 0x65, 0...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 5", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 5;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "status", "modifier": ...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"AT Command\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(command.getBytes())) + \" (\" + command + \")\");\n\t\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_505
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testEqualsWithNonXBeePacket() {\n\t\t// Setup the resources for the test.\n\t\tfinal byte[] dataArray = new byte[]{0x17, 0x01, 0x00, 0x13, (byte)0xA2, 0x00, 0x40, (byte)0xAD, 0x14, 0x2E, (byte)0xFF, (byte)0xFE, 0x02, 0x4E, 0x49};\n\t\tTestXBeePacket packet = new TestXBeePacket() ...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "checksum", "modifier": "private", "original_string":...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBeePacket))\n\t\t\treturn false;\n\t\tXBeePacket packet = (XBeePacket)obj;\n\t\t\n\t\treturn Arrays.equals(packet.generateByteArray(), generateByteArray());\n\t}", "class_method_signature": "XBeePacket.equals(Object obj)", "con...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_712
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testByteArrayToString() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{'H', 'e', 'l', 'l', 'o'};\n\t\tString expectedResult = \"Hello\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = ByteUtils.byteArrayToString(byteArray);\n\t\t\n\...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static String byteArrayToString(byte[] value) {\n\t\tif (value == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\treturn new String(value);\n\t}", "class_method_signature": "ByteUtils.byteArrayToString(byte[] value)", "constructor": false, "full_signatur...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_342
{ "fields": [ { "declarator": "IP_ADDRESS = \"10.10.11.12\"", "modifier": "private static final", "original_string": "private static final String IP_ADDRESS = \"10.10.11.12\";", "type": "String", "var_name": "IP_ADDRESS" }, { "declarator": "frameType = APIFrameType.RX_I...
{ "body": "@Test\n\tpublic final void testSetSourcePortNegative() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv4Packet packet = new RXIPv4Packet(sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Port must ...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 11", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 11;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"RX...
{ "body": "public void setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}", "class_method_signature": "RXIPv4Packet.setSourcePort(int sourcePort)", "constructor": false, "full_sig...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_18
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetPacketParametersNoFrameIDWithoutData() {\n\t\t// Setup the resources for the test.\n\t\tAPIFrameType frameType = APIFrameType.GENERIC;\n\t\tTestXBeeAPIPacket packet = new TestXBeeAPIPacket(frameType);\n\t\t\n\t\tString expectedFrameType = HexUtils.integerToHexString(frameT...
{ "fields": [ { "declarator": "NO_FRAME_ID = 9999", "modifier": "public final static", "original_string": "public final static int NO_FRAME_ID = 9999;", "type": "int", "var_name": "NO_FRAME_ID" }, { "declarator": "frameID = NO_FRAME_ID", "modifier": "protected", ...
{ "body": "@Override\n\tprotected LinkedHashMap<String, String> getPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tif (getFrameType() != null)\n\t\t\tparameters.put(\"Frame type\", HexUtils.prettyHexString(HexUtils.integerToHexString(frameTypeValue, 1)) +...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_657
{ "fields": [ { "declarator": "PARAMETER_MY = \"MY\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_MY = \"MY\";", "type": "String", "var_name": "PARAMETER_MY" }, { "declarator": "PARAMETER_C0 = \"C0\"", "modifier":...
{ "body": "@Test(expected=InterfaceNotOpenException.class)\n\tpublic void testStartListeningConnectionClosed() throws TimeoutException, XBeeException {\n\t\t// Throw an Interface not open exception when setting any parameter.\n\t\tMockito.doThrow(new InterfaceNotOpenException()).when(ipDevice).setParameter(Mockito.an...
{ "fields": [ { "declarator": "BROADCAST_IP = \"255.255.255.255\"", "modifier": "public static final", "original_string": "public static final String BROADCAST_IP = \"255.255.255.255\";", "type": "String", "var_name": "BROADCAST_IP" }, { "declarator": "OPERATION_EXCEPTI...
{ "body": "public void startListening(int sourcePort) throws TimeoutException, XBeeException {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(\"Source port must be between 0 and 65535.\");\n\t\t\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)sourcePort));\n\t\tth...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_207
{ "fields": [ { "declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDR" }, ...
{ "body": "@Test\n\tpublic final void testGetParameterAsStringNullValue() {\n\t\tIPv6RemoteATCommandRequestPacket packet = new IPv6RemoteATCommandRequestPacket(frameID, ipv6address, transmitOptions, command, (String)null);\n\t\t\n\t\t// Call the method under test.\n\t\tString value = packet.getParameterAsString();\n\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 21", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"IP...
{ "body": "public String getParameterAsString() {\n\t\tif (parameter == null)\n\t\t\treturn null;\n\t\treturn new String(parameter);\n\t}", "class_method_signature": "IPv6RemoteATCommandRequestPacket.getParameterAsString()", "constructor": false, "full_signature": "public String getParameterAsString()", "iden...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_591
{ "fields": [ { "declarator": "PARAMETER_MY = \"MY\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_MY = \"MY\";", "type": "String", "var_name": "PARAMETER_MY" }, { "declarator": "PARAMETER_C0 = \"C0\"", "modifier":...
{ "body": "@SuppressWarnings(\"deprecation\")\n\t@Test\n\tpublic void testNotSupportedOperationAddDataListener() throws Exception {\n\t\texception.expect(UnsupportedOperationException.class);\n\t\texception.expectMessage(is(equalTo(\"Operation not supported in this module.\")));\n\t\t\n\t\t// Call the method that sho...
{ "fields": [ { "declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"", "modifier": "private static final", "original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";", "type": "String", "var_name": "O...
{ "body": "@Override\n\tpublic void addDataListener(IDataReceiveListener listener) {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "IPv6Device.addDataListener(IDataReceiveListener listener)", "constructor": false, "full...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_315
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersNullData() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] data = null;\n\t\tGenericXBeePacket packet = new GenericXBeePacket(data);\n\t\t\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getAPIPacketPa...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 1", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 1;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "rfData", "modifier": ...
{ "body": "@Override\n\tprotected LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tif (rfData != null)\n\t\t\tparameters.put(\"RF Data\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(rfData)));\n\t\treturn para...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_745
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testHexStringToByteArrayNullString() {\n\t\t// Setup the resources for the test.\n\t\tString s = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Value to convert cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t...
{ "fields": [ { "declarator": "HEXES = \"0123456789ABCDEF\"", "modifier": "private static final", "original_string": "private static final String HEXES = \"0123456789ABCDEF\";", "type": "String", "var_name": "HEXES" }, { "declarator": "HEX_HEADER = \"0x\"", "modif...
{ "body": "public static byte[] hexStringToByteArray(String value) {\n\t\tif (value == null)\n\t\t\tthrow new NullPointerException(\"Value to convert cannot be null.\");\n\t\t\n\t\tvalue = value.trim();\n\t\tif (value.startsWith(HEX_HEADER))\n\t\t\tvalue = value.substring((HEX_HEADER).length());\n\t\tint len = value....
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_250
{ "fields": [ { "declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_SR...
{ "body": "@Test\n\tpublic final void testSetDestPortNegative() {\n\t\t// Set up the resources for the test.\n\t\tCoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 41", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Co...
{ "body": "public void setDestPort(int destPort) {\n\t\tif (destPort < 0 || destPort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_DEST_PORT_ILLEGAL);\n\n\t\tthis.destPort = destPort;\n\t}", "class_method_signature": "CoAPRxResponsePacket.setDestPort(int destPort)", "constructor": false, "full_signat...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_600
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java", "identifier": "TransmitExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testGetTransmitStatus() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.RESOURCE_ERROR;\n\t\tTransmitException e = new TransmitException(transmitStatus);\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeTransmitStatus resu...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "DEFAULT_MESSAGE = \"There was a problem t...
{ "body": "public XBeeTransmitStatus getTransmitStatus() {\n\t\treturn transmitStatus;\n\t}", "class_method_signature": "TransmitException.getTransmitStatus()", "constructor": false, "full_signature": "public XBeeTransmitStatus getTransmitStatus()", "identifier": "getTransmitStatus", "invocations": [], "m...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_529
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic final void testPurgeNullInputStream() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tmockInputStream = null;\n\t\t\n\t\t// Call the method under test.\n\t\tport.purge();\n\t\t\n\...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "public void purge() {\n\t\tif (getInputStream() != null) {\n\t\t\ttry {\n\t\t\t\tbyte[] availableBytes = new byte[getInputStream().available()];\n\t\t\t\tif (getInputStream().available() > 0)\n\t\t\t\t\tgetInputStream().read(availableBytes, 0, getInputStream().available());\n\t\t\t} catch (IOException e) {...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_179
{ "fields": [ { "declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDRESS" ...
{ "body": "@Test\n\tpublic final void testSetDestAddressNull() {\n\t\t// Set up the resources for the test.\n\t\tCoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, uriData, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"De...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 26", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 26;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Co...
{ "body": "public void setDestAddress(Inet6Address destAddress) {\n\t\tif (destAddress == null)\n\t\t\tthrow new NullPointerException(ERROR_DEST_ADDR_NULL);\n\n\t\tthis.destAddress = destAddress;\n\t}", "class_method_signature": "CoAPTxRequestPacket.setDestAddress(Inet6Address destAddress)", "constructor": false,...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_483
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testParsePacketNullString() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Packet cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tXBeePacke...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "checksum", "modifier": "private", "original_string":...
{ "body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_196
{ "fields": [ { "declarator": "IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDR = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDR" }, ...
{ "body": "@Test\n\tpublic final void testGetCommandValue() {\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6address, command, \n\t\t\t\tstatus, value);\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] commandValue = packet.getCommandValue();\n\t\t\n\t\t// Veri...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 21", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 21;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"IP...
{ "body": "public byte[] getCommandValue() {\n\t\treturn commandValue;\n\t}", "class_method_signature": "IPv6RemoteATCommandResponsePacket.getCommandValue()", "constructor": false, "full_signature": "public byte[] getCommandValue()", "identifier": "getCommandValue", "invocations": [], "modifiers": "public...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_753
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testIntegerToHexStringZeroMinBytes() {\n\t\t// Setup the resources for the test.\n\t\tint v = 0x12345678;\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Minimum number of bytes must be greater than 0.\")));\n\t\t\n\t\t// Call the ...
{ "fields": [ { "declarator": "HEXES = \"0123456789ABCDEF\"", "modifier": "private static final", "original_string": "private static final String HEXES = \"0123456789ABCDEF\";", "type": "String", "var_name": "HEXES" }, { "declarator": "HEX_HEADER = \"0x\"", "modif...
{ "body": "public static String integerToHexString(int value, int minBytes) {\n\t\tif (minBytes <= 0)\n\t\t\tthrow new IllegalArgumentException(\"Minimum number of bytes must be greater than 0.\");\n\t\t\n\t\tString f = String.format(\"%%0%dX\", minBytes*2);\n\t\treturn String.format(f, value);\n\t}", "class_method...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_303
{ "fields": [ { "declarator": "frameType = APIFrameType.DEVICE_RESPONSE.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "frameID = 0x01",...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Device Response packet payload cannot be null.\")));\n\n\t\t// Call the method under...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 4", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 4;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Devi...
{ "body": "public static DeviceResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != AP...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_59
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testCreatePacketNullPayload() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] payload = null;\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Explicit Rx Indicator packet payload cannot be null.\")));\n\t\t\n\t\t// Call the met...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 18", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 18;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "DATA_ENDPOINT = 0xE8", ...
{ "body": "public static ExplicitRxIndicatorPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Explicit Rx Indicator packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (64-bit address) + 2 (16-bit address) + 1 (source endpoint) + 1 (destination end...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_616
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java", "identifier": "XBeeExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testXBeeExceptionMessageNullAndCause() {\n\t\t// Setup the resources for the test.\n\t\tString message = null;\n\t\tThrowable cause = new Exception();\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeException e = new XBeeException(message, cause);\n\t\t\n\t\t// Verify the resu...
{ "fields": [ { "declarator": "serialVersionUID = 1L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 1L;", "type": "long", "var_name": "serialVersionUID" } ], "file": "library/src/main/java/com/digi/xbee/api/exceptions/XB...
{ "body": "@Override\n\tpublic Throwable getCause() {\n\t\treturn super.getCause();\n\t}", "class_method_signature": "XBeeException.getCause()", "constructor": false, "full_signature": "@Override public Throwable getCause()", "identifier": "getCause", "invocations": [ "getCause" ], "modifiers": "@Ov...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_246
{ "fields": [ { "declarator": "IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_SRC_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_SR...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParametersReceivedDataNull() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] data = null;\n\n\t\tCoAPRxResponsePacket packet = new CoAPRxResponsePacket(frameID, destAddress, sourceAddress, destPort, sourcePort, protocol, restFulStatus, data);\n\n\t\t// Ca...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 41", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 41;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Co...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Destination address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(destAddress.getAddress())) +\n\t\t\t\t\" (\" ...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_495
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testParsePacketStringAPIInvalidLengthShorter() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E000217010013A20040AD142EFFFE024E496D\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equal...
{ "fields": [ { "declarator": "HASH_SEED = 23", "modifier": "private static final", "original_string": "private static final int HASH_SEED = 23;", "type": "int", "var_name": "HASH_SEED" }, { "declarator": "checksum", "modifier": "private", "original_string":...
{ "body": "public static XBeePacket parsePacket(String packet, OperatingMode mode) throws InvalidPacketException {\n\t\tif (packet == null)\n\t\t\tthrow new NullPointerException(\"Packet cannot be null.\");\n\t\t\t\n\t\treturn parsePacket(HexUtils.hexStringToByteArray(packet.trim().replace(\" \", \"\")), mode);\n\t}...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_180
{ "fields": [ { "declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDRESS" ...
{ "body": "@Test\n\tpublic final void testSetTransmitOptionsATURIOptionsIllegal() {\n\t\t// Set up the resources for the test.\n\t\tCoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.URI_AT_COMMAND, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\te...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 26", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 26;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"Co...
{ "body": "public void setTransmitOptions(int transmitOptions) {\n\t\tif ((uri != null && !uri.contains(CoAPURI.URI_AT_COMMAND) && transmitOptions != RemoteATCommandOptions.OPTION_NONE) \n\t\t\t\t|| (uri != null && uri.contains(CoAPURI.URI_AT_COMMAND) && transmitOptions != RemoteATCommandOptions.OPTION_NONE && transm...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_354
{ "fields": [ { "declarator": "frameType = APIFrameType.TX_SMS.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.TX_SMS.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "frameID = 0x01", "modifier":...
{ "body": "@Test\n\tpublic final void testSetPhoneNumberInvalid() {\n\t\t// Set up the resources for the test.\n\t\tString newPhoneNumber = \"5aw34\";\n\n\t\tTXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equal...
{ "fields": [ { "declarator": "PHONE_NUMBER_LENGTH = 20", "modifier": "static final", "original_string": "static final int PHONE_NUMBER_LENGTH = 20;", "type": "int", "var_name": "PHONE_NUMBER_LENGTH" }, { "declarator": "PHONE_NUMBER_PATTERN = \"^\\\\+?\\\\d+$\"", ...
{ "body": "public void setPhoneNumber(String phoneNumber) {\n\t\tif (phoneNumber == null)\n\t\t\tthrow new NullPointerException(ERROR_PHONE_NUMBER_NULL);\n\t\tif (phoneNumber.length() > PHONE_NUMBER_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_PHONE_NUMBER_LENGTH);\n\t\tif (!Pattern.matches(PHONE_NUMBER_PA...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_704
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testByteArrayToShortLessThan2Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12};\n\t\tshort expectedResult = 0x12;\n\t\t\n\t\t// Call the method under test.\n\t\tshort result = ByteUtils.byteArrayToShort(byteArray);\n\t\t\n\t\t// Verify t...
{ "fields": [], "file": "library/src/main/java/com/digi/xbee/api/utils/ByteUtils.java", "identifier": "ByteUtils", "interfaces": "", "methods": [ { "class_method_signature": "ByteUtils.readBytes(int numBytes, ByteArrayInputStream inputStream)", "constructor": false, "full_signature": "pu...
{ "body": "public static short byteArrayToShort(byte[] byteArray) {\n\t\tif (byteArray == null)\n\t\t\tthrow new NullPointerException(\"Byte array cannot be null.\");\n\t\t\n\t\tif (byteArray.length == 0)\n\t\t\treturn 0;\n\t\t\n\t\tbyte[] values = byteArray;\n\t\tif (byteArray.length < 2) {\n\t\t\tvalues = new byte[...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_211
{ "fields": [ { "declarator": "IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\"", "modifier": "private static final", "original_string": "private static final String IPV6_ADDRESS = \"FDB3:0001:0002:0000:0004:0005:0006:0007\";", "type": "String", "var_name": "IPV6_ADDRESS" ...
{ "body": "@Test\n\tpublic final void testCreatePacketEmptyPayload() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[0];\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete TX IPv6 packet.\")));\n\n\t\t// Call the method under test th...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 24", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 24;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "ERROR_PAYLOAD_NULL = \"TX...
{ "body": "public static TXIPv6Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(ERROR_INCOMPLETE_PACKET);\n\n\t\tif ((payload[0] & 0xFF) != APIFrameTy...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_641
{ "fields": [ { "declarator": "PARAMETER_AI = \"AI\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_AI = \"AI\";", "type": "String", "var_name": "PARAMETER_AI" }, { "declarator": "PARAMETER_MA = \"MA\"", "modifier":...
{ "body": "@Test\n\tpublic void testSetGatewayIPAddressNull() throws Exception {\n\t\t// Set up the resources for the test.\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Gateway address cannot be null.\")));\n\n\t\t// Call the method under test that should throw a NullPo...
{ "fields": [ { "declarator": "DEFAULT_ACCESS_POINT_TIMETOUT = 15000", "modifier": "private final static", "original_string": "private final static int DEFAULT_ACCESS_POINT_TIMETOUT = 15000;", "type": "int", "var_name": "DEFAULT_ACCESS_POINT_TIMETOUT" }, { "declarator":...
{ "body": "public void setGatewayIPAddress(Inet4Address address) throws TimeoutException, XBeeException {\n\t\tif (address == null)\n\t\t\tthrow new NullPointerException(\"Gateway address cannot be null.\");\n\t\t\n\t\tsetParameter(\"GW\", address.getAddress());\n\t}", "class_method_signature": "WiFiDevice.setGatew...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_568
{ "fields": [ { "declarator": "RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes()", "modifier": "private static final", "original_string": "private static final byte[] RECEIVED_BUFFER = \"Hello, this is the received data\".getBytes();", "type": "byte[]", "var_name": "R...
{ "body": "@Test\n\tpublic void testToStringDefault() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\tString expected = \"[COM1 - 9600/8/N/1/N] \";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = port.toString(...
{ "fields": [ { "declarator": "DEFAULT_PORT_TIMEOUT = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_PORT_TIMEOUT = 10;", "type": "int", "var_name": "DEFAULT_PORT_TIMEOUT" }, { "declarator": "DEFAULT_DATA_BITS = 8", "mo...
{ "body": "@Override\n\tpublic String toString() {\n\t\tif (parameters != null) {\n\t\t\tString parity = \"N\";\n\t\t\tString flowControl = \"N\";\n\t\t\tif (parameters.parity == 1)\n\t\t\t\tparity = \"O\";\n\t\t\telse if (parameters.parity == 2)\n\t\t\t\tparity = \"E\";\n\t\t\telse if (parameters.parity == 3)\n\t\t\...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_138
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" } ], "file": "library/src/te...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParameters() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint sourceEndpoint = 0xA0;\n\t\...
{ "fields": [ { "declarator": "MIN_API_PAYLOAD_LENGTH = 20", "modifier": "private static final", "original_string": "private static final int MIN_API_PAYLOAD_LENGTH = 20;", "type": "int", "var_name": "MIN_API_PAYLOAD_LENGTH" }, { "declarator": "destAddress64", "mo...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Frame ID\", HexUtils.prettyHexString(HexUtils.integerToHexString(frameID, 1)) + \" (\" + frameID + \")\");\n\t\tparameters....
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
21871478_587
{ "fields": [ { "declarator": "PARAMETER_MY = \"MY\"", "modifier": "private static final", "original_string": "private static final String PARAMETER_MY = \"MY\";", "type": "String", "var_name": "PARAMETER_MY" }, { "declarator": "PARAMETER_C0 = \"C0\"", "modifier":...
{ "body": "@Test(expected=TimeoutException.class)\n\tpublic void testStoptListeningTimeout() throws TimeoutException, XBeeException {\n\t\t// Throw an timeout exception when setting any parameter.\n\t\tMockito.doThrow(new TimeoutException()).when(ipv6Device).setParameter(Mockito.anyString(), Mockito.any(byte[].class)...
{ "fields": [ { "declarator": "OPERATION_EXCEPTION = \"Operation not supported in this module.\"", "modifier": "private static final", "original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in this module.\";", "type": "String", "var_name": "O...
{ "body": "public void stopListening() throws TimeoutException, XBeeException {\n\t\tsetParameter(\"C0\", ByteUtils.shortToByteArray((short)0));\n\t\tsourcePort = 0;\n\t}", "class_method_signature": "IPv6Device.stopListening()", "constructor": false, "full_signature": "public void stopListening()", "identifie...
{ "created": null, "fork": null, "fork_count": 54, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 21871478, "size": 3156, "stargazer_count": 76, "stars": null, "updates": null, "url": "https://github.com/digidotcom/xbee-java" }
152350105_0
{ "fields": [], "file": "ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ParamValidatorTest.java", "identifier": "ParamValidatorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void validator() {\n Person person = new Person();\n person.setName(\"zhangsan\");\n try {\n ParamValidator.validator(person);\n }catch (Exception e){\n System.out.println(e.fillInStackTrace());\n }\n try {\n Syste...
{ "fields": [ { "declarator": "factory = Validation.buildDefaultValidatorFactory()", "modifier": "private static", "original_string": "private static ValidatorFactory factory = Validation.buildDefaultValidatorFactory();", "type": "ValidatorFactory", "var_name": "factory" } ], ...
{ "body": "public static <T> void validator(T obj) throws ValidatorException {\n Validator validator = factory.getValidator();\n Set<ConstraintViolation<T>> constraintViolations = validator\n .validate(obj);\n Iterator<ConstraintViolation<T>> it = constraintViolations\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 152350105, "size": 1591, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/ucloud/ucloud-sdk-java" }
152350105_1
{ "fields": [], "file": "ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/ObjectToParamTest.java", "identifier": "ObjectToParamTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void objectToParams() throws Exception {\n List<Param> params = ObjectToParam.objectToParams(new Person());\n for (Param param:\n params) {\n System.out.println(param.getParamKey()+\"===>\"+param.getParamValue());\n }\n }", "class_method_si...
{ "fields": [], "file": "ucloud-sdk-java-common/src/main/java/cn/ucloud/common/util/ObjectToParam.java", "identifier": "ObjectToParam", "interfaces": "", "methods": [ { "class_method_signature": "ObjectToParam.objectToParams(BaseRequestParam baseRequestParam)", "constructor": false, "ful...
{ "body": "public static List<Param> objectToParams(BaseRequestParam baseRequestParam) throws Exception {\n List<Param> params = new ArrayList<>();\n if (baseRequestParam != null) {\n Class<?> objectClass = baseRequestParam.getClass();\n params.addAll(getFieldParam(objectClass, bas...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 152350105, "size": 1591, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/ucloud/ucloud-sdk-java" }
152350105_4
{ "fields": [ { "declarator": "account", "modifier": "private", "original_string": "private Account account;", "type": "Account", "var_name": "account" } ], "file": "ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java", "identifier": "SignatureTest...
{ "body": "@Test\n public void getParamArrayAfterSignature() {\n Param[] params = initParamsArray();\n Param[] paramAfterSignature = Signature.getParamAfterSignature(params,account);\n int len = paramAfterSignature.length;\n for (int i =0 ;i<len;i++){\n System.out.println(par...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Signature.class.getName())", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(Signature.class.getName());", "type": "Logger", "var_name": "logger" } ], "fil...
{ "body": "protected static Param[] getParamAfterSignature(Param[] params, Account account) {\n if (params == null) {\n params = new Param[0];\n }\n Object[] objects = insertElement2Array(params, new Param(\"signature\", getSignature(params, account)), params.length);\n if (obje...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 152350105, "size": 1591, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/ucloud/ucloud-sdk-java" }
152350105_5
{ "fields": [ { "declarator": "account", "modifier": "private", "original_string": "private Account account;", "type": "Account", "var_name": "account" } ], "file": "ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java", "identifier": "SignatureTest...
{ "body": "@Test\n public void getParamListAfterSignature() {\n List<Param> params = initParamsList();\n params = Signature.getParamAfterSignature(params,account);\n for (Param param:params){\n System.out.println(param.getParamKey()+\"===\"+param.getParamValue());\n }\n }"...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Signature.class.getName())", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(Signature.class.getName());", "type": "Logger", "var_name": "logger" } ], "fil...
{ "body": "protected static Param[] getParamAfterSignature(Param[] params, Account account) {\n if (params == null) {\n params = new Param[0];\n }\n Object[] objects = insertElement2Array(params, new Param(\"signature\", getSignature(params, account)), params.length);\n if (obje...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 152350105, "size": 1591, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/ucloud/ucloud-sdk-java" }
152350105_2
{ "fields": [ { "declarator": "account", "modifier": "private", "original_string": "private Account account;", "type": "Account", "var_name": "account" } ], "file": "ucloud-sdk-java-common/src/test/java/cn/ucloud/common/util/SignatureTest.java", "identifier": "SignatureTest...
{ "body": "@Test\n public void getSignatureArray() {\n Param[] params = initParamsArray();\n System.out.println(Signature.getSignature(params,account));\n }", "class_method_signature": "SignatureTest.getSignatureArray()", "constructor": false, "full_signature": "@Test public void getSignatur...
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(Signature.class.getName())", "modifier": "private static", "original_string": "private static Logger logger = LoggerFactory.getLogger(Signature.class.getName());", "type": "Logger", "var_name": "logger" } ], "fil...
{ "body": "protected static String getSignature(Param[] params, Account account) {\n String signature = \"\";\n if (params != null) {\n // 排序\n sortParams(params);\n // 拼接参数\n String stitchParams = stitchParams(params);\n // 拼接privateKey\n ...
{ "created": null, "fork": null, "fork_count": 8, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 152350105, "size": 1591, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/ucloud/ucloud-sdk-java" }