Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CREATE:

Code Block
languagexmlruby
titleCreate PhidgetServo Thing Model
linenumberstrue
<Create>#
Create: 
  <PhidgetServoModel>  PhidgetServoModel: 
   <ServoProtocolURL>         ServoProtocolURL: "phid://"
      </ServoProtocolURL>
      <PhidgetDeviceType>
        PhidgetAdvancedServoPhidgetDeviceType: "PhidgetAdvancedServo"
      </PhidgetDeviceType>
      <DeviceInterfaceIndex>
       DeviceInterfaceIndex: 0
      </DeviceInterfaceIndex>
      <ServoAngle>
        110
      </ServoAngle>
    </PhidgetServoModel>
  </Create>ServoAngle: 110

CREATE RESULT:

Code Block
languagexmlruby
titleCreate PhidgetServoModel Result
linenumberstrue
<Create#
Create(Status=: "Success">
):
  PhidgetServoModel: 
<PhidgetServoModel>     <PhidServoId>KNJN2YRVAAAAUAABA7LIQ4Y6</PhidServoId>PhidServoId: "KNJN2YRVAAAAUAABA7LIQ4Y6" 
   <ServoProtocolURL ServoProtocolURL(Status=: "Success+Created:1:1457384153653;", Value=: "phid://"/>)
    <DeviceInterfaceIndex Status=DeviceInterfaceIndex(Status: "Success+Created:1:1457384153653;", Value=: "0"/>)
    <PhidgetDeviceType Status=PhidgetDeviceType(Status: "Success+Created:1:1457384153653;", Value=: "PhidgetAdvancedServo"/>)
    <ServoAngle Status=ServoAngle(Status: "Success+Created:1:1457384153654;", Value=: "110"/>
  </PhidgetServoModel>
</Create>)

Note: If a ThingModel is combined with a ThingFacet, creation of a ThingModel results in instantiating (Trigger) of a ThingFacet action.

...

UPDATE:

Code Block
languagexmlruby
titlePhidgetServo Thing Model
linenumberstrue
<Query>#
Query: 
 <Find Find(format=: "version">):
    <PhidgetServoModelPhidgetServoModel as=: "var.PS">):
      <PhidServoId ne=PhidServoId(ne: ""/>)
    </PhidgetServoModel>SetResponseData: 
 </Find>   <SetResponseData>
    <key>
     key: Message.Value.Find.Result.PhidgetServoModel.ServoAngle.Value
    </key>
    <value>
     value: 120
  Update: 
</value>   </SetResponseData>
  <Update>
    <from>
      from: Result
    </from>
    <Include>
     Include: $Response.Message.Value.Find
    </Include>
  </Update>
</Query>

...


UPDATE Result:

Code Block
languagexmlruby
titlePhidgetServo Thing Model
linenumberstrue
<Find#
Find(Status=: "Success", Format=: "version">
):
  Result: 
<Result>    PhidgetServoModel: <PhidgetServoModel>
       <PhidServoId>KNJPIFR6AAAAUAABA67ZRBQO</PhidServoId>PhidServoId: "KNJPIFR6AAAAUAABA67ZRBQO" 
     <PhidgetDeviceType PhidgetDeviceType(Value=: "PhidgetAdvancedServo", Version=: "1"/>)
      <ServoAngle Version=ServoAngle(Version: "1", Value=: "120"/>)
      <DeviceInterfaceIndex Value=DeviceInterfaceIndex(Value: "0", Version="1"/>
      <ServoProtocolURL Value="phid://" Version="1"/>
  )
 </PhidgetServoModel>   </Result> </Find>
<Update Status="Success" Format="version">
  <PhidgetServoModel>
    <PhidServoId>KNJPIFR6AAAAUAABA67ZRBQO</PhidServoId>
    <ServoProtocolURL Status="Success_NoAction:1:1457385641534;" Value= ServoProtocolURL(Value: "phid://", Version="1"/>
    <DeviceInterfaceIndex Status="Success_NoAction:1:1457385641534;" Value="0" Version="1"/>
    <PhidgetDeviceType Status="Success_NoAction:1:1457385641535;" Value="PhidgetAdvancedServo" Version="1"/>
    <ServoAngle Status="Success=Updated:2:1457385767153;" Value="120" Version="2"/>
  </PhidgetServoModel>
</Update>)

