Array to NXT

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

Moderators: roger, 99jonathan, imaqine

Array to NXT

Postby huran438 » Mon Jan 21, 2013 8:49 am

So i have a string array with 100 slots....
How can i send it to NXT from Android through bluetooth? Are there ane examples?
huran438
New User
 
Posts: 3
Joined: Mon Jan 21, 2013 8:47 am

Re: Array to NXT

Postby skoehler » Mon Jan 21, 2013 4:01 pm

On the NXT side: wait for a connection and obtain an InputStream.
On the Android side: connect to the NXT, and open an OutputStream.

Wrap both Streams in DataInput/OutputStreams. Then first send the length of the array. Then send its contents.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: Array to NXT

Postby huran438 » Tue Jan 22, 2013 3:30 pm

Thanks a lot!But are there any examples?)
huran438
New User
 
Posts: 3
Joined: Mon Jan 21, 2013 8:47 am

Re: Array to NXT

Postby skoehler » Tue Jan 22, 2013 3:37 pm

Android-side: don't know. Certainly, you will find some samples on the net, which will explain how to connect to a device that implements SPP (which the NXT does).
NXT-side: take a look inside samples.zip. There is a BTReceive sample. I'm not sure right now, whether the connection is transparent, or whether there is some kind of protocol you have to follow. leJOS is certainly able to provide you with a transparent bluetooth connection.
skoehler
leJOS Team Member
 
Posts: 1108
Joined: Thu Oct 30, 2008 4:54 pm

Re: Array to NXT

Postby huran438 » Wed Jan 23, 2013 7:29 pm

Thanks
huran438
New User
 
Posts: 3
Joined: Mon Jan 21, 2013 8:47 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff