id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
21871478_411
{ "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 testGetAPIPacketParametersReceivedDataNull() {\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 = 40;\n\t\tbyte[] receivedData = null;\n\t\tRX16IOPacket packet = new RX16IOPacket(so...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"16-bit source address\", HexUtils.prettyHexString(sourceAddress16.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_807
{ "fields": [ { "declarator": "SSID = \"My Access Point\"", "modifier": "private static final", "original_string": "private static final String SSID = \"My Access Point\";", "type": "String", "var_name": "SSID" }, { "declarator": "ENCRYPTION_TYPE = WiFiEncryptionType.WE...
{ "body": "@Test(expected=IllegalArgumentException.class)\n\tpublic void testSetChannelNegative() {\n\t\tAccessPoint accessPoint = new AccessPoint(SSID, ENCRYPTION_TYPE);\n\t\t\n\t\taccessPoint.setChannel(-10);\n\t}", "class_method_signature": "AccessPointTest.testSetChannelNegative()", "constructor": false, "f...
{ "fields": [ { "declarator": "ERROR_CHANNEL = \"Channel cannot be negative.\"", "modifier": "private static final", "original_string": "private static final String ERROR_CHANNEL = \"Channel cannot be negative.\";", "type": "String", "var_name": "ERROR_CHANNEL" }, { "de...
{ "body": "public void setChannel(int channel) {\n\t\tif (channel < 0)\n\t\t\tthrow new IllegalArgumentException(ERROR_CHANNEL);\n\t\t\n\t\tthis.channel = channel;\n\t}", "class_method_signature": "AccessPoint.setChannel(int channel)", "constructor": false, "full_signature": "public void setChannel(int channel)...
{ "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_554
{ "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 testReadDataCompleteOffsetPlusLengthThanDataSize() 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 =...
{ "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_104
{ "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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x8A; /* bit 1 */\n\t\tbyte[] receivedData ...
{ "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": "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": "ReceivePacket.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_780
{ "fields": [ { "declarator": "INVALID_BYTE_ARRAY = new byte[]{0x01, 0x02, 0x03}", "modifier": "private final static", "original_string": "private final static byte[] INVALID_BYTE_ARRAY = new byte[]{0x01, 0x02, 0x03};", "type": "byte[]", "var_name": "INVALID_BYTE_ARRAY" }, { ...
{ "body": "@Test\n\tpublic final void testEqualsIsReflexive() {\n\t\t// Setup the resources for the test.\n\t\tXBee16BitAddress addr = new XBee16BitAddress(\"0x1234\");\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(\"16-bits addr ...
{ "fields": [ { "declarator": "COORDINATOR_ADDRESS = new XBee16BitAddress(\"0000\")", "modifier": "public static final", "original_string": "public static final XBee16BitAddress COORDINATOR_ADDRESS = new XBee16BitAddress(\"0000\");", "type": "XBee16BitAddress", "var_name": "COORDINAT...
{ "body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (!(obj instanceof XBee16BitAddress))\n\t\t\treturn false;\n\t\tXBee16BitAddress addr = (XBee16BitAddress)obj;\n\t\treturn Arrays.equals(addr.getValue(), getValue());\n\t}", "class_method_signature": "XBee16BitAddress.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_65
{ "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 sourceEndpoint = 0xA0;\n\t\tint destE...
{ "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 boolean isBroadcast() {\n\t\tif (ByteUtils.isBitEnabled(getReceiveOptions(), 1))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "class_method_signature": "ExplicitRxIndicatorPacket.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean 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_295
{ "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 testGetAPIPacketParametersDataNull() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Device Request ID\", HexUtils.prettyHexString(HexUtils.integerToHexString(requestID, 1)) + \" (\" + requestID + \")\");\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_446
{ "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[]{(byte)0x01, (byte)0xFF, (b...
{ "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_153
{ "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 testGetAPIPacketParametersATCommandParameterNull() {\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\tbyte[] parameter = null;\n\t\tATCommandResponsePacket packet = new ATC...
{ "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_503
{ "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 testParsePacketNotHeaderByte() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = {0x68, 0x00, 0x08, 0x08, 0x01, 0x4E, 0x49, 0x41, 0x54, 0x49, (byte)0x81, (byte)0x7E};\n\t\texception.expect(InvalidPacketException.class);\n\t\texcepti...
{ "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_714
{ "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 testIsBitEnabledNegativePosition() {\n\t\t// Setup the resources for the test.\n\t\tint n = 0xFFFF;\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Bit position must be between 0 and 31.\")));\n\t\t\n\t\t// Call the method un...
{ "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 isBitEnabled(int containerInteger, int bitPosition) {\n\t\tif (bitPosition < 0 || bitPosition > 31)\n\t\t\tthrow new IllegalArgumentException(\"Bit position must be between 0 and 31.\");\n\t\t\n\t\treturn (((containerInteger & 0xFFFFFFFF) >> bitPosition) & 0x01) == 0x01;\n\t}", "cla...
{ "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_344
{ "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 testSetProtocolNull() {\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(\"Protocol cannot be 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": "ERROR_PAYLOAD_NULL = \"RX...
{ "body": "public void setProtocol(IPProtocol protocol) {\n\t\tif (protocol == null)\n\t\t\tthrow new NullPointerException(ERROR_PROTOCOL_NULL);\n\n\t\tthis.protocol = protocol;\n\t}", "class_method_signature": "RXIPv4Packet.setProtocol(IPProtocol protocol)", "constructor": false, "full_signature": "public void...
{ "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_651
{ "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": "@Test\n\tpublic void testSendIPDataProtocolIllegalTCP() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tInet6Address address = (Inet6Address) Inet6Address.getByName(\"FDB3:0001:0002:0000:0004:0005:0006:0007\");\n\t\tbyte[] data = \"Hello XBee\".getBytes();\n\t\tint destPort = 1234;\n\t\t...
{ "fields": [ { "declarator": "OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\"", "modifier": "private static final", "original_string": "private static final String OPERATION_EXCEPTION = \"Operation not supported in Thread protocol.\";", "type": "String", "var_n...
{ "body": "@Override\n\tpublic void sendIPData(Inet6Address ipv6Address, int destPort,\n\t\t\tIPProtocol protocol, byte[] data) throws TimeoutException,\n\t\t\tXBeeException {\n\t\tif (protocol != IPProtocol.UDP && protocol != IPProtocol.COAP)\n\t\t\tthrow new IllegalArgumentException(ERROR_PROTOCOL_ILLEGAL);\n\t\tsu...
{ "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_201
{ "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 testCreatePacketPayloadNotIncludingFrameType() {\n\t\tbyte[] payload = new byte[20 + parameter.length];\n\t\tpayload[0] = (byte)frameID;\n\t\tSystem.arraycopy(ipv6address.getAddress(), 0, payload, 1, ipv6address.getAddress().length);\n\t\tpayload[17] = (byte)transmitOptions;\n\t\...
{ "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 static IPv6RemoteATCommandRequestPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\t// 1 (Frame type) + 1 (frame ID) + 16 (IPv6 destination address) + 1 (transmit options byte) + 2 (AT command)\n\t\tif (payload.length < 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_128
{ "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 testGetAPIPacketParametersATCommandParameterByteArrayNonStringCmd() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D8...
{ "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": "@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_578
{ "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\n\tpublic void testReadDeviceInfoIP() throws Exception {\n\t\t// Return a valid response when requesting the MY parameter value.\n\t\tMockito.doReturn(RESPONSE_MY).when(ipv6Device).getParameter(PARAMETER_MY);\n\t\t// Return a valid response when requesting the C0 parameter value.\n\t\tMockito.doRetur...
{ "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 readDeviceInfo() throws TimeoutException, XBeeException {\n\t\tsuper.readDeviceInfo();\n\t\t// Generate the Mesh-Local IPv6 address.\n\t\tbyte[] response = getParameter(\"MY\");\n\t\ttry {\n\t\t\tipv6Address = (Inet6Address) Inet6Address.getByAddress(response);\n\t\t} catch (Unknow...
{ "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_597
{ "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 testNotSupportedOperationSendBroadcastData() 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 s...
{ "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 sendBroadcastData(byte[] data) throws TimeoutException,\n\t\t\tXBeeException {\n\t\t// Not supported in IPv6 modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "IPv6Device.sendBroadcastData(byte[] data)", "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_313
{ "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 Generic packet.\")));\n\t\t\n\t\t// Call the method under test...
{ "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 static GenericXBeePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Generic packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new IllegalArgumentException(\"Incomplete G...
{ "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_743
{ "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 testByteArrayToHexString() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] array = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05};\n\t\tString expectedResult = \"0102030405\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = HexUtils.byteArrayToHexString(array);\n...
{ "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 byteArrayToHexString(byte[] value) {\n\t\tif (value == null )\n\t\t\tthrow new NullPointerException(\"Value to convert cannot be null.\");\n\t\t\n\t\tfinal StringBuilder hex = new StringBuilder(2 * value.length );\n\t\tfor (final byte b : value) {\n\t\t\thex.append(HEXES.charAt((b & 0x...
{ "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_49
{ "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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.IO_DATA_SAMPLE_RX_INDICATOR.getValue();\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = n...
{ "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": "public static IODataSampleRxIndicatorPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"IO Data Sample RX Indicator packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 8 (32-bit address) + 2 (16-bit address) + 1 (receive options)\n\t\tif (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_256
{ "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 testGetDataNullData() {\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// Call the method under tes...
{ "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 byte[] getData() {\n\t\tif (data == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(data, data.length);\n\t}", "class_method_signature": "CoAPRxResponsePacket.getData()", "constructor": false, "full_signature": "public byte[] getData()", "identifier": "getData", "invocations": [ "c...
{ "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_606
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/TransmitExceptionTest.java", "identifier": "TransmitExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testGetMessageOnlyTransmitStatusAndMessage() {\n\t\t// Setup the resources for the test.\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.WIFI_PHYSICAL_ERROR;\n\t\tString message = \"This is the message\";\n\t\tTransmitException e = new TransmitException(message, trans...
{ "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": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (transmitStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + transmitStatus.toString();\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_485
{ "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 testParsePacketNotStartingWithHeader() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalTo(\"Invalid start delimiter.\")));\n\t\t\n\t\t// Call the method under test....
{ "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_190
{ "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 testGetAPIPacketParametersATCommandParameterString() {\n\t\t// Setup the resources for the test.\n\t\tString command = \"NI\";\n\t\tString commandValue = \"Device name\";\n\t\tIPv6RemoteATCommandResponsePacket packet = new IPv6RemoteATCommandResponsePacket(frameID, ipv6address, c...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Source address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.getAddress())) + \" (\" + sourceAddr...
{ "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_755
{ "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 testIntegerToHexStringMoreBytes() {\n\t\t// Setup the resources for the test.\n\t\tint v = 0x0000000012345678;\n\t\tString expectedResult = \"0000000012345678\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = HexUtils.integerToHexString(v, 8);\n\t\t\n\t\t// Verify...
{ "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_305
{ "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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[3];\n\t\tpayload[0] = (byte)frameType;\n\t\tpayload[1] = (byte)frameID;\n\t\tpayload[2] = (byte)requestID;\n\n\t\texception.expect(IllegalArgumentException.class...
{ "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_610
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java", "identifier": "XBeeExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testCreateXBeeExceptionDefault() {\n\t\t// Setup the resources for the test.\n\t\t\n\t\t// Call the method under test.\n\t\tXBeeException e = new XBeeException();\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(\"Created 'XBeeException' does not have the expected message\", \n\t...
{ "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_240
{ "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 testGetDataValidData() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv6Packet packet = new RXIPv6Packet(destAddress, sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getData();\n\n\t\t// Verify the res...
{ "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 byte[] getData() {\n\t\tif (data == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(data, data.length);\n\t}", "class_method_signature": "RXIPv6Packet.getData()", "constructor": false, "full_signature": "public byte[] getData()", "identifier": "getData", "invocations": [ "copyOf" ...
{ "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_169
{ "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 testGetRFDataNullData() {\n\t\t// Setup the resources for the test.\n\t\tIPv6IODataSampleRxIndicator packet = new IPv6IODataSampleRxIndicator(ipv6address, null);\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getRFData();\n\t\t\n\t\t// Verify the result.\n\...
{ "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 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": "IPv6IODataSampleRxIndicator.getRFData()", "constructor": false, "full_signature": "public byte[] getRFData()", "identifier": "getRFData", "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_493
{ "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 testParsePacketStringAPIInvalidLengthLonger() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E001F17010013A20040AD142EFFFE024E496D\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalT...
{ "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_539
{ "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 testWriteDataCompleteNegativeOffset() 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 = -5;\n\t\tint...
{ "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_8
{ "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 testNotSupportedOperationRemoveIOSampleListener() 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 me...
{ "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 void removeIOSampleListener(IIOSampleReceiveListener listener) {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "CellularDevice.removeIOSampleListener(IIOSampleReceiveListener listener)", "cons...
{ "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_186
{ "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 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 IPv6 Remote AT command response packet.\")));\n\t\t\n\t\t// Ca...
{ "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 static IPv6RemoteATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(ERROR_PAYLOAD_NULL);\n\n\t\t// 1 (Frame type) + 1 (frame ID) + 16 (IPv6 source address) + 2 (AT command) + 1 (status)\n\t\tif (payload.length < MIN_API_PAYLOAD_LEN...
{ "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_352
{ "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 testGetAPIPacketParametersReceivedDataNotNull() {\n\t\t// Set up the resources for the test.\n\t\tTXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getAPIPacketParameter...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Transmit options\", HexUtils.prettyHexString(HexUtils.integerToHexString(transmitOptions, 1)));\n\t\tparameters.put(\"Phone...
{ "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_702
{ "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 testByteArrayToShortNullArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = null;\n\t\t\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Byte array cannot be null.\")));\n\t\t\n\t\t// Call the method under test.\...
{ "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_217
{ "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\tTXIPv6Packet packet = new TXIPv6Packet(frameID, destAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equalTo(\"Destinatio...
{ "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 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": "TXIPv6Packet.setDestAddress(Inet6Address destAddress)", "constructor": false, "ful...
{ "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_647
{ "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 testGetDNSAddressIllegalIP() throws XBeeException {\n\t\t// Return an illegal IP address when getting the NS parameter.\n\t\tMockito.doReturn(new byte[]{0x00}).when(wifiDevice).getParameter(PARAMETER_NS);\n\n\t\t// Get the DNS address of the device.\n\t\ttry {\n\t\t\twifiDevice.getDNSA...
{ "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 Inet4Address getDNSAddress() throws TimeoutException, XBeeException {\n\t\ttry {\n\t\t\treturn (Inet4Address) Inet4Address.getByAddress(getParameter(\"NS\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\tthrow new XBeeException(e);\n\t\t}\n\t}", "class_method_signature": "WiFiDevice.getDNSAddres...
{ "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_581
{ "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(ipv6Device).setParameter(Mockito....
{ "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 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_149
{ "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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.AT_COMMAND_RESPONSE.getValue();\n\t\t//int frameID = 0xE7;\n\t\tbyte[] atCommand = \"NI\".getBytes();\n\t\tint status = ATCommandStatus.OK.getId();\n\t\t\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": "status", "modifier": ...
{ "body": "public static ATCommandResponsePacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command Response packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (AT command) + 1 (status byte)\n\t\tif (payload.length < MIN_API_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_519
{ "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 testIsOpenNoOpened() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = new TestAbstractSerialPort(\"COM1\", 9600);\n\t\t\n\t\t// Call the method under test.\n\t\tboolean isOpen = port.isOpen();\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(isOpen, ...
{ "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 boolean isOpen() {\n\t\treturn connectionOpen;\n\t}", "class_method_signature": "AbstractSerialPort.isOpen()", "constructor": false, "full_signature": "@Override public boolean isOpen()", "identifier": "isOpen", "invocations": [], "modifiers": "@Override public", "paramete...
{ "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_630
{ "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 testAssociationIndicationStatus() throws Exception {\n\t\t// Return a valid response when requesting the AI parameter value.\n\t\tMockito.doReturn(RESPONSE_AI).when(wifiDevice).getParameter(PARAMETER_AI);\n\n\t\tassertEquals(validWiFiAIStatus, wifiDevice.getWiFiAssociationIndicationSta...
{ "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 WiFiAssociationIndicationStatus getWiFiAssociationIndicationStatus() throws TimeoutException, \n\t\t\tXBeeException {\n\t\tbyte[] associationIndicationValue = getParameter(\"AI\");\n\t\treturn WiFiAssociationIndicationStatus.get(ByteUtils.byteArrayToInt(associationIndicationValue));\n\t}", "class_...
{ "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_260
{ "fields": [ { "declarator": "frameType = APIFrameType.FRAME_ERROR.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.FRAME_ERROR.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "error = FrameError.INVAL...
{ "body": "@Test\n\tpublic final void testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[1];\n\t\tpayload[0] = (byte)error.getID();\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Incomplete Frame Er...
{ "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": "ERROR_PAYLOAD_NULL = \"Fram...
{ "body": "public static FrameErrorPacket 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) != APIFra...
{ "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_90
{ "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 testGetAPIPacketParametersATCommandParameterByteArrayNonStringCmd() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x10;\n\t\tString command = \"DL\";\n\t\tbyte[] parameter = new byte[]{0x6D, 0x79};\n\t\tATCommandPacket packet = new ATCommandPacket(frameID, comman...
{ "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_775
{ "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 testSendIPDataAsyncDeprecated() throws Exception {\n\t\t// Do nothing when the sendIPDataAsync of NBIoTDevice is called.\n\t\tMockito.doNothing().when(lpWanDevice).sendIPDataAsync(Mockito.any(Inet4Address.class), \n\t\t\t\tMockito.anyInt(), Mockito...
{ "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 sendIPDataAsync(Inet4Address ipAddress, int destPort, IPProtocol protocol, \n\t\t\tbyte[] data) throws TimeoutException, XBeeException {\n\t\tif (protocol != IPProtocol.UDP)\n\t\t\tthrow new IllegalArgumentException(ONLY_UDP_TRANSMISSIONS);\n\t\tsuper.sendIPDataAsync(ipAddress, 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_325
{ "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.TX_I...
{ "body": "@Test\n\tpublic final void testSetDestAddressNull() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv4Packet packet = new TXIPv4Packet(frameID, destAddress, destPort, sourcePort, protocol, transmitOptions, data);\n\n\t\texception.expect(NullPointerException.class);\n\t\texception.expectMessage(is(equ...
{ "fields": [ { "declarator": "OPTIONS_CLOSE_SOCKET = 2", "modifier": "public static final", "original_string": "public static final int OPTIONS_CLOSE_SOCKET = 2;", "type": "int", "var_name": "OPTIONS_CLOSE_SOCKET" }, { "declarator": "OPTIONS_LEAVE_SOCKET_OPEN = 0", ...
{ "body": "public void setDestAddress(Inet4Address 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": "TXIPv4Packet.setDestAddress(Inet4Address destAddress)", "constructor": false, "ful...
{ "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_28
{ "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 testIsBroadcastWith16BitAnd64BitBroadcastDestinationAddress() {\n\t\t// Setup the resources for the test.\n\t\tint frameID = 0x65;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"FFFF\");\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"FFFF\");\n\t\tint broadc...
{ "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": "@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": "TransmitPacket.isBroadcast()", "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_237
{ "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 testSetSourcePortBigger() {\n\t\t// Set up the resources for the test.\n\t\tRXIPv6Packet packet = new RXIPv6Packet(destAddress, sourceAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\...
{ "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 void setSourcePort(int sourcePort) {\n\t\tif (sourcePort < 0 || sourcePort > 65535)\n\t\t\tthrow new IllegalArgumentException(ERROR_SOURCE_PORT_ILLEGAL);\n\n\t\tthis.sourcePort = sourcePort;\n\t}", "class_method_signature": "RXIPv6Packet.setSourcePort(int sourcePort)", "constructor": false, "f...
{ "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_667
{ "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 testNotSupportedOperationGetPANID() 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 thr...
{ "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 byte[] getPANID() throws TimeoutException, XBeeException {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "IPDevice.getPANID()", "constructor": false, "full_signature": "@Override public 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_372
{ "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 testCreatePacketPayloadInvalidIP() throws Exception {\n\t\t// Set up the resources for the test.\n\t\tbyte[] payload = new byte[11];\n\t\tpayload[0] = (byte)frameType;\n\t\tSystem.arraycopy(new byte[]{0x00, 0x00, 0x00, 0x00}, 0, payload, 1, 4);\n\t\tSystem.arraycopy(sourceAddress...
{ "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 static IODataSampleRxIndicatorWifiPacket 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] ...
{ "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_688
{ "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 testReadStringNullTerminatedAndMore() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] contents = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x06, 0x07, 0x08};\n\t\tbyte[] expectedResult = new byte[]{0x01, 0x02, 0x03, 0x04, 0x05};\n\t\tByteArrayInputStream in = new Byt...
{ "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 readString(ByteArrayInputStream inputStream) {\n\t\tif (inputStream == null)\n\t\t\tthrow new NullPointerException(\"Input stream cannot be null.\");\n\t\t\n\t\tStringBuilder sb = new StringBuilder();\n\t\tbyte readByte;\n\t\twhile (((readByte = (byte)inputStream.read()) != 0x00) && re...
{ "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_722
{ "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 testReadIntegerFromByteOffsetLengthPlusOffsetBiggerThan8() {\n\t\t// Setup the resources for the test.\n\t\tint expectedResult = 3;\n\t\t\n\t\t// Call the method under test.\n\t\tint result = ByteUtils.readIntegerFromByte((byte)54, 4, 5);\n\t\t\n\t\t// Verify the result.\n\t\tass...
{ "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 readIntegerFromByte(byte containerByte, int bitOffset, int bitLength) {\n\t\tif (bitOffset < 0 || bitOffset > 7)\n\t\t\tthrow new IllegalArgumentException(\"Offset must be between 0 and 7.\");\n\t\tif (bitLength < 0 || bitLength > 7)\n\t\t\tthrow new IllegalArgumentException(\"Length must...
{ "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_108
{ "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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.REMOTE_AT_COMMAND_REQUEST.getValue();\n\t\tint frameID = 0xE7;\n\t\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAdd...
{ "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": "public static RemoteATCommandPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"Remote AT Command 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 (transmit options byte) + 2 (AT...
{ "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_558
{ "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 testReadDataComplete() 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[20];\n\t\tint offset = 5;\n\t\tint length = 10;\n\t\tbyte[] expected = new...
{ "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_671
{ "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 testNotSupportedOperationReadData() 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 thr...
{ "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 XBeeMessage readData() {\n\t\t// Not supported in IP modules.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "IPDevice.readData()", "constructor": false, "full_signature": "@Override public XBeeMessage readData()", "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_221
{ "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 testSetSourcePortBigger() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv6Packet packet = new TXIPv6Packet(frameID, destAddress, destPort, sourcePort, protocol, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Port ...
{ "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 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": "TXIPv6Packet.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_734
{ "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 testNewByteArrayEmptyByteArray() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] expectedResult = new byte[]{'0', '0'};\n\t\t\n\t\t// Call the method under test.\n\t\tbyte[] result = ByteUtils.newByteArray(new byte[0], expectedResult.length);\n\t\t\n\t\t// Verify the resu...
{ "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_364
{ "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 testSetPhoneNumberInvalid() {\n\t\t// Set up the resources for the test.\n\t\tString newPhoneNumber = \"5aw34\";\n\n\t\tRXSMSPacket packet = new RXSMSPacket(phoneNumber, data);\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Phon...
{ "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 void setPhoneNumber(String phoneNumber) {\n\t\tif (phoneNumber == null)\n\t\t\tthrow new NullPointerException(TXSMSPacket.ERROR_PHONE_NUMBER_NULL);\n\t\tif (phoneNumber.length() > TXSMSPacket.PHONE_NUMBER_LENGTH)\n\t\t\tthrow new IllegalArgumentException(TXSMSPacket.ERROR_PHONE_NUMBER_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_69
{ "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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"B45C\");\n\t\tint sourceEndpoint = 0xA0;\n\t\tint destEndpoint = 0xA1;...
{ "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 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": "ExplicitRxIndicatorPacket.getRFData()", "constructor": false, "full_signature": "public byte[] getRFData()", "identifier": "getRFData", "inv...
{ "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_276
{ "fields": [ { "declarator": "frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue()", "modifier": "private", "original_string": "private int frameType = APIFrameType.DEVICE_RESPONSE_STATUS.getValue();", "type": "int", "var_name": "frameType" }, { "declarator": "fr...
{ "body": "@Test\n\tpublic final void testGetAPIPacketParameters() {\n\t\t// Set up the resources for the test.\n\t\tDeviceResponseStatusPacket packet = new DeviceResponseStatusPacket(frameID, status);\n\n\t\t// Call the method under test.\n\t\tLinkedHashMap<String, String> packetParams = packet.getAPIPacketParameter...
{ "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 = \"Devi...
{ "body": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"Status\", HexUtils.prettyHexString(HexUtils.integerToHexString(status.getID(), 1)) + \" (\" + status.getName() + \")\");\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_626
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/ATCommandExceptionTest.java", "identifier": "ATCommandExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testGetMessageOnlyCommandStatusAndMessage() {\n\t\t// Setup the resources for the test.\n\t\tATCommandStatus atCommandStatus = ATCommandStatus.OK;\n\t\tString message = \"This is the message\";\n\t\tATCommandException e = new ATCommandException(message, atCommandStatus);\n\t\t\n\...
{ "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": "@Override\n\tpublic String getMessage() {\n\t\tString message = super.getMessage();\n\t\t\n\t\tif (message == null)\n\t\t\tmessage = \"\";\n\t\t\n\t\tif (atCommandStatus != null) {\n\t\t\tif (message.length() > 0)\n\t\t\t\tmessage = message + \" > \";\n\t\t\tmessage = message + atCommandStatus.getDescripti...
{ "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_333
{ "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.TX_I...
{ "body": "@Test\n\tpublic final void testGetDataValidData() {\n\t\t// Set up the resources for the test.\n\t\tTXIPv4Packet packet = new TXIPv4Packet(frameID, destAddress, destPort, sourcePort, protocol, transmitOptions, data);\n\n\t\t// Call the method under test.\n\t\tbyte[] result = packet.getData();\n\n\t\t// Ver...
{ "fields": [ { "declarator": "OPTIONS_CLOSE_SOCKET = 2", "modifier": "public static final", "original_string": "public static final int OPTIONS_CLOSE_SOCKET = 2;", "type": "int", "var_name": "OPTIONS_CLOSE_SOCKET" }, { "declarator": "OPTIONS_LEAVE_SOCKET_OPEN = 0", ...
{ "body": "public byte[] getData() {\n\t\tif (data == null)\n\t\t\treturn null;\n\t\treturn Arrays.copyOf(data, data.length);\n\t}", "class_method_signature": "TXIPv4Packet.getData()", "constructor": false, "full_signature": "public byte[] getData()", "identifier": "getData", "invocations": [ "copyOf" ...
{ "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_763
{ "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 testPrettyHexStringWithByteArrayNonHexChars() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] array = \"tyurw\".getBytes();\n\t\tString expectedResult = \"74 79 75 72 77\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = HexUtils.prettyHexString(array);\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 String prettyHexString(String hexString) {\n\t\tif (hexString == null)\n\t\t\tthrow new NullPointerException(\"Hexadecimal string cannot be null.\");\n\t\t\n\t\tString copy = hexString.toUpperCase();\n\t\tfor (final char c : copy.toCharArray()) {\n\t\t\tif (!HEXES.contains(\"\"+c))\n\t\t\t\tt...
{ "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_299
{ "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 testSetRequestIDNegative() {\n\t\t// Set up the resources for the test.\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\trequestID = -1;\n\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"De...
{ "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 void setRequestID(int requestID) {\n\t\tif (requestID < 0 || requestID > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_REQUEST_ID_ILLEGAL);\n\n\t\tthis.requestID = requestID;\n\t}", "class_method_signature": "DeviceRequestPacket.setRequestID(int requestID)", "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_86
{ "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\tbyte[] atCommand = \"NI\".getBytes();\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\t\n\t\tbyte[] payload = new byte[1 + atCommand.length + data.l...
{ "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 static ATCommandPacket createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"AT Command packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (AT command)\n\t\tif (payload.length < MIN_API_PAYLOAD_LENGTH)\n\t\t\tthrow new Illega...
{ "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_574
{ "fields": [ { "declarator": "INVALID_IO_DATA = new byte[]{0x00, 0x01, 0x02, 0x03}", "modifier": "private static final", "original_string": "private static final byte[] INVALID_IO_DATA = new byte[]{0x00, 0x01, 0x02, 0x03};", "type": "byte[]", "var_name": "INVALID_IO_DATA" }, ...
{ "body": "@Test\n\tpublic void testGetDigitalValuesModify() {\n\t\t// Setup the resources for the test.\n\t\tIOSample ioSample = new IOSample(IO_DATA_MIXED);\n\t\t\n\t\t// Call the method under test.\n\t\tHashMap<IOLine, IOValue> values = ioSample.getDigitalValues();\n\t\tHashMap<IOLine, IOValue> backup = new IOSamp...
{ "fields": [ { "declarator": "ioSamplePayload", "modifier": "private final", "original_string": "private final byte[] ioSamplePayload;", "type": "byte[]", "var_name": "ioSamplePayload" }, { "declarator": "rawMask", "modifier": "private", "original_string": ...
{ "body": "public HashMap<IOLine, IOValue> getDigitalValues() {\n\t\treturn (HashMap<IOLine, IOValue>) digitalValuesMap.clone();\n\t}", "class_method_signature": "IOSample.getDigitalValues()", "constructor": false, "full_signature": "public HashMap<IOLine, IOValue> getDigitalValues()", "identifier": "getDigit...
{ "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_124
{ "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 testCreatePacketPayloadShorterThanNeeded() {\n\t\t// Setup the resources for the test.\n\t\tint frameType = APIFrameType.REMOTE_AT_COMMAND_RESPONSE.getValue();\n\t\t//int frameID = 0xE7;\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16B...
{ "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_431
{ "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 TX16 Request packet.\")));\n\t\t\n\t\t// Call the method under...
{ "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": "public static TX16Packet createPacket(byte[] payload) {\n\t\tif (payload == null)\n\t\t\tthrow new NullPointerException(\"TX16 Request packet payload cannot be null.\");\n\t\t\n\t\t// 1 (Frame type) + 1 (frame ID) + 2 (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_348
{ "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 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 SMS packet.\")));\n\n\t\t// Call the method under test tha...
{ "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 static TXSMSPacket 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_718
{ "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 testReadIntegerFromByteNegativeOffset() {\n\t\t// Setup the resources for the test.\n\t\texception.expect(IllegalArgumentException.class);\n\t\texception.expectMessage(is(equalTo(\"Offset must be between 0 and 7.\")));\n\t\t\n\t\t// Call the method under test.\n\t\tByteUtils.read...
{ "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 readIntegerFromByte(byte containerByte, int bitOffset, int bitLength) {\n\t\tif (bitOffset < 0 || bitOffset > 7)\n\t\t\tthrow new IllegalArgumentException(\"Offset must be between 0 and 7.\");\n\t\tif (bitLength < 0 || bitLength > 7)\n\t\t\tthrow new IllegalArgumentException(\"Length must...
{ "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_12
{ "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 testGetPacketDataWithoutDataWithFrameIDNotConfigured() {\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\t@Override\n\t\t\tpublic boolean needsAPIFrameID() {\n\t...
{ "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\tpublic byte[] getPacketData() {\n\t\tByteArrayOutputStream data = new ByteArrayOutputStream();\n\t\t\n\t\tdata.write(frameTypeValue);\n\t\t\n\t\tbyte[] apiData = getAPIData();\n\t\tif (apiData == null)\n\t\t\tapiData = new byte[0];\n\t\tif (apiData != null && apiData.length > 0) {\n\t\t\ttry {...
{ "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_173
{ "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 CoAP Tx Request packet.\")));\n\n\t\t// Call the method under...
{ "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_489
{ "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 testParsePacketStringAPIWithAPIEscaped() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E000F17010013A20040AD142EFFFE024E496D\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(is(equalTo(\"S...
{ "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_523
{ "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 testIsHardwareFlowControlWithHwFlowControl() {\n\t\t// Setup the resources for the test.\n\t\tSerialPortParameters params = new SerialPortParameters(9600, 8, 1, 0, 3); // 3 - Hardware flow control\n\t\tTestAbstractSerialPort port = new TestAbstractSerialPort(\"COM1\", params);\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 boolean isHardwareFlowControl() {\n\t\treturn parameters.flowControl == FLOW_CONTROL_HW;\n\t}", "class_method_signature": "AbstractSerialPort.isHardwareFlowControl()", "constructor": false, "full_signature": "public boolean isHardwareFlowControl()", "identifier": "isHardwareFlowControl", "...
{ "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_466
{ "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\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x00;\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX16Packet pac...
{ "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": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn ByteUtils.isBitEnabled(getReceiveOptions(), 1)\n\t\t\t\t|| ByteUtils.isBitEnabled(getReceiveOptions(), 2);\n\t}", "class_method_signature": "RX16Packet.isBroadcast()", "constructor": false, "full_signature": "@Override public boolean 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_45
{ "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 = 0x65;\n\t\tXBee16BitAddress dest16Addr = new XBee16BitAddress(\"D817\");\n\t\tint retryCount = 2;\n\t\tXBeeTransmitStatus transmitStatus = XBeeTransmitStatus.SUCCESS;\n\t\tXBeeDiscoverySta...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"16-bit dest. address\", HexUtils.prettyHexString(destAddress16.toString()));\n\t\tparameters.put(\"Tx. retry count\", \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_4
{ "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 testNotSupportedOperationSetNodeID() 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 that sho...
{ "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 void setNodeID(String nodeID) throws TimeoutException, XBeeException {\n\t\t// Not supported in Cellular.\n\t\tthrow new UnsupportedOperationException(OPERATION_EXCEPTION);\n\t}", "class_method_signature": "CellularDevice.setNodeID(String nodeID)", "constructor": false, "full_sign...
{ "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_535
{ "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 testFlush() throws IOException {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", 9600));\n\t\t\n\t\t// Call the method under test.\n\t\tport.flush();\n\t\t\n\t\t// Verify the result.\n\t\tMockito.verify...
{ "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_165
{ "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 testGetAPIPacketParametersReceivedDataNull() {\n\t\t// Setup the resources for the test.\n\t\tIPv6IODataSampleRxIndicator packet = new IPv6IODataSampleRxIndicator(ipv6address, null);\n\t\t\n\t\tString expectedSourceIPv6Addr = HexUtils.prettyHexString(ipv6address.getAddress()) + \...
{ "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": "@Override\n\tpublic LinkedHashMap<String, String> getAPIPacketParameters() {\n\t\tLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\n\t\tparameters.put(\"IPv6 source address\", HexUtils.prettyHexString(HexUtils.byteArrayToHexString(sourceAddress.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_470
{ "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\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint rssi = 75;\n\t\tint options = 0x14; /* bit 2 */\n\t\tbyte[] receivedData = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tRX16Packet packet...
{ "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": "RX16Packet.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_309
{ "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 testIsBroadcast() {\n\t\t// Set up the resources for the test.\n\t\tDeviceResponsePacket packet = new DeviceResponsePacket(frameID, requestID, data);\n\n\t\t// Call the method under test and verify the result.\n\t\tassertThat(\"Packet should not be broadcast\", packet.isBroadcast...
{ "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": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn false;\n\t}", "class_method_signature": "DeviceResponsePacket.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_759
{ "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 testPrettyHexStringGeneral() {\n\t\t// Setup the resources for the test.\n\t\tString s = \"1e2589d3a896f47c90b\";\n\t\tString expectedResult = \"01 E2 58 9D 3A 89 6F 47 C9 0B\";\n\t\t\n\t\t// Call the method under test.\n\t\tString result = HexUtils.prettyHexString(s);\n\t\t\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 String prettyHexString(String hexString) {\n\t\tif (hexString == null)\n\t\t\tthrow new NullPointerException(\"Hexadecimal string cannot be null.\");\n\t\t\n\t\tString copy = hexString.toUpperCase();\n\t\tfor (final char c : copy.toCharArray()) {\n\t\t\tif (!HEXES.contains(\"\"+c))\n\t\t\t\tt...
{ "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_53
{ "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() throws OperationNotSupportedException {\n\t\t// Setup the resources for the test.\n\t\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\...
{ "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 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_132
{ "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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tATCommandStatus status = ATCommand...
{ "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 byte[] getCommandValue() {\n\t\treturn commandValue;\n\t}", "class_method_signature": "RemoteATCommandResponsePacket.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_562
{ "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 testGetReceiveTimeout() {\n\t\t// Setup the resources for the test.\n\t\tTestAbstractSerialPort port = Mockito.spy(new TestAbstractSerialPort(\"COM1\", \n\t\t\t\tnew SerialPortParameters(9600, AbstractSerialPort.DEFAULT_DATA_BITS, \n\t\t\t\t\t\tAbstractSerialPort.DEFAULT_STOP_BITS, Abs...
{ "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 int getReceiveTimeout() {\n\t\treturn receiveTimeout;\n\t}", "class_method_signature": "AbstractSerialPort.getReceiveTimeout()", "constructor": false, "full_signature": "public int getReceiveTimeout()", "identifier": "getReceiveTimeout", "invocations": [], "modifiers": "public", "param...
{ "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_427
{ "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\tXBee64BitAddress dest64Addr = new XBee64BitAddress(\"FFFF\");\n\t\tint options = 40;\n\t\tbyte[] data = new byte[]{0x68, 0x6F, 0x6C, 0x61};\n\t\tTX64Packet p...
{ "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": "@Override\n\tpublic boolean isBroadcast() {\n\t\treturn get64bitDestinationAddress().equals(XBee64BitAddress.BROADCAST_ADDRESS);\n\t}", "class_method_signature": "TX64Packet.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_569
{ "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 testCreateSerialPortInfoEmptyName() {\n\t\t// Setup the resources for the test.\n\t\tString name = \"\";\n\t\t\n\t\t// Call the method under test.\n\t\tSerialPortInfo info = new SerialPortInfo(name);\n\t\t\n\t\t// Verify the result.\n\t\tassertThat(info.getPortName(), is(equalTo(...
{ "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 getPortName() {\n\t\treturn portName;\n\t}", "class_method_signature": "SerialPortInfo.getPortName()", "constructor": false, "full_signature": "public String getPortName()", "identifier": "getPortName", "invocations": [], "modifiers": "public", "parameters": "()", "return": "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_139
{ "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 testGetAPIPacketParametersRFDataNull() {\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 = ...
{ "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_586
{ "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=InvalidOperatingModeException.class)\n\tpublic void testStopListeningInvalidOperatingMode() throws TimeoutException, XBeeException {\n\t\t// Throw an Invalid operating mode exception when setting any parameter.\n\t\tMockito.doThrow(new InvalidOperatingModeException()).when(ipv6Device).setPar...
{ "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" }
21871478_355
{ "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 testGetDataNullData() {\n\t\t// Set up the resources for the test.\n\t\tdata = null;\n\n\t\tTXSMSPacket packet = new TXSMSPacket(frameID, phoneNumber, data);\n\n\t\t// Call the method under test.\n\t\tString result = packet.getData();\n\n\t\t// Verify the result.\n\t\tassertThat(...
{ "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 String getData() {\n\t\treturn data;\n\t}", "class_method_signature": "TXSMSPacket.getData()", "constructor": false, "full_signature": "public String getData()", "identifier": "getData", "invocations": [], "modifiers": "public", "parameters": "()", "return": "String", "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_705
{ "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 testByteArrayToShort2Bytes() {\n\t\t// Setup the resources for the test.\n\t\tbyte[] byteArray = new byte[]{0x12, 0x34};\n\t\tshort expectedResult = 0x1234;\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_210
{ "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 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(\"TX IPv6 packet payload cannot be null.\")));\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_640
{ "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 testGetIPAddressMask() throws Exception {\n\t\t// Return a valid response when requesting the MK parameter value.\n\t\tMockito.doReturn(IP_ADDRESS).when(wifiDevice).getParameter(PARAMETER_MK);\n\n\t\tassertEquals(Inet4Address.getByAddress(IP_ADDRESS), wifiDevice.getIPAddressMask());\n\...
{ "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 Inet4Address getIPAddressMask() throws TimeoutException, XBeeException {\n\t\ttry {\n\t\t\treturn (Inet4Address) Inet4Address.getByAddress(getParameter(\"MK\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\tthrow new XBeeException(e);\n\t\t}\n\t}", "class_method_signature": "WiFiDevice.getIPAddr...
{ "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_494
{ "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 testParsePacketStringAPIEscapedInvalidLengthLonger() throws InvalidPacketException {\n\t\t// Setup the resources for the test.\n\t\tString dataString = \"7E001F1701007D33A20040AD142EFFFE024E496D\";\n\t\texception.expect(InvalidPacketException.class);\n\t\texception.expectMessage(...
{ "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_181
{ "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 testSetTransmitOptionsTXURIOptionsIllegal() {\n\t\t// Set up the resources for the test.\n\t\tCoAPTxRequestPacket packet = new CoAPTxRequestPacket(frameID, options, method, destAddress, CoAPURI.URI_DATA_TRANSMISSION, data);\n\n\t\texception.expect(IllegalArgumentException.class);...
{ "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_752
{ "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 testIntegerToHexStringNegativeMinBytes() {\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 ...
{ "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_302
{ "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 testSetTargetBiggerThan255() {\n\t\t// Set up the resources for the test.\n\t\tDeviceRequestPacket packet = new DeviceRequestPacket(requestID, target, data);\n\n\t\ttarget = new String(new char[256]).replace('\\0', '-');\n\n\t\texception.expect(IllegalArgumentException.class);\n\...
{ "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 void setRequestTarget(String target) {\n\t\tif (target != null && target.length() > 255)\n\t\t\tthrow new IllegalArgumentException(ERROR_TARGET_ILLEGAL);\n\n\t\tthis.target = target;\n\t}", "class_method_signature": "DeviceRequestPacket.setRequestTarget(String target)", "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_58
{ "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\tXBee64BitAddress source64Addr = new XBee64BitAddress(\"0013A2004032D9AB\");\n\t\tXBee16BitAddress source16Addr = new XBee16BitAddress(\"D817\");\n\t\tint options = 0x46; /* bit 1 */\n\t\tbyte[] receivedData...
{ "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": "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": "IODataSampleRxIndicatorPacket.getRFData()", "constructor": false, "full_signature": "public byte[] getRFData()", "identifier": "getRFData", ...
{ "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_617
{ "fields": [], "file": "library/src/test/java/com/digi/xbee/api/exceptions/XBeeExceptionTest.java", "identifier": "XBeeExceptionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic final void testCreateXBeeExceptionMessageAndCauseNull() {\n\t\t// Setup the resources for the test.\n\t\tString message = \"This is the message\";\n\t\tThrowable cause = null;\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// V...
{ "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_247
{ "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 testGetAPIPacketParametersReceivedDataNotNull() {\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\t// Call the method under test...
{ "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_528
{ "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 testSetPortParametersNegativeFlowControl() 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\tTestAbst...
{ "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" }