|
Lucon SDK 1.0.7
|
Represents the functionality of a Lucon communication module. More...
Public Member Functions | |
| string | GetInfo () |
| Composes a descriptive string by reading key parameters from the device. | |
| void | Connect () |
| Start communicating with the device. | |
| void | Disconnect () |
| Stops communication and closes the Connection to the device. | |
| bool | CheckIsConnected () |
| Check connectivity and responsiveness of the device with a small handshake. | |
| void | Restart (bool includingAllChannels) |
| Triggers a restart of the Lucon. | |
| void | SavePermanently (bool restart) |
| Persistently save the current parameters of the communication module in its EEPROM. | |
| IList< byte > | GetOnlineChannelNumbers () |
| Read a list of channel numbers of the available ("online") channels from the device. | |
| void | SetChannelsToContinuousMode (IList< int > channelNumbers, ContinuousModeParameters[] modeParams) |
Sets multiple channels to ChannelMode.Continuous. The length of the input parameter arrays must match and ids must not contain duplicates. The output parameters given in modeParams are assigned in-order to the channels with the given
. | |
Properties | |
| DeviceConnection | Connection [get] |
| The DeviceConnection used for communication. | |
| bool | IsConnected [get] |
| Returns whether the device is connected and recently responsive. | |
| ChannelCollection | Channels [get] |
| All channels owned by the device. | |
| IEnumerable< IChannel > | OnlineChannels [get] |
| Reads a list of the currently available power modules from the Device and enumerates them. | |
| string | SerialNumber [get] |
| Read the serial number from the communication module as a string. | |
| string | MacAddress [get] |
| Read the MAC address from the communication module as a string. | |
| string | IPAddress [get, set] |
| Read/Write the IPv4 address setting of the communication module as a string. | |
| string | SubnetMask [get, set] |
| Read/Write the the IPv4 subnet mask from the device. | |
| string | FirmwareVersion [get] |
| Read the current firmware version from the device. | |
Events | |
| EventHandler | IsConnectedChanged |
| Raised, when the connection status of the Device changes. | |
| EventHandler | DeviceRestarted |
| Raised, when the host receives a restart hint from the device. | |
Represents the functionality of a Lucon communication module.
| bool Gefasoft.LuconV2.Abstractions.IDevice.CheckIsConnected | ( | ) |
Check connectivity and responsiveness of the device with a small handshake.
Implemented in Gefasoft.LuconV2.Device.
| void Gefasoft.LuconV2.Abstractions.IDevice.Connect | ( | ) |
Start communicating with the device.
If not yet done, the related Connection will be opened. The connectivity to the device is checked with a handshake. Only if the expected answer is received, the call succeeds. Otherwise and error is returned. In this case the connection is closed again, if and only if it was opened during the call.
Implemented in Gefasoft.LuconV2.Device.
| void Gefasoft.LuconV2.Abstractions.IDevice.Disconnect | ( | ) |
Stops communication and closes the Connection to the device.
Implemented in Gefasoft.LuconV2.Device.
| string Gefasoft.LuconV2.Abstractions.IDevice.GetInfo | ( | ) |
Composes a descriptive string by reading key parameters from the device.
Implemented in Gefasoft.LuconV2.Device.
| IList< byte > Gefasoft.LuconV2.Abstractions.IDevice.GetOnlineChannelNumbers | ( | ) |
Read a list of channel numbers of the available ("online") channels from the device.
Implemented in Gefasoft.LuconV2.Device.
| void Gefasoft.LuconV2.Abstractions.IDevice.Restart | ( | bool | includingAllChannels | ) |
Triggers a restart of the Lucon.
During a restart modules will reload their persisted settings. Transient changes will be lost! After the the function returns successfully, the connection will be lost! Only if the devices persisted connection settings are unmodified, the connection will be recovered after some time (typically <5s). Otherwise users must create a new Connection.
| includingAllChannels | If false, only the communication module is restarted. Otherwise additionally all online channels |
Implemented in Gefasoft.LuconV2.Device.
| void Gefasoft.LuconV2.Abstractions.IDevice.SavePermanently | ( | bool | restart | ) |
Persistently save the current parameters of the communication module in its EEPROM.
Saves only(!) the communication modules parameters. Note that some parameters (e.g. the IPAddress) will only take effect after restarting the module.
| restart | If true, the communication module will be restarted after saving. |
Implemented in Gefasoft.LuconV2.Device.
| void Gefasoft.LuconV2.Abstractions.IDevice.SetChannelsToContinuousMode | ( | IList< int > | channelNumbers, |
| ContinuousModeParameters[] | modeParams ) |
Sets multiple channels to ChannelMode.Continuous. The length of the input parameter arrays must match and ids must not contain duplicates. The output parameters given in modeParams are assigned in-order to the channels with the given
.
The primary purpose is to reduce communication delays, if multiple channels need to be controlled simultaneously.
| channelNumbers | the channel numbers of the channels to set |
| modeParams | the parameters to set for each channel |
Implemented in Gefasoft.LuconV2.Device.
|
get |
All channels owned by the device.
Objects retrieved from the container can only be used as long as the Device object is alive, as the device disposes the container!
Implemented in Gefasoft.LuconV2.Device.
|
get |
The DeviceConnection used for communication.
Implemented in Gefasoft.LuconV2.Device.
|
get |
Read the current firmware version from the device.
Example: "1.0.1"
Implemented in Gefasoft.LuconV2.Device.
|
getset |
Read/Write the IPv4 address setting of the communication module as a string.
Example "10.0.30.2"
The refers to the devices current transient setting. It may differ from the IP in use. Modifications will take effect only after saving and restarting the device.
Implemented in Gefasoft.LuconV2.Device.
|
get |
Returns whether the device is connected and recently responsive.
The call returns a cached state which is updated periodically.
Implemented in Gefasoft.LuconV2.Device.
|
get |
Read the MAC address from the communication module as a string.
Example: "68:27:19:95:1F:F5"
Implemented in Gefasoft.LuconV2.Device.
|
get |
Reads a list of the currently available power modules from the Device and enumerates them.
The returned Channels are contained in the Channels collection and managed by the Device
Implemented in Gefasoft.LuconV2.Device.
|
get |
Read the serial number from the communication module as a string.
Example: "220000024".
Implemented in Gefasoft.LuconV2.Device.
|
getset |
Read/Write the the IPv4 subnet mask from the device.
Example: "255.255.255.0"
Implemented in Gefasoft.LuconV2.Device.
| EventHandler Gefasoft.LuconV2.Abstractions.IDevice.DeviceRestarted |
Raised, when the host receives a restart hint from the device.
The callback function is invoked asynchronously whenever the host receives a message from the device which indicates a restart. This may happen e.g.after a supply-power interruption of the Lucon device or if a restart command was sent to the device. In general there is no guarantee that the event is raised after a device restart! [For example the responsible device message might get lost by an interrupted connection] The device might already control outputs or handle and answer commands before the event is raised! The event indicate the restart of the communication module only! A restart of individual channels can not be detected! It is not guaranteed, that all channels are available immediately after a device restart.
| EventHandler Gefasoft.LuconV2.Abstractions.IDevice.IsConnectedChanged |
Raised, when the connection status of the Device changes.
The device connection status indicates, whether the device is responsive.In the absence of other communication, the SDK sends beacon messages in regular intervals. Interruptions of the connection will be reported with some delay. The callback is invoked asynchronously! Users need to query the current connection status with IsConnected