Re: [Nxtcommand-developers] NXTCommBluecove
Status: Beta
Brought to you by:
bbagnall
From: Brian B. <bba...@mt...> - 2007-07-22 18:28:39
|
> I have added a BlueCove NXTComm implementation, and commited the changes > to > SVN. > I did perform a little test: run Tachocount and Melody samples. Result: > OK! > I am using the Microsoft BT stack. I am very pleased that we know have a > stable BT link for Windows (1st impression). Hi Peter, I gave it a whirl and it works great, and fast - faster connecting than even RXTX I think. The only problem I found was that it can't run twice in a row without turning off the NXT brick. Lawrie is able to do this so there must be a way to finalize a Bluetooth connection on the close() method. > Remark: there is a bug in the Motor class. After the motor A has reached > it's > tacholimit and has stopped, the method "public boolean isMoving()" is > still > returning true, > causing an endless loop while(isMoving()) {Thread.yield();} in the method > "public int rotate(long count, boolean returnNow)" Some additional testing > / bug fixing > before a new release may be wise. I'll look into that. > The NXTCommBleuCove is not documented yet. Probably I have some time next > week (23-29 July) > Instructions: > - bluecove-2.0.0.jar must be in the classpath. > - icommand.properties (in home or work directory): > nxtcomm.type=bluecove > nxt.btaddress=00:16:53:01:EC:04 > > So 1. there is a new value for the nxtcomm.type --> bluecove > 2. there is a new property nxt.btaddress : the bluetooth address of the > NXT > brick. > This property is used both for BleuCove and BlueZ. > > I have kept the old property bluez.address. The new property nxt.address > is > preferred. > Both properties are interchangeable. nxt.btaddress is examined 1st, if > it's > null bluez.address is used. > > I have implemented the NXTCommBlueCove just like the other existing > NXTCom implementations in icommand. I didn't make use of the search > function and OS detection (yet). The main reason is because I > didn't want to adapt the other implementations (lack of time). > > What do you think of NXTCommBlueCove that is in SVN now ? > - We could you OS detection to prevent a user to choose an implementation > that is not supported on his OS. Definitely. Lawrie's code in NXTCommFactory is dead simple for that. > User still has to supply a COM port or BT address in icommand.properties. > - searching for BT devices is a neat feature when using a GUI to select a > device from a list; supplying a BT address is faster (did you notice). I'd like to see it search for an NXT brick and automatically add the first address it finds to the properties file. I think users will have a hard time finding and entering their address. Once it's in the properties it wouldn't have to search again (unless it fails to connect using that address). > I think it would be good to discuss the NXTComm implementations in the > near > future: > - what can be automatically detected (OS, BT devices) platform, should not > be configured (icommand.properties). I agree > - Prevent duplicate code between Lejos NXJ and Icommand. Options: > 1. Move PC code of Lejos to Icommand, or 2. move Icommand to Lejos (and > stop Icommand project) ??? Vote: 1 ? I mentioned this to Lawrie and basically we don't want to do this quite yet, though it might be on the table in the future. He wants to get some other things straightened up and simplified before adding complexity to the project. I agree with him on that. > - The number of BT / USB implementations is becoming overwhelming. Can we > eliminate some of them ? Probably Not :-( The surefire things we have are: - BlueCove for Windows (coming soon for Linux) - Bluez for Linux (and OS X?) - ?? For Mac OS X. And of course we should implement USB support sometime in the future, but probably not for the next release. I don't mind leaving in support for multiple methods as an option, but once we have good solid solutions for Win/Linux/Mac maybe we could just not document them anymore. In summary, the changes I'd like to see in the next release are: - Bug in Motor (me) - Auto OS detection and NXTComm selection (ME or you?) - Auto detection of address and write to properties (me or you?) - Better close() method (me or you?) - General cleanup of some methods to match NXJ (me) - Little bit of testing. - Aim for a release soon - Friday or sooner. - Brian |