...
Definition
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
# ThingFacet(Name: "PhidgetSensorFacet"): Integer(Name: "SensorValue", Update: "auto", KnownBy: "PhidgetSensorAction") String(Name: "SensorURL", Default: "phid://") String(Name: "SensorInterfaceIndex") String(Name: "SensorType") String(Name: "SensorInterfaceType") String(Name: "SensorValueFormat") String(Name: "Simulated") ThingModel(Name: "PhidgetSensorModel", Combines: "PhidgetSensorFacet"): Sid(Name: "phidId") |
...
The model instances of PhidgetSensorModel is created using a Create TQL Query.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
# Query: Create: PhidgetSensors: SensorURL: phid:// SensorType: Rotation SensorInterfaceType: PhidgetInterfaceKit SensorValueFormat: Raw SensorInterfaceIndex: 0 SensorValue(value: "$Null()", version: "1"); Simulated: true |
...
Note that there is Status returned for every attribute that gets created.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
# Create(Status: "Success"): PhidgetSensors: phidId: KNUBPHLOAAAAUAABA6EJCI75 SensorValue(Status: "Success+Created:1:1457740291438;", Value: "", Version: "1") SensorURL(Status: "Success+Created:1:1457740291442;", Value: "phid://", Version: "1") SensorInterfaceIndex(Status: "Success+Created:1:1457740291443;", Value: "0", Version: "1") SensorType(Status: "Success+Created:1:1457740291444;", Value: "Rotation", Version: "1") SensorInterfaceType(Status: "Success+Created:1:1457740291444;", Value: "PhidgetInterfaceKit", Version: "1") SensorValueFormat(Status: "Success+Created:1:1457740291445;", Value: "Raw", Version: "1") Simulated(Status: "Success+Created:1:1457740291445;", Value: "true", Version: "1") |
...
After model instances are created, you can read them using Find Query with constraints.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
# Query: Find format: "all"): PhidgetSensors: SensorURL(ne : "") |
...