Skip to content

Command Line Interface: Application Development Using IoTSuite

Pankesh Patel edited this page Oct 15, 2016 · 20 revisions

The application development using IoTSuite involves an application development process to follow. It involves writing high-level specifications (i.e., domain specification, architecture specification, user interaction specification, deployment specification), compilation of these specifications that results into programming frameworks (i.e., domain framework, architecture framework, User interface framework), and writing code on top of these frameworks at different stages of the application development process.

IoTSuite is depended on some external library. So, Before downloading ToolSuite, users have to set-up. See [set up guide] (https://github.com/pankeshlinux/IoTSuite/wiki/Set-up:-Command-line-version-of--IoTSuite-in-Eclipse)

Application development using IoTSuite involves the following steps:

1. Specifying domain specification.

This stage involves the following steps:

  1. Create vocab.mydsl file.

  2. Write domain specification in vocab.mydsl file. (Examples are available IoTSuite\Examples)

  1. Copy the vocab.mydsl file into Spec folder. You can find this folder in the directory where you put IoTSuite project. For instance, If you copy IoTSuite project in D:/IoTSuite, you have to copy vocab.mydsl file into the D:/IoTSuite/Spec/ path.

2. Compiling domain specification.

This stage involves the invoking IoTSuite from the command-line interface. The command involves two arguments: (1) Activity name (in our case - compile-vocab-spec) (2) a path where you want to generates output. (for instance, C:\IoTSuite-Template\)

In Eclipse, you can invoke IoTSuite in the following way:

  1. Go to Run Menu > Run Configuration option > Press Argument Tab
  2. Write the following two line command in the Argument tab, as shown in the following image.

Compiling Vocabulary Specification

3. Specifying application architecture.

This stage involves the following steps:

  1. Create arch.mydsl file.

  2. Write architecture specification in the arch.mydsl file. (Examples are available IoTSuite\Examples)

  1. Copy the arch.mydsl file into "Spec" folder. You can find this folder in the directory where you put IoTSuite project. For instance, If you copy IoTSuite project in D:/IoTSuite, you have to copy arch.mydsl file into the D:/IoTSuite/Spec/ path.

4. Compiling architecture specification.

This stage involves the invoking IoTSuite from the command-line interface. The command involves two arguments: (1) Activity name (in our case - compile-arch-spec) (2) a path where you want to generates output. (for instance, D:\IoTSuite-Template\)

In Eclipse, you can invoke IoTSuite in the following way:

  1. Go to Run Menu > Run Configuration option > Press Argument Tab
  2. Write the following two line command in the Argument tab, as shown in the following image.

Compiling architecture specification

5. Implementing application logic.

The compilation of the architecture specification generates an "architecture framework" in the ApplicationLogic folder, which can be found in the IoTSuite-Template folder. To implement the application logic, a developer has to follow the following steps:

  1. Import ApplicationLogic folder into Eclipse IDE ( File > Import > Existing Projects into Workspace > Select root directory > Press Browse button > Provide path of ApplicationLogic folder (in our case, it can be found in C:\IoTSuite-Template\ApplicationLogic) > Finish ).

  2. Open Logic package of the ApplicationLogic folder.

  3. Write application logic in each generated files

The following image shows the imported ApplicationLogic folder into EclipseIDE and a place, where application developer writes application logic.

6. Specifying User Interaction Specification

  1. Create userinteraction.mydsl file.

  2. Write architecture specification in the userinteraction.mydsl file. (Examples are available IoTSuite\Examples)

  3. Copy the userinteraction.mydsl file into "Spec" folder. You can find this folder in the directory where you put IoTSuite project. For instance, If you copy IoTSuite project in D:/IoTSuite, you have to copy userinteraction.mydsl file into the D:/IoTSuite/Spec/ path.

7. Compiling user interaction specification.

This stage involves the invoking IoTSuite from the command-line interface. The command involves two arguments: (1) Activity name (in our case - compile-interaction-spec) (2) a path where you want to generates output. (for instance, D:\Template\)

In Eclipse, you can invoke IoTSuite in the following way:

  1. Go to Run Menu > Run Configuration option > Press Argument Tab
  2. Write the following two line command in the Argument tab, as shown in the above image domain and architecture specification.

8. Specifying target deployment.

  1. Create deploy.mydsl file.

  2. Write deployment specification in the deploy.mydsl file. (Examples are available IoTSuite\Examples)

  3. Copy the deploy.mydsl file into "Spec" folder. You can find this folder in the directory where you put IoTSuite project. For instance, If you copy IoTSuite project in D:/IoTSuite, you have to copy userinteraction.mydsl file into the D:/IoTSuite/Spec/ path.

9. Compiling target deployment

This stage involves the invoking IoTSuite from the command-line interface. The command involves two arguments: (1) Activity name (in our case - compile-deploy-spec) (2) a path where you want to generates output. (for instance, D:\IoTSuite-Template\)

In Eclipse, you can invoke IoTSuite in the following way:

  1. Go to Run Menu > Run Configuration option > Press Argument Tab
  2. Write the following two line command in the Argument tab, as shown in the above image domain and architecture specification.

10. Writing User Interface Code

The compilation of the target deployment generates projects in to CodeForDeployment folder, which can be found in the D:\IoTSuite-Template folder. The following figure shows the content of CodeForDeployment folder, which can be deployed to devices. In order to write user interface code, we have to locate an appropriate user interface project (E.g., AndroidD3). Then, we specify we interface code on top of generated user interface framework.

11. Output of the Linker

The output of the IoTSuite is a set of platform-specific projects for devices, specified in the deployment specification. These projects are not binaries. They need to be compiled, which can be done by any device-specific compiler designed for the target platform.

Clone this wiki locally