DA Command — Dynamic Actions
SDA and QDA take a template with UC syntax written inline — without occupying a UC slot — render it, and:
QDAreturns the rendered text (or routes it with;@DEST), without executing itSDAadditionally executes the resulting command on the device
Available since firmware v1.09.25.
What is it for?
| Use case | Example |
|---|---|
| 🔍 Query without configuring | >QDA $'VBU',4< — read a runtime value built on the fly |
| ⚡ Execute and route the response | >SDA $SSSXP0| "011";@TRM< — drive an output and send the echo to the serial port |
| 📤 Compose a one-shot report | >QDA $Pos:| QCQ,7,20;@GP< — composed text straight to the server |
| 💨 Ephemeral ping | >QDA $Alive;@GP!< — goes out if the socket is open, otherwise it is discarded |
Syntax
>SDA <plantilla-UC>[;@DEST[!]]<
>QDA <plantilla-UC>[;@DEST[!]]<- The template uses the same syntax as UC: literal text,
$segments with runtime data, and command segments. - The destination is the last
;@on the line. Without;@DEST, the response comes back transparently through the channel that asked:>QDA QIO<answers>RIO;...<just like a directQIO, with no prefix at all. - With
;@DESTthe output is queued as a report (with queue, ACK and retries) and the local response isRDAOK. - With
;@DEST!(ephemeral) there is a single immediate attempt, with no queue: if the channel is down, it is lost.
Destinations
| Token | Medium | Accepts ! |
|---|---|---|
;@TRM / ;@TR0 / ;@TR1 / ;@TR2 | Serial ports | yes (no effect) |
;@GP (alias ;@GPRS) | Main GPRS | yes |
;@WI (alias ;@WIF, ;@WIFI) | Main WiFi | yes |
;@BGP / ;@BWI | Backup GPRS / WiFi | yes |
;@BT (alias ;@BTH) | Bluetooth | yes (no effect) |
;@LOG / ;@BACK / ;@ALL | Flash log / smart backup / active channel | no |
;@SM0 | SMS destination 0 (max. 139 characters, plain text) | no |
;@XB0..;@XB7 | Expanders | yes |
The token is compared in full and is case-sensitive: ;@sm0 or ;@XB9 answer RDAERR DST, they never fall back to a default destination.
Responses and errors
The render echo goes out as is, with no prefix. The status responses are:
| Response | Meaning |
|---|---|
RDAOK | Accepted. In SDA it means “command recognized and executed”, not “it went well”: the subcommand’s result is not always capturable |
RDABUSY | The subcommand was busy after 3 attempts |
RDAERR DST | Invalid destination, bare ;@, index out of range, or ! on a destination that does not accept it |
RDAERR TPL | Empty template |
RDAERR RND | The render failed |
RDAERR OUT | The render contains >, <, CR or LF |
RDAERR LEN | Limits: 200 template and reinjection, 170 queued, 139 SMS, 236 echo |
RDAERR CMD | Vetoed command (see below) |
RDAERR NOCMD | The rendered command does not exist |
RDAERR MEM | Out of memory |
RDAERR BUSY | Another SDA/QDA in progress (they do not nest with each other) |
⚠️ SDA/QDA is not a security barrier
SDA and QDA execute any command that the channel they arrived through could already execute. They do not filter or ask for extra permissions: a >QDA SRESET< resets the device just like a direct >SRESET<, and a badly written template can turn off the modem or change the APN. Always try with QDA (which only builds the text) before moving on to SDA, and review the template the way you would review the command it is going to generate.
The only things vetoed inside SDA/QDA:
| Command | Reason |
|---|---|
QPW, SPW | They would leave the password in a response routable to third parties |
SDA, QDA | Recursion |
QTP, STP, G, GU | Stack consumption |
ACK, SAK | When reinjected they would sweep the download table |
Examples
>QDA QIO< // → >RIO;IGN0;IN1111111;...< (transparent)
>QDA $'VBU',4< // → backup voltage, built on the fly
>SDA $SSSXP0| "011";@TRM< // executes and routes the echo: >RSSXP0011;ID=...<
>QDA $Pos:| QCQ,7,20;@GP< // queues the composed text to the server
>QDA $Alive;@GP!< // ephemeral: goes out if there is a socket, otherwise it is lostFine details
- Reserved characters: inside
$segments they are escaped in UPPERCASE hex:\3E(>),\3C(<),\3B(;),\7C(|),\0D/\0A(CR/LF). The comma goes between double quotes in the command segment. - If an internal command needs its own
;@, write the;as\3B: the last;@on the line always belongs to SDA/QDA. - A
>in the template executes ANOTHER command (the parser anchors on the last>):>SDA hola>QID<executesQID. - In Wialon mode, queuing plain text to
;@GP/;@WI/;@BGP/;@BWI/;@ALL/;@BACKanswersRDAERR DST(the queue only accepts IPS frames). Use!(ephemeral, wrapped in#D#) or compose a frame that starts with#. - Templates to
;@SM0: do not use\XXescapes (the SMS path reinterprets them). - From an event engine rule (
ACC={QDA ...}) the local response is not emitted: use an explicit;@DEST. - Two simultaneous SDA/QDA through different channels: the second one receives
RDAERR BUSY. - Nothing persists in NVS and no UC slots are used.
Compatibility
See Also
- UC Command - Persistent user templates
- EVAL Command - Expression evaluation