itm / wsn-device-drivers Goto Github PK
View Code? Open in Web Editor NEWDrivers for Wireless Sensor Network Devices
License: Other
Drivers for Wireless Sensor Network Devices
License: Other
Currently, each device driver instance uses 3 threads to do its work. There should be only the (necessary) RXTX thread and one (ideally shared) instance of some scheduler thread of a ScheduledExecutorService
instance that is passed to the various classes which can be used to execute logic and handle user or device events.
ExecutorService you want to shutdown manually should be given as constructor arguments. Default ExecutorService initialisation can be kept. See for example the SimpleTimeLimiter, which initializes an internal CachedThreadExecutor but has no method for a shutdown.
The MacAddress class should be able to be constructed from Strings (Hex, Dec, Binary), Longs and Byte-Arrays. In the same manner it should have methods to return the MacAddress as one of these types.
When you call the read() method without available check the read will block until something happens. When no a device call any method from the source InputStream it will also lock. This can only be solved by decoppling the whole inputstreams.
This has several advantages:
<3 Google Guava ;)
An Operation currently contains the operation itselfs and the whole lifecycle. The lifecycle of an operation should separated. This reduces the code and can make the AbstractOperation not anymore necessary. So you can create a operation by only implementing an interface instead of extending a class.
This will introduce a OperationContainer, OperationContainerFactory, OperationContext (for accessing the container from the operation, e.g. for canceling an operation).
Cause async can only be realized with threads this package makes not sense. Reduces the amount of packages.
Currently cause this is a fork of the rsc project the packages has ro be renamed correctly.
The Apache Commons Lang library provides the class SystemUtils that helps to check if the system is currently running on whatever OS.
Allows to remove the monitor method.
The factory receives two parameters type
and port
of either an enum
type or a String
which can be mapped to the enum
type and creates the appropriate instance.
The factory receives two parameters type
and port
of either an enum
type or a String
which can be mapped to the enum
type and creates the appropriate instance.
Device interface should include a shutdown() method that should be used instead of connection.shutdown() or Closeables.closeQuietly(Connection) when deleting the device.
Currently the native libraries are extracted in the current working dir. This should be changed to somethink like ~/.wsn-device-drivers. For this the java classpath has to be changed at runtime.
Currently cause of the ProgressManager the output of these two devices is a little bit wired. This has to be fixed.
Devide the components in such a way that you can define a device as a GuiceModule. This should allow to remove the Device Interface, cause the factories are provided by guice, allow a much better loosely coppling and hopefully a better testability ;)
Currently the locking of the input stream is bounded to the serial port devices.
For the internal developed Wasemote Devices this is needed.
The TimeLimiter can be shared between all operations. A singlethreadExecutor is enough. The shutdown of this executor can be done manual externally.
Currently the device drivers parse iSense messages. Cause this has to be handled by an more upper layer this has to be removed from the drivers.
Flush automatically the buffer when
Each instance of this wrapper needs his own ScheduledExecutorService.
Cause this class is grown with the project and was only designed for testing. This should be refactored in something like a DeviceExampleBuilder. That allows more control over the device example creation.
The code is just horrible...
This is necessary for both dependency injection and the usage of the Mockito library for unit testing.
Cause a OperationHandle should have the whole functianlity of a Future it should extend it. ListenableFuture allows to add addional listeners besides the callback and execute them in separated threads.
I tried to flash an isense node using the flash utitlity from http://github.com/itm/wsn-device-utils/. It failed with the following errors:
java -jar wsn-device-utils-0.3-SNAPSHOT-flash.jar isense /dev/ttyUSB2 vlinks.bin
myJarPath=file:/home/testbeduzl/wsn-device-utils-0.3-SNAPSHOT-flash.jar
oneJarPath=file:/home/testbeduzl/wsn-device-utils-0.3-SNAPSHOT-flash.jar
Experimental: JNI_OnLoad called.
RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyUSB2
2011-05-12 09:37:49,271 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Starting flash operation...
2011-05-12 09:37:49,294 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 0%
2011-05-12 09:37:49,496 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 1%
2011-05-12 09:37:49,698 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 2%
2011-05-12 09:37:49,900 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 3%
2011-05-12 09:37:49,910 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 4%
2011-05-12 09:37:49,913 | pool-1-thread-1 | DeviceFlasherCLI$1 | INFO | Progress: 6%
2011-05-12 09:37:49,917 | pool-1-thread-1 | AbstractOperation | ERROR | Exception during operation execution
de.uniluebeck.itm.wsn.drivers.core.exception.InvalidChecksumException
at de.uniluebeck.itm.wsn.drivers.jennic.JennicDevice.receiveBootLoaderReply(JennicDevice.java:281)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.getChipType(JennicGetChipTypeOperation.java:54)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.execute(JennicGetChipTypeOperation.java:106)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.execute(JennicGetChipTypeOperation.java:14)
at de.uniluebeck.itm.wsn.drivers.core.operation.AbstractOperation.executeSubOperation(AbstractOperation.java:178)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicProgramOperation.execute(JennicProgramOperation.java:78)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicProgramOperation.execute(JennicProgramOperation.java:12)
at de.uniluebeck.itm.wsn.drivers.core.operation.AbstractOperation.call(AbstractOperation.java:116)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
2011-05-12 09:37:49,921 | pool-1-thread-1 | DeviceFlasherCLI$1 | ERROR | Flashing node failed with Exception: de.uniluebeck.itm.wsn.drivers.core.exception.InvalidChecksumException
de.uniluebeck.itm.wsn.drivers.core.exception.InvalidChecksumException
at de.uniluebeck.itm.wsn.drivers.jennic.JennicDevice.receiveBootLoaderReply(JennicDevice.java:281)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.getChipType(JennicGetChipTypeOperation.java:54)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.execute(JennicGetChipTypeOperation.java:106)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicGetChipTypeOperation.execute(JennicGetChipTypeOperation.java:14)
at de.uniluebeck.itm.wsn.drivers.core.operation.AbstractOperation.executeSubOperation(AbstractOperation.java:178)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicProgramOperation.execute(JennicProgramOperation.java:78)
at de.uniluebeck.itm.wsn.drivers.jennic.JennicProgramOperation.execute(JennicProgramOperation.java:12)
at de.uniluebeck.itm.wsn.drivers.core.operation.AbstractOperation.call(AbstractOperation.java:116)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
This method is equals for the jennic and pacemate devices and TelosB returns null. So when this data is needed it should be provided at a higher level?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.