|
Lucon SDK 1.0.7
|
Implements IDevice by wrapping the Lucon C API. More...
Public Member Functions | |
| Device (DeviceConnection connection, bool moveOwnership=false) | |
| Initialize a new instance of the Device class. | |
| string | GetInfo () |
Composes a descriptive string by reading key parameters from the device.
| |
| void | 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. | |
| void | 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. | |
| 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
.The primary purpose is to reduce communication delays, if multiple channels need to be controlled simultaneously. | |
| IList< byte > | GetOnlineChannelNumbers () |
Read a list of channel numbers of the available ("online") channels from the device.
| |
| void | 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. | |
| void | Disconnect () |
| Stops communication and closes the Connection to the device. | |
| bool | CheckIsConnected () |
Check connectivity and responsiveness of the device with a small handshake.
| |
| Public Member Functions inherited from Gefasoft.LuconV2.Infrastructure.InteropObject | |
| void | Dispose () |
| Dispose the object and free all related resources. | |
Protected Member Functions | |||
| override void | Dispose (bool disposing) | ||
implements the standard pattern for IDisposable
| |||
Properties | |
| DeviceConnection | Connection [get] |
| The DeviceConnection used for communication. | |
| bool | IsConnected [get] |
Returns whether the device is connected and recently responsive.
| |
| IEnumerable< IChannel > | OnlineChannels [get] |
| Reads a list of the currently available power modules from the Device and enumerates them. | |
| ChannelCollection | Channels [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! | |
| string | SerialNumber [get] |
| Read the serial number from the communication module as a string.Example: "220000024". | |
| string | MacAddress [get] |
| Read the MAC address from the communication module as a string.Example: "68:27:19:95:1F:F5" | |
| string | IPAddress [get, set] |
| 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. | |
| string | SubnetMask [get, set] |
| Read/Write the the IPv4 subnet mask from the device.Example: "255.255.255.0" | |
| string | FirmwareVersion [get] |
| Read the current firmware version from the device.Example: "1.0.1" | |
Events | |
| EventHandler | IsConnectedChanged [add, remove] |
| EventHandler | DeviceRestarted [add, remove] |
| Events inherited from Gefasoft.LuconV2.Abstractions.IDevice | |
| EventHandler | IsConnectedChanged |
| Raised, when the connection status of the Device changes. | |
| EventHandler | DeviceRestarted |
| Raised, when the host receives a restart hint from the device. | |
Implements IDevice by wrapping the Lucon C API.
The implementation is stateless: all properties read or set parameters on the hardware using the given Connection. If the communication fails properties and function will throw LuconExceptions.
Setting parameters will
| Gefasoft.LuconV2.Device.Device | ( | DeviceConnection | connection, |
| bool | moveOwnership = false ) |
Initialize a new instance of the Device class.
if moveOwnership is true, the Device will take ownership of the connection : disposal of the connection will be triggered when the Device is disposed.
| connection | The connection to be used for communication |
| moveOwnership | whether ownership of the connection is moved to the new Device |
| ArgumentNullException |
| bool Gefasoft.LuconV2.Device.CheckIsConnected | ( | ) |
Check connectivity and responsiveness of the device with a small handshake.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| void Gefasoft.LuconV2.Device.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.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| void Gefasoft.LuconV2.Device.Disconnect | ( | ) |
Stops communication and closes the Connection to the device.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
protectedvirtual |
implements the standard pattern for IDisposable
| disposing | true if disposing due to user call, false in case of finalizer |
Reimplemented from Gefasoft.LuconV2.Infrastructure.InteropObject.
| string Gefasoft.LuconV2.Device.GetInfo | ( | ) |
Composes a descriptive string by reading key parameters from the device.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| IList< byte > Gefasoft.LuconV2.Device.GetOnlineChannelNumbers | ( | ) |
Read a list of channel numbers of the available ("online") channels from the device.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| void Gefasoft.LuconV2.Device.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.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| void Gefasoft.LuconV2.Device.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.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
| void Gefasoft.LuconV2.Device.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.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
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!
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
get |
The DeviceConnection used for communication.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
get |
Read the current firmware version from the device.Example: "1.0.1"
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
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.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
get |
Returns whether the device is connected and recently responsive.
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
get |
Read the MAC address from the communication module as a string.Example: "68:27:19:95:1F:F5"
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
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
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
get |
Read the serial number from the communication module as a string.Example: "220000024".
Implements Gefasoft.LuconV2.Abstractions.IDevice.
|
getset |
Read/Write the the IPv4 subnet mask from the device.Example: "255.255.255.0"
Implements Gefasoft.LuconV2.Abstractions.IDevice.