2using System.Collections;
3using System.Collections.Generic;
5using System.Threading.Tasks;
45 return Task.FromResult(
false);
50 return Task.FromResult(
false);
55 throw new NotSupportedException();
60 return Task.FromResult(
false);
65 return Task.FromResult(
false);
80 throw new NotSupportedException();
85 LinkedList<Parameter> Parameters =
new LinkedList<Parameter>();
93 internal static string PortsToString(
int[] Ports)
95 StringBuilder sb =
new StringBuilder();
98 foreach (
int Port
in Ports)
105 sb.Append(Port.ToString());
108 return sb.ToString();
113 return Task.FromResult<IEnumerable<Message>>(
null);
123 return Task.FromResult(
false);
128 return Task.FromResult(
false);
133 return Task.CompletedTask;
138 return Task.FromResult(
false);
147 return Task.FromResult<IEnumerable<ICommand>>(
new ICommand[]
156 #region ICommunicationLayer
185 }, DateTime.Now.AddHours(1),
null);
Static class managing the runtime environment of the IoT Gateway.
static HttpServer HttpServer
HTTP Server
static DateTime ScheduleEvent(ScheduledEventCallback Callback, DateTime When, object State)
Schedules a one-time event.
Task TransmitBinary(byte[] Data)
Called when binary data has been transmitted.
Task Error(string Error)
Called to inform the viewer of an error state.
Task Exception(Exception Exception)
Called to inform the viewer of an exception state.
bool DecoupledEvents
If events raised from the communication layer are decoupled, i.e. executed in parallel with the sourc...
ISniffer[] Sniffers
Registered sniffers.
Task Information(string Comment)
Called to inform the viewer of something.
Task TransmitText(string Text)
Called when text has been transmitted.
bool HasSniffers
If there are sniffers registered on the object.
Task ReceiveText(string Text)
Called when text has been received.
Task ReceiveBinary(byte[] Data)
Called when binary data has been received.
Task Warning(string Warning)
Called to inform the viewer of a warning state.
IEnumerator< ISniffer > GetEnumerator()
Gets a typed enumerator.
Implements an HTTP server.
override void AddRange(IEnumerable< ISniffer > Sniffers)
ICommunicationLayer.AddRange
override void Add(ISniffer Sniffer)
ICommunicationLayer.Add
Contains information about a language.
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 ...
string LogId
If provided, an ID for the node, as it would appear or be used in system logs. Can be null,...
bool IsReadable
If the node can be read.
Task Exception(DateTime Timestamp, string Exception)
Called to inform the viewer of an exception state.
Task ReceiveBinary(byte[] Data)
Called when binary data has been received.
bool ChildrenOrdered
If the children of the node have an intrinsic order (true), or if the order is not important (false).
Task Information(string Comment)
Called to inform the viewer of something.
Task Warning(DateTime Timestamp, string Warning)
Called to inform the viewer of a warning state.
ISniffer[] Sniffers
Registered sniffers.
Task TransmitText(string Text)
Called when text has been transmitted.
bool HasChildren
If the source has any child sources.
Task UpdateAsync()
Updates the node (in persisted storage).
Task< bool > CanViewAsync(RequestOrigin Caller)
If the node is visible to the caller.
bool Remove(ISniffer Sniffer)
Removes a sniffer, if registered.
Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
Task ReceiveText(DateTime Timestamp, string Text)
Called when text has been received.
Task Exception(Exception Exception)
Called to inform the viewer of an exception state.
Task Exception(string Exception)
Called to inform the viewer of an exception state.
Task ReceiveBinary(DateTime Timestamp, byte[] Data)
Called when binary data has been received.
Task< IEnumerable< ICommand > > Commands
Available command objects. If no commands are available, null is returned.
Task< IEnumerable< INode > > ChildNodes
Child nodes. If no child nodes are available, null is returned.
Task AddAsync(INode Child)
Adds a new child to the node.
string SourceId
Optional ID of source containing node.
string Partition
Optional partition in which the Node ID is unique.
Task< bool > MoveDownAsync(RequestOrigin Caller)
Tries to move the node down.
Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
void AddRange(IEnumerable< ISniffer > Sniffers)
Adds a range of sniffers to the node.
Task TransmitBinary(DateTime Timestamp, byte[] Data)
Called when binary data has been transmitted.
Task Warning(string Warning)
Called to inform the viewer of a warning state.
DateTime LastChanged
When the node was last updated.
async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
IEnumerator< ISniffer > GetEnumerator()
Returns an enumerator that iterates through the collection.
Task< bool > CanAddAsync(RequestOrigin Caller)
If the node can be added to by the caller.
bool HasCommands
If the node has registered commands or not.
bool DecoupledEvents
If events raised from the communication layer are decoupled, i.e. executed in parallel with the sourc...
Task DestroyAsync()
Destroys the node. If it is a child to a parent node, it is removed from the parent first.
Task ReceiveText(string Text)
Called when text has been received.
string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
Task TransmitText(DateTime Timestamp, string Text)
Called when text has been transmitted.
void Add(ISniffer Sniffer)
Adds a sniffer to the node.
Task Error(string Error)
Called to inform the viewer of an error state.
Task< bool > CanEditAsync(RequestOrigin Caller)
If the node can be edited by the caller.
Task Error(DateTime Timestamp, string Error)
Called to inform the viewer of an error state.
NodeState State
Current overall state of the node.
bool IsControllable
If the node can be controlled.
Task< bool > CanDestroyAsync(RequestOrigin Caller)
If the node can be destroyed to by the caller.
Task< IEnumerable< Message > > GetMessagesAsync(RequestOrigin Caller)
Gets messages logged on the node.
Task< bool > RemoveAsync(INode Child)
Removes a child from the node.
Task< bool > MoveUpAsync(RequestOrigin Caller)
Tries to move the node up.
INode Parent
Parent Node, or null if a root node.
Task Information(DateTime Timestamp, string Comment)
Called to inform the viewer of something.
Task TransmitBinary(byte[] Data)
Called when binary data has been transmitted.
Task Exception(DateTime Timestamp, Exception Exception)
Called to inform the viewer of an exception state.
bool HasSniffers
If there are sniffers registered on the object.
Service Module hosting the XMPP broker and its components.
Tokens available in request.
string From
Address of caller.
Interface for observable classes implementing communication protocols.
Interface for sniffers. Sniffers can be added to ICommunicationLayer classes to eavesdrop on communic...
Interface for nodes that are published through the concentrator interface.
NodeState
State of a node.