Hi,
I'm trying to list up all the elements per interface category with their configured element IP Addresses.
I'm able to fetch the IP addresses for SNMP & HTTP connections.
As we know virtual connections don't have any of those, I also skipped these records successfully already.
Though I don't seem to get to the Serial connection details so far...
Below is a snippet of code of what I'm trying to reach:
IDms myDms = protocol.GetDms(); var elements = myDms.GetElements(); foreach (var element in elements) { foreach (var connection in element.Connections) { // ... var serialConnection = connection as ISerialConnection; if (serialConnection != null) { var portConnection = (IIpBased)serialConnection.Connection; if (portConnection != null) { var ip = portConnection.RemoteHost; continue; } } }
Can someone help me with a clue?
Thanks!
Hi Thijs,
serial (and smart-serial) are currently not yet supported. We have the following tasks to implement this:
You could use a GetElementByIDMessage (or GetElementByNameMessage) SLNet request which results in a ElementInfoEventMessage.
The name, element and Agent ID can be found in the Name, ElementID and DataMinerID properties, respectively.
The MainPort property of this response contains the info of the main port and is of type ElementPortInfo. Information about additional ports is found under the ExtraPorts property (of type ElementPortInfo[]).
The PollingIPAddress property of the ElementPortInfo object denotes the polling IP.
Note: This is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.
So what would be the best alternative for now?
Considering that I’m just interested in finding all configured IP addresses per element. (So I need the DMA/Element ID, Name and IPs) thanks.