List of connected devices

2 views
Skip to first unread message

Jeff

unread,
Apr 16, 2008, 6:27:17 AM4/16/08
to org-concord-sensor
Hi, thankyou for all of the code for the usb devices and I was
wondering if there was a way to pull out a list of connected devices
and how I would go about that, thankyou for your time, and congrats on
being a father.

Scott Cytacki

unread,
Apr 17, 2008, 7:21:59 AM4/17/08
to org-conco...@googlegroups.com
Hi Jeff,

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

Jeff Albert

unread,
Apr 28, 2008, 6:15:05 AM4/28/08
to org-conco...@googlegroups.com
Hi Scott,
I have been working on getting it to detect a list of sensors, I
have made some progress in it, but not as much as I would have hoped,
the issue is that when I do the sensDevice.canDetectSensors() it returns
false, Ive been trying to find out why or an alternative way of getting
a list of connected sensors, alternatively, is there any print out
option of all possible sensors cuz that would work as well, thankyou.

Scott Cytacki

unread,
Apr 28, 2008, 10:15:34 AM4/28/08
to org-conco...@googlegroups.com
Sorry, I was wrong.

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

Scott Cytacki

unread,
Apr 28, 2008, 12:32:29 PM4/28/08
to org-conco...@googlegroups.com
Ok, I couldn't not implement it without changing the native code. I've
made the change to the native code and tested it on OS X x86. I
checked in the code but have not rebuilt and checked in the win32 and
OSX native libraries.

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

Jeff Albert

unread,
May 5, 2008, 8:51:23 AM5/5/08
to org-conco...@googlegroups.com
Hi I was wondering a couple of things, first off could I get an update
on the recompilation of the basecode so the new test-native file where
you get a list of connected devices works, and two Ive tried to update
the test-native file to run as an applet and that doesn't seem to be
working and I wonder if it has to do with threading in applets and if
you knew a workaround to this ?
Thankyou for your time,
Jeffrey Albert

Scott Cytacki

unread,
May 5, 2008, 9:51:18 AM5/5/08
to org-conco...@googlegroups.com
Hi Jeff,

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 Cytacki

unread,
May 6, 2008, 4:44:14 PM5/6/08
to org-conco...@googlegroups.com
Ok the native libraries are rebuilt and checked in. So you should be
able to discover the attached sensor on the GoLink.

Scott


Jeff Albert

unread,
Jun 4, 2008, 2:12:43 PM6/4/08
to org-conco...@googlegroups.com
Hi again, quick question since Im having trouble getting this to work,
but does the current setup support multiple vernier devices at once? It
seems to have a system to deal with it since its always arrays of
configurations, but the size of the array is always one.

Thanks.

Reply all
Reply to author
Forward
0 new messages