Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Controller.cs
1using System;
2using System.Threading.Tasks;
3using Windows.Devices.Gpio;
7
9{
13 public class Controller : MeteringNode
14 {
15 private readonly GpioController controller;
16
20 public Controller()
21 : base()
22 {
23 this.controller = GpioController.GetDefault();
24 }
25
29 public GpioController GpioController => this.controller;
30
34 public override Task<bool> AcceptsChildAsync(INode Child)
35 {
36 return Task.FromResult<bool>(Child is Pin);
37 }
38
42 public override async Task<bool> AcceptsParentAsync(INode Parent)
43 {
44 return (Parent is Root) && !((await GpioController.GetDefaultAsync() is null));
45 }
46
50 public override Task<string> GetTypeNameAsync(Language Language)
51 {
52 return Language.GetStringAsync(typeof(Controller), 1, "General Purpose I/O");
53 }
54 }
55}
Contains information about a language.
Definition: Language.cs:17
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Definition: Language.cs:209
Node representing a GPIO conroller.
Definition: Controller.cs:14
override Task< string > GetTypeNameAsync(Language Language)
TODO
Definition: Controller.cs:50
GpioController GpioController
TODO
Definition: Controller.cs:29
override async Task< bool > AcceptsParentAsync(INode Parent)
TODO
Definition: Controller.cs:42
Controller()
Node representing a GPIO conroller.
Definition: Controller.cs:20
override Task< bool > AcceptsChildAsync(INode Child)
TODO
Definition: Controller.cs:34
Base class for all metering nodes.
Definition: MeteringNode.cs:28
INode Parent
Parent Node, or null if a root node.
Class for the root node of the Metering topology.
Definition: Root.cs:11
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49