How to send request to a device
-
Hi,
I am new for bacnet. I have a bacnet device , and let's say its id is 2.
How can I write a small java to sent request to the device and get back its response? -
Check out the source code in the test package.
-
Thanks Mlohbihler
I try to complie the Test2, and get following error.Did I make someting uncorrect?
Test2.java:39: cannot find symbol
symbol : variable read
location: class com.serotonin.bacnet4j.test.Test2
ReadPropertyAck ack = (ReadPropertyAck) localDevice.send(addr, null, 14
6, Segmentation.segmentedBoth, read);^
Note: Test2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error -
Yes. It doesn't know what the symbol "read" is.
-
Yes, you are right.
I took out the "read" object.
Now, I put it back,and (following ) this is the actual error (my first error) while doing compling.
It seems some classes missing in the package.Test2.java:37: cannot access com.serotonin.util.queue.ByteQueue
class file for com.serotonin.util.queue.ByteQueue not found
ReadPropertyRequest read = new ReadPropertyRequest(new ObjectIdentifier(
ObjectType.device, deviceId),
^
Note: Test2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details. -
seroUtils.jar is included in the package. You need this in your classpath.
-
in the package, we use a lot of com.serotonin.util.queue.ByteQueue;but
where i can find the source code for
com.serotonin.util.queue.ByteQueue?
Or, what is method or function for it? -
ByteQueue is in the seroUtils.jar file, which is not open source. You shouldn't really need it since it's just a utility class anyway.