0

New to AJ - Help with AJTCL (Arduino Due)

asked 2014-07-11 11:19:36 -0700

AllJoyner gravatar image

Hello everyone,

For the past 2-3 weeks I have done a lot of research about AllJoyn and tested most of the examples successfully. I have a pretty good idea how to do Android and Java development using AJSCL. I was able to run the chat app on two Android phones and a Windows computer at the same time.

What I am a bit confused about is how to do development using AJTCL and Arduino Due. I have followed the guide and I was able to successfully build arduino_due library and run AJ_LedService example and I noticed that AllJoyn code is all in due_led.cpp file.

So, if I wanna build apps using AJTCL on Arduino do I really have to do it in C++? I was expecting that we could do it using Arduino programming language or at least Java, because I am not really familiar with C++.

I have read all the guides provided but if somebody could simplify it a bit and explain how to get started with Arduino and AJTCL it would be very appreciated.

Thanks in advance!

Regards

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-07-14 17:59:57 -0700

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

When you write Arduino code you are writing a sketch which gets compiled into byte code. The Arduino system has a g++ compiler that will take the C++/C code and convert that to byte code that will run on the MCU. The AllJoyn Thin Client Library is written in C, however, for Arduino we rename the files as .cpp so that the Arduino compiler will pick them up and compile them into byte code. When you use the AllJoyn Thin Library you will need to write the application in C and you can follow the example. In the Sketch you have a call into the .cpp file to run the message loop that will handle asking for a message from the AllJoyn Router that it connects to and sending data. Starting with the sample and making modifications is pretty straight forward and you will be up and running faster than you think.

edit flag offensive delete publish link more

Comments

Hey Brian, thanks a lot for the answer. I kind off assumed that I would have to do it in C or C++. Is there any examples written in Java that I could run to interact with Arduino, just for testing purposes. I want to build an Android App and use it to control Arduino powered device. Thanks

AllJoyner ( 2014-07-16 11:01:25 -0700 )edit

Any AllJoyn application can communicate with each other regardless of the language used. The basic Android sample (https://git.allseenalliance.org/cgit/core/alljoyn.git/tree/alljoyn_java/samples/android/basic) can communicate with the AJ_basic (client/service) Arduino sketches from the Thin Core SDK.

bspencer ( 2014-07-16 11:34:13 -0700 )edit

Also, if you feel my answer explains things could you please mark it as such? Thank you.

bspencer ( 2014-07-16 11:34:45 -0700 )edit

I know that it does not matter which language we use, but I meant if there are more examples,such as AJ_LedService running on Arduino and LedCtrl running on computer, but written in Java instead,because those were the only ones explained in the pdf. I will look into the basic client/service. Thanks

AllJoyner ( 2014-07-17 10:28:55 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-07-11 11:19:36 -0700

Seen: 482 times

Last updated: Jul 14 '14