var Requests
The var
APIs provide a simple abstraction over the existing
note.update,
note.get, and
note.delete
APIs for managing data stored in
DB Notefiles.
var.delete CellCell+WiFiLoRaWiFi
This request is not available in the currently selected Notecard firmware version.
var.get CellCell+WiFiLoRaWiFi
This request is not available in the currently selected Notecard firmware version.
var.set CellCell+WiFiLoRaWiFi
Adds or updates a Note in a DB Notefile, replacing the existing body with the specified key-value pair where text, value, or flag is the key. Provides a simpler interface to the note.update API.
flag
boolean (optional)
The boolean value to be stored in the DB Notefile.
name
string
The unique Note ID.
sync
boolean (optional)
Set to true
to immediately sync any changes.
text
string (optional)
The string-based value to be stored in the DB Notefile.
value
integer (optional)
The numeric value to be stored in the DB Notefile.
{
"req": "var.set",
"name": "status",
"text": "open"
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "status");
JAddStringToObject(req, "text", "open");
NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "status"
req["text"] = "open"
rsp = card.Transaction(req)
Set a text variable named "status"
to "open"
in the default vars.db
DB Notefile.
{
"req": "var.set",
"name": "temperature",
"value": 23,
"file": "sensors.db"
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "temperature");
JAddNumberToObject(req, "value", 23);
JAddStringToObject(req, "file", "sensors.db");
NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "temperature"
req["value"] = 23
req["file"] = "sensors.db"
rsp = card.Transaction(req)
Set a numeric variable named "temperature"
to 23
in a specific DB Notefile.
{
"req": "var.set",
"name": "active",
"flag": true,
"sync": true
}
J *req = NoteNewRequest("var.set");
JAddStringToObject(req, "name", "active");
JAddBoolToObject(req, "flag", true);
JAddBoolToObject(req, "sync", true);
NoteRequest(req);
req = {"req": "var.set"}
req["name"] = "active"
req["flag"] = True
req["sync"] = True
rsp = card.Transaction(req)
Set a boolean variable named "active"
to true
and immediately sync changes.
Response Members
{}
means success.