Converting to an App

Converting it Into an App

Now take the source code file (hello.c) and make an application out of it.

Applications are described by an "application definition" text file ending with the suffix ".adef". The format is intended to be easy to read and write.

To turn hello.c into an application, create an application definition file called "helloWorld.adef" that looks like this:

executables:

    helloWorld ( hello.c )


processes:

    run: (helloWorld)

This defines one executable called helloWorld implemented by hello.c, and then starts one instance of the helloWorld executable.

If your executable has multiple source files, add more files inside the parentheses after the executable name: "helloWorld ( hello.c foo.c )".

Run mkapp to build the executable and bundle it into an application.

Use the "-t" option to build a target other than the default "localhost" target.

This is how to build the helloWorld application for a device running the Sierra Wireless WP7 module:

$ mkapp -t wp7 helloWorld.adef
Note:
If you're building an AR7 app, substitute ar7 for wp7 in the mkapp run command.

Now, you have a file called helloWorld.wp7. Use "instapp" to install it on your target so it can be started automatically by the Supervisor when the device boots up.

$ instapp helloWorld.wp7 <ip addr>

The second argument tells the target device host address from where to run the application. This will connect to the target, upload the application, and start it.

Your installed application output will display in logread on the target device, not on the terminal you used to install the application.
Run logread -f to get logs. Logread displays messages from syslogd using .adef process settings: LE_LOG_LEVEL = DEBUG and LE_LOG_LOCATION = "stderr + syslog".

Use "rmapp" to uninstall your application.

$ rmapp helloWorld.wp7 <ip addr>

Use "lsapp" to list the applications installed on a target.

$ lsapp <ip addr>

Copyright (C) Sierra Wireless, Inc. 2014. All rights reserved. Use of this work is subject to license.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines