My favorites | Sign in
Logo
                
Search
for
Updated Aug 13, 2009 by naranjo.manuel
Labels: SensorSDK
CommandLineUsage  

This document describes the command line implemented in AIRcable SensorSDK.

Introduction

Communication between the SensorSDK and the outside world can be done over Bluetooth or the UART port, for automated access a protocol is needed. We created a very simple to use command line, which allows to do some basic functions like:

Downloading Code

The template can be found in our trunk: latest version.

Including Command Line

Command line is provided as a Cheetah template, you need to define the global variable $stream before including the template, for example if you want to use slave profile then you need this lines:

#set global $stream="slave"
....
#include "shell/AIRcable.bas"

We recommend adding this include after base code and before mode code (monitor, interactive, etc).

Code Example

607 IF A = 0 THEN 650;
## s<file>: send file over spp
608 IF $0[0] = 115 THEN 620;
## u: slave and enable for 20 seconds
609 IF $0[0] = 117 THEN 630;
## S[number][content]: sets line number to 
## content, number is 4 digit long always
610 IF $0[0] = 83 THEN 643;
## L[number]: print content from line 
611 IF $0[0] = 76 THEN 646;
## c<clock>: sets current date and time
612 IF $0[0] = 99 THEN 637;
## d<file>: deletes <file>
613 IF $0[0] = 100 THEN 640;
## l<content> put <content> on the screen
614 IF $0[0] = 108 THEN 680;
## P<timeout>: wait until user does a button press
615 IF $0[0] = 80 THEN 685;
## p<STATE><PIO>: sets <PIO> to either 1 or 0 (pioset/pioclr)
616 IF $0[0] = 112 THEN 688;
## e exit
617 IF $0[0] = 101 THEN 650;

Command Line Functions

In code example section you can see the function dispatcher, there are a few factory functions, but you can modify this to match your needs.

Standard Functions:

Hosted by Google Code