Difference between BTConnection and NXTConnection

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

Difference between BTConnection and NXTConnection

Postby tamasu » Wed Dec 05, 2012 9:56 pm

Hi,

I am trying to exchange some data between two NXTs using bluetooth, however cannot understand the difference between the connection classes BTConnection and NXTConnection.

Is the difference related to its purpose, that is if you are going to connect an NXT to PC you should use a particlar class and for NXT to NXT you should use the other one?

Thanks
tamasu
New User
 
Posts: 7
Joined: Sun Nov 25, 2012 12:14 am

Re: Difference between BTConnection and NXTConnection

Postby gloomyandy » Wed Dec 05, 2012 10:28 pm

NXTConnection is the base class for various connection classes used by leJOS (Bluetooth, USB, RS485). BTConnection is class derived from NXTConnection that implements connections via Bluetooth. In general you do not need to use BTConnection it is simply the implementation of the more general NXTConnection for Bluetooth. By using NXTConnection you will ensure your code is more general and easier to switch between the different connection types. To actually create the connection you need to use either the Bluetooth class and the more generic NXTCommConector class. To understand how these classes can be used take a look at the NXTConnectTest sample program.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK


Return to NXJ Software

Who is online

Users browsing this forum: kirkpthompson and 1 guest

more stuff