C# Класс Particle.ParticleDevice

Represents a Device like the Core, Photon or Electron
Наследование: ParticleBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CallFunctionAsync() публичный Метод

Calls the function asynchronous.
public CallFunctionAsync ( String functionName, String arg ) : Task>
functionName String Name of the function.
arg String The argument.
Результат Task>

FlashExampleAppAsync() публичный Метод

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
Результат Task

FlashKnownAppAsync() публичный Метод

Flashes a known application to a device.
public FlashKnownAppAsync ( String appName ) : Task
appName String Name of the application.
Результат Task

GetVariableValueAsync() публичный Метод

Gets the variable value asynchronous for the provided variable name.
public GetVariableValueAsync ( String variable ) : Task>
variable String The variable.
Результат Task>

GetVariableValueAsync() публичный Метод

Gets the variable value asynchronous for the provided variable.
public GetVariableValueAsync ( Particle.Variable variable ) : Task>
variable Particle.Variable The variable.
Результат Task>

ParseFunctions() защищенный Метод

Parses the functions.
protected ParseFunctions ( Newtonsoft.Json.Linq.JArray arr ) : void
arr Newtonsoft.Json.Linq.JArray The arr.
Результат void

ParseObject() защищенный Метод

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.
Результат void

ParseVariables() защищенный Метод

Parses the variables.
protected ParseVariables ( Newtonsoft.Json.Linq.JObject obj ) : void
obj Newtonsoft.Json.Linq.JObject The object.
Результат void

ParticleDevice() защищенный Метод

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
Результат Newtonsoft.Json

RefreshAsync() публичный Метод

Refreshes the device from the cloud.
public RefreshAsync ( ) : Task
Результат Task

RenameAsync() публичный Метод

Renames the Device.
public RenameAsync ( String newName ) : Task
newName String The new name.
Результат Task

UnclaimAsync() публичный Метод

Unclaims the Device asynchronous.
public UnclaimAsync ( ) : Task
Результат Task