Updated Communication Basics (markdown)

hvolmer
2020-02-11 17:40:57 -07:00
parent 652320d119
commit 6dc706bbcf

@@ -49,19 +49,19 @@ public interface ISocketStatus : IBasicCommunication
#### Developing devices with communication
Essentials uses dependency injection concepts in it's start up phase. Simply, most devices use the same methods of communication, and are often communication-agnostic. During the build-from-configuration phase, the communication method device is instantiated, and then injected into the device that will use it. Since the communication device is of IBasicCommunication, the device controller receiving it knows that it can do things like listen for events, send text, be notified when sockets change.
Essentials uses dependency injection concepts in its start up phase. Simply, most devices use the same methods of communication, and are often communication-agnostic. During the build-from-configuration phase, the communication method device is instantiated, and then injected into the device that will use it. Since the communication device is of `IBasicCommunication`, the device controller receiving it knows that it can do things like listen for events, send text, be notified when sockets change.
#### Device Factory, Codec example
![Communication Device factory](https://pepperdash.github.io/Essentials/comm-device-factory.png)
The DeviceManager will contain two new devices after this: The Cisco codec, and the codec's GenericSshClient. This enables easier debugging of the client using console methods. Some devices like this codec will also have a CommunicationMonitor device, for Fusion and other reporting.
The DeviceManager will contain two new devices after this: The Cisco codec, and the codec's `GenericSshClient`. This enables easier debugging of the client using console methods. Some devices like this codec will also have a `CommunicationMonitor` device, for Fusion and other reporting.
> ComPortController is IBasicCommunication as well, but methods like Connect() and Disconnect() do nothing on these types.
> `ComPortController` is `IBasicCommunication` as well, but methods like `Connect()` and `Disconnect()` do nothing on these types.
#### ISocketStatus
PepperDash.Core.GenericTcpIpClient, GenericSshClient and other socket controllers implement ISocketStatus, which is an extension of IBasicCommunication. This reveals connection status properties and events.
`PepperDash.Core.GenericTcpIpClient`, `GenericSshClient` and some other socket controllers implement `ISocketStatus`, which is an extension of `IBasicCommunication`. This interface reveals connection status properties and events.
```csharp
public interface ISocketStatus : IBasicCommunication
@@ -71,4 +71,4 @@ public interface ISocketStatus : IBasicCommunication
}
```
Classes that are using socket-based comms will need to check for whether the communication is ISocketStatus and link up to the ConnectionChange event for connection handling.
Classes that are using socket-based comms will need to check for whether the communication is `ISocketStatus` and link up to the `ConnectionChange` event for connection handling.