git-svn-id: svn://db.shs.com.ru/pip@677 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-12-25 20:29:30 +00:00
parent 340a239f03
commit dc790b44c8
16 changed files with 193 additions and 57 deletions

View File

@@ -20,6 +20,7 @@
#include "piethernet.h"
#include "piconfig.h"
#include "pisysteminfo.h"
#include "pipropertystorage.h"
#ifdef QNX
# include <net/if.h>
# include <net/if_dl.h>
@@ -906,6 +907,39 @@ void PIEthernet::configureFromFullPathDevice(const PIString & full_path) {
}
PIPropertyStorage PIEthernet::constructVariantDevice() const {
PIPropertyStorage ret;
PIVariantTypes::Enum e;
e << "UDP" << "TCP";
if (type() == PIEthernet::UDP)
e.selectValue(0);
else
e.selectValue(1);
ret.addProperty("protocol", e);
ret.addProperty("read IP", readIP());
ret.addProperty("read port", readPort());
ret.addProperty("send IP", sendIP());
ret.addProperty("send port", sendPort());
ret.addProperty("multicast", multicastGroups());
return ret;
}
void PIEthernet::configureFromVariantDevice(const PIPropertyStorage & d) {
setType(d.propertyValueByName("protocol").toEnum().selectedValue() == 0 ? UDP : TCP_Client);
setReadIP(d.propertyValueByName("read IP").toString());
setReadPort(d.propertyValueByName("read port").toInt());
setSendIP(d.propertyValueByName("send IP").toString());
setSendPort(d.propertyValueByName("send port").toInt());
PIStringList mcgl = d.propertyValueByName("multicast").toStringList();
piForeachC (PIString & g, mcgl) {
joinMulticastGroup(g);
}
}
PIEthernet::InterfaceList PIEthernet::interfaces() {
PIEthernet::InterfaceList il;
Interface ci;