I'm nxj beginner. I have some questions about bluetooth communication between PC and brick. First, when bluetooth communication occurs, where is the birthplace processing this datas? In other words, I want to know whether these datas will be processed on CPU or brick. Second, what is exact roles CPU and brick in bluethooth communication? That means what is processed on CPU and what is processed on brick. I have searched almost web site but I can't find this anywhere. Please help me. Thanks.
2 Answers
You can see it in the package structure.
- lejos.nxt.*
- This package contains classes running on the NXT-brick. All code in this package will be compiled for the brick and will run on the brick.
- lejos.pc.*
- Here the difference is not that clear. This is java-code you compile for personal computer. So most code runs on your computer. But some classes (e.g: RemoteMotorController) only send messages to the NXT-brick which gives commands to the motors.

- 755
- 1
- 5
- 17
lejos.pc.comm provides API's that allow you to communicate/control the nxt robot from the PC.
When importing the the libs to an Android project, it allows you to build an instance of the same environment used on a pc, but within android.
I agree it can be tough finding some things out. It would be great if there was as stronger lejos presence on SO
This question is months old and has remained un-answered I actually have a lot of questions about it myself, but I might be able to provide some insight for utter novices.
when using bluetooth with Android and NXJ robots, you use either lejos.pc.comm or lejos.NXJ.
Both provide APi's to do almost the same thing, but work a little differently. I don't know nearly enough about the NXJ api, but I do know that it is the one that lets you manipulate the robot much more effectively, such as outputting data to it's LCD screen, which you can't do with the pc.comm api
As far as I can tell, the pc.comm API uses both Android Bluetooth API's and it's own protocols to allow communication with Lego LCP commands.
(I want to come back to this, but I'm writing a dissert on the topic so I'll try to update it in a couple of days. Seems not many are interested though, shame)

- 186
- 2
- 17