Note: If a ThingModel is combined with a ThingFacet updating a ThingModel attribute results in Trigger of a Action if that attribute is associated with an action.

...

DELETE:

Code Block
languagexmlruby
titleDelete PhidgetServoModel Thing Model
linenumberstrue
<<Query>#
Query: 
<DeleteAll>  DeleteAll: 
 <PhidgetServoModel>   PhidgetServoModel: 
  <PhidServoId ne=""/>     </PhidgetServoModel>
  </DeleteAll>
</Query>PhidServoId(ne: "")


DELETE Result

Code Block
languagexmlruby
titleDelete PhidgetServoModel Thing Model Result
linenumberstrue
<DeleteAll#
DeleteAll(Status=: "Success">):
  <Result>Result: 
   <PhidgetServoModel> PhidgetServoModel: 
    <PhidServoId>KNJOOOBZAAAAUAABA72MMI6E</PhidServoId>  PhidServoId: "KNJOOOBZAAAAUAABA72MMI6E"
   <PhidgetDeviceType>PhidgetAdvancedServo</PhidgetDeviceType>   PhidgetDeviceType: "PhidgetAdvancedServo"
  <ServoAngle>110</ServoAngle>    ServoAngle: 110
 <DeviceInterfaceIndex>0</DeviceInterfaceIndex>     DeviceInterfaceIndex: 0
<ServoProtocolURL>phid://</ServoProtocolURL>     </PhidgetServoModel>   </Result>
</DeleteAll>ServoProtocolURL: "phid://"

Note: If a ThingModel is combined with a ThingFacet, creation of a ThingModel results in deleting an instance results in cleanup of connections with actual things as per the protocol Handler used. 

 



FIND

Code Block
languagexml
titlePhidgetServo Thing Model
linenumberstrue
<Query>#
Query: 
 <Find Find(format=: "all">):
    <PhidgetServoModel>PhidgetServoModel:
      <PhidServoId ne="" />
    </PhidgetServoModel>
  </Find>
</Query>

...

PhidServoId(ne: "")


Find result: Format="all" - returns all the internal attribute data as well.

Code Block
languagexmlruby
titlePhidgetServoModel ThingModel Find Result
linenumberstrue
<Find#
Find(Status=: "Success", Format=: "all">):
  <Result>Result: 
   <PhidgetServoModel PhidgetServoModel(QName=: "Atomiton.PhidgetServos.PhidgetServoModel">):
       <PhidServoId>KNJOOOBZAAAAUAABA72MMI6E</PhidServoId>PhidServoId: "KNJOOOBZAAAAUAABA72MMI6E" 
     <PhidgetDeviceType PhidgetDeviceType(Value=: "PhidgetAdvancedServo", Known=: "PhidgetAdvancedServo", Version=: "1", Timestamp=: "1457384798266", DateTime=: "2016-03-07 13:06:38.266", QName=: "Atomiton.PhidgetServos.PhidgetServoModel.PhidgetDeviceType", FName=: "PhidgetDeviceType"/>)
      <ServoAngle Value=ServoAngle(Value: "110", Known=: "110", Version=: "1", Timestamp=: "1457384798266", DateTime=: "2016-03-07 13:06:38.266", QName=: "Atomiton.PhidgetServos.PhidgetServoModel.ServoAngle", FName=: "ServoAngle"/>)
      <DeviceInterfaceIndex Value=DeviceInterfaceIndex(Value: "0", Known=: "0", Version=: "1", Timestamp=: "1457384798266", DateTime=: "2016-03-07 13:06:38.266", QName=: "Atomiton.PhidgetServos.PhidgetServoModel.DeviceInterfaceIndex", FName=: "DeviceInterfaceIndex"/>)
      <ServoProtocolURL Value=ServoProtocolURL(Value: "phid://", Known=: "phid://", Version=: "1", Timestamp=: "1457384798265", DateTime=: "2016-03-07 13:06:38.265", QName=: "Atomiton.PhidgetServos.PhidgetServoModel.ServoProtocolURL", FName=: "ServoProtocolURL"/>
    </PhidgetServoModel>
  </Result>
</Find>

...

)


Note: