Lucon SDK 1.0.7
Loading...
Searching...
No Matches
Gefasoft.LuconV2.Abstractions.IDevice Interface Reference

Represents the functionality of a Lucon communication module. More...

Inheritance diagram for Gefasoft.LuconV2.Abstractions.IDevice:
Gefasoft.LuconV2.Device

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

See also
ids

.

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< IChannelOnlineChannels [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.

Detailed Description

Represents the functionality of a Lucon communication module.

Member Function Documentation

◆ CheckIsConnected()

bool Gefasoft.LuconV2.Abstractions.IDevice.CheckIsConnected ( )

Check connectivity and responsiveness of the device with a small handshake.

Returns
true, if the device responds to a request, false otherwise.

IsConnected

Implemented in Gefasoft.LuconV2.Device.

◆ Connect()

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.

◆ Disconnect()

void Gefasoft.LuconV2.Abstractions.IDevice.Disconnect ( )

Stops communication and closes the Connection to the device.

Implemented in Gefasoft.LuconV2.Device.

◆ GetInfo()

string Gefasoft.LuconV2.Abstractions.IDevice.GetInfo ( )

Composes a descriptive string by reading key parameters from the device.

Returns

Implemented in Gefasoft.LuconV2.Device.

◆ GetOnlineChannelNumbers()

IList< byte > Gefasoft.LuconV2.Abstractions.IDevice.GetOnlineChannelNumbers ( )

Read a list of channel numbers of the available ("online") channels from the device.

Returns

Implemented in Gefasoft.LuconV2.Device.

◆ Restart()

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.

See also
SavePermanently
Parameters
includingAllChannelsIf false, only the communication module is restarted. Otherwise additionally all online channels

Implemented in Gefasoft.LuconV2.Device.

◆ SavePermanently()

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.

See also
Restart
Parameters
restartIf true, the communication module will be restarted after saving.

Implemented in Gefasoft.LuconV2.Device.

◆ SetChannelsToContinuousMode()

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

See also
ids

.

The primary purpose is to reduce communication delays, if multiple channels need to be controlled simultaneously.

Parameters
channelNumbersthe channel numbers of the channels to set
modeParamsthe parameters to set for each channel

Implemented in Gefasoft.LuconV2.Device.

Property Documentation

◆ Channels

ChannelCollection Gefasoft.LuconV2.Abstractions.IDevice.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!

Implemented in Gefasoft.LuconV2.Device.

◆ Connection

DeviceConnection Gefasoft.LuconV2.Abstractions.IDevice.Connection
get

The DeviceConnection used for communication.

Implemented in Gefasoft.LuconV2.Device.

◆ FirmwareVersion

string Gefasoft.LuconV2.Abstractions.IDevice.FirmwareVersion
get

Read the current firmware version from the device.

Example: "1.0.1"

Implemented in Gefasoft.LuconV2.Device.

◆ IPAddress

string Gefasoft.LuconV2.Abstractions.IDevice.IPAddress
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.

See also
SavePermanently

Implemented in Gefasoft.LuconV2.Device.

◆ IsConnected

bool Gefasoft.LuconV2.Abstractions.IDevice.IsConnected
get

Returns whether the device is connected and recently responsive.

See also
DeviceConnection.IsOpened

The call returns a cached state which is updated periodically.

See also
CheckIsConnected

Implemented in Gefasoft.LuconV2.Device.

◆ MacAddress

string Gefasoft.LuconV2.Abstractions.IDevice.MacAddress
get

Read the MAC address from the communication module as a string.

Example: "68:27:19:95:1F:F5"

Implemented in Gefasoft.LuconV2.Device.

◆ OnlineChannels

IEnumerable<IChannel> Gefasoft.LuconV2.Abstractions.IDevice.OnlineChannels
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

See also
GetOnlineChannelNumbers

Implemented in Gefasoft.LuconV2.Device.

◆ SerialNumber

string Gefasoft.LuconV2.Abstractions.IDevice.SerialNumber
get

Read the serial number from the communication module as a string.

Example: "220000024".

Implemented in Gefasoft.LuconV2.Device.

◆ SubnetMask

string Gefasoft.LuconV2.Abstractions.IDevice.SubnetMask
getset

Read/Write the the IPv4 subnet mask from the device.

Example: "255.255.255.0"

Implemented in Gefasoft.LuconV2.Device.

Event Documentation

◆ DeviceRestarted

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.

◆ IsConnectedChanged

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


The documentation for this interface was generated from the following file: