C# Class Particle.ParticleDevice

Represents a Device like the Core, Photon or Electron
Inheritance: ParticleBase
Afficher le fichier Open project: ParticleNET/ParticleSDK Class Usage Examples

Méthodes publiques

Méthode Description
CallFunctionAsync ( String functionName, String arg ) : Task>

Calls the function asynchronous.

FlashExampleAppAsync ( String exampleId ) : Task

Flashes the example application asynchronous.

FlashKnownAppAsync ( String appName ) : Task

Flashes a known application to a device.

GetVariableValueAsync ( String variable ) : Task>

Gets the variable value asynchronous for the provided variable name.

GetVariableValueAsync ( Particle.Variable variable ) : Task>

Gets the variable value asynchronous for the provided variable.

RefreshAsync ( ) : Task

Refreshes the device from the cloud.

RenameAsync ( String newName ) : Task

Renames the Device.

UnclaimAsync ( ) : Task

Unclaims the Device asynchronous.

Méthodes protégées

Méthode Description
ParseFunctions ( Newtonsoft.Json.Linq.JArray arr ) : void

Parses the functions.

ParseObject ( Newtonsoft.Json.Linq.JObject obj ) : void

Parses the provided JObject into a ParticleDevice

ParseVariables ( Newtonsoft.Json.Linq.JObject obj ) : void

Parses the variables.

ParticleDevice ( ParticleCloud cloud, Newtonsoft.Json.Linq.JObject obj ) : Newtonsoft.Json

Initializes a new instance of the ParticleDevice class.

Private Methods

Méthode Description
getVariableType ( JToken type ) : VariableType

Gets the type of the variable. if the type does not match a known type returns VariableType.String

parseBooleanValue ( JToken token ) : bool
parseDateTimeValue ( JToken token ) : DateTime?
parseIntValue ( JToken token ) : int
parseNullableIntValue ( JToken token ) : int?
parseStringValue ( JToken token ) : String

Method Details

CallFunctionAsync() public méthode

Calls the function asynchronous.
public CallFunctionAsync ( String functionName, String arg ) : Task>
functionName String Name of the function.
arg String The argument.
Résultat Task>

FlashExampleAppAsync() public méthode

Flashes the example application asynchronous.
a null example id is passed
public FlashExampleAppAsync ( String exampleId ) : Task
exampleId String The example identifier. This can be found at build.particle.io
Résultat Task

FlashKnownAppAsync() public méthode

Flashes a known application to a device.
public FlashKnownAppAsync ( String appName ) : Task
appName String Name of the application.
Résultat Task

GetVariableValueAsync() public méthode

Gets the variable value asynchronous for the provided variable name.
public GetVariableValueAsync ( String variable ) : Task>
variable String The variable.
Résultat Task>

GetVariableValueAsync() public méthode

Gets the variable value asynchronous for the provided variable.
public GetVariableValueAsync ( Particle.Variable variable ) : Task>
variable Particle.Variable The variable.
Résultat Task>

ParseFunctions() protected méthode

Parses the functions.
protected ParseFunctions ( Newtonsoft.Json.Linq.JArray arr ) : void
arr Newtonsoft.Json.Linq.JArray The arr.
Résultat void

ParseObject() protected méthode

Parses the provided JObject into a ParticleDevice
is null There was an error parsing the json provided. (This should be added as an issue when it happens)
protected ParseObject ( Newtonsoft.Json.Linq.JObject obj ) : void
obj Newtonsoft.Json.Linq.JObject The object.
Résultat void

ParseVariables() protected méthode

Parses the variables.
protected ParseVariables ( Newtonsoft.Json.Linq.JObject obj ) : void
obj Newtonsoft.Json.Linq.JObject The object.
Résultat void

ParticleDevice() protected méthode

Initializes a new instance of the ParticleDevice class.
protected ParticleDevice ( ParticleCloud cloud, Newtonsoft.Json.Linq.JObject obj ) : Newtonsoft.Json
cloud ParticleCloud The cloud.
obj Newtonsoft.Json.Linq.JObject The JSon object to parse
Résultat Newtonsoft.Json

RefreshAsync() public méthode

Refreshes the device from the cloud.
public RefreshAsync ( ) : Task
Résultat Task

RenameAsync() public méthode

Renames the Device.
public RenameAsync ( String newName ) : Task
newName String The new name.
Résultat Task

UnclaimAsync() public méthode

Unclaims the Device asynchronous.
public UnclaimAsync ( ) : Task
Résultat Task