Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

lib command types

Vladimir Zahradnik edited this page Oct 10, 2019 · 3 revisions

Command types

Adeon app uses two different types of commands – plain text (for use with commercial GSM devices) and parametric (for developers, for use with embedded programmable kits).

Plain-text command

This type is intended for use with commercial GSM devices which have defined a list of SMS commands. With these commands it's possible to control or check the state of GSM devices. Some of the GSM modules allows to combine and send more commands in a single SMS message. These (single or combined) commands can be named and stored in Adeon app and then reused. Predefined commands can be up to 160 characters long.

Example of using the plain-text command with RTU5024 GSM relay

In the example the goal is to switch on the GSM relay for 30 seconds. According to RTU5024 manual the SMS command is defined like this:

General command:                        <password>GOT<time>#
Specific command with password "1234":  1234GOT30#

In Adeon app, user can define the command like this:

Command description: Switch relay for 30 seconds
Text:                1234GOT30#

Parametric command

This type is designed for developers to use with embedded systems (e.g. Arduino, Raspberry Pi, Nucleo). Unlike a plain-text command where the message format is arbitrary (only length-limited to 160 characters), the parametric command is defined by name and numeric value and with these limitations:

  • The maximum parameter name length is 16 characters
  • The parameter name can only consist of letters (upper and lower case) and numbers without spaces
  • The value is number in range 0–65535 (uint16_t).

SMS message format

If the parametric command type is selected, Adeon app uses specific SMS formatting:

Part 1 2 3 4 5 6 7
General form hash md5 :_ parameter name 1 _=_ value 1 ; parameter name 2 _=_ value 2 ; parameter name N _=_ value N ;
Example 1 503b2 :_ param1 _=_ 125 ; param2 _=_ 42 ; param176 _=_ 65131 ;
Example 2 47c40 :_ name1 _=_ 68 ; name2 _=_ 7452 ;

icon-info Note: The "_" symbol in the table indicates a space.

  • The first part contains the last 5 characters of the md5 hash. Hash is calculated from formatted text from part #2 to part #N (including spaces, semicolons and colons), where part #N contains the last value of the last parameter of the generated text (SMS message). This is followed by a colon and a space.
  • The second part contains the name of the first parameter. This is followed by a space, the "=" symbol and a space.
  • The third part contains the value of the first parameter. A semicolon follows.
  • The fourth part (if several commands are sent in one SMS message) contains the name of the second parameter. This is followed by a space, the "=" symbol and a space.
  • The fifth part contains the value of the second parameter. A semicolon follows.
  • (N–1)th part (if N commands are sent in one SMS message) contains the name of the Nth parameter. This is followed by a space, the "=" symbol and a space.
  • The Nth part contains the value of the Nth parameter. A semicolon follows.

Clone this wiki locally