Yes, you can get a list of connected sensors. I'll use the TestNative
class as starting point.
After the sdManager has been setup with a DeviceConfig, you can ask it
for the SensorDevice using:
sensDevice = sdManager.getSensorDevice()
Then you can ask the sensor device for its current config using:
sensDevice.getCurrentConfig()
That should return an ExperimentConfig describing the currently attached
sensors. Not all of the supported devices can auto id sensors. So if
you want to make this code general you might wan to call:
sensDevice.canDetectSensors() before calling getCurrentConfig.
The code hasn't been used that way as far as I know, so let me know if
you have problems. There might be some initialization you need to do
the sensDevice before calling getCurrentConfig.
It is great to hear that this code is being used. I've checked in a few
changes over the last week, I'll send out an announcement once I've
tested them a bit more.
Scott
The canDetectSensors() and getCurrentConfig() are not implemented for
the go-link device.
I'm looking into it, I think I can implement it without changing the
native code. If that is true I'll do it now. Otherwise this might
take some time.
There is a list of possible sensors in the SensorConfig interface.
Scott
I updated the TestNative class so it gets the current config and prints it.
I'll try get the native libraries rebuilt and checked in later this
week. If you want to give it a go, you can try rebuilding the library
for your platform yourself. The Makefile is the file used for windows
and Makefile-mac is used for OS X. The CCSensorSDK-README has some
information about rebuilding but is focused on the TI driver and is
probably out of date.
Scott
I haven't done the recompilation yet. I got stuck on some other issues
last week. I'm planning to do it today, and will send out an email when
I do.
It should be possible to run it as an applet but it will take a little
work.
1. Because it uses native libraries, I'm pretty sure the applet will
need to be signed. It needs to be signed so it can ask for more
permissions. Without being signed applets can't access the file system
or load native libraries.
2. I don't believe that applets have a way to load native libraries from
a jar file (webstart can do this). So the native libraries need to be
copied into the correct place inside of the java_home folder. I don't
know what that place is but you can probably find it pretty easily.
To track down the problems you should make sure you look at the applet
console. If you are running firefox you'll need to install a plugin so
you can see the applet console. Feel free to send the console output I
probably can tell what is going wrong from that.
Scott
Scott
Thanks.