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 "pipeer.h"
#include "piconfig.h"
#include "pidatatransfer.h"
#include "pipropertystorage.h"
#define _PIPEER_MSG_SIZE 4000
#define _PIPEER_MSG_TTL 100
@@ -961,13 +962,6 @@ void PIPeer::changeName(const PIString &new_name) {
}
PIString PIPeer::constructFullPathDevice() const {
PIString ret;
ret << self_info.name << ":" << trustPeerName();
return ret;
}
int PIPeer::readDevice(void *read_to, int max_size) {
read_buffer_mutex.lock();
bool empty = read_buffer.isEmpty();
@@ -1010,6 +1004,13 @@ void PIPeer::newTcpClient(PIEthernet *client) {
}
PIString PIPeer::constructFullPathDevice() const {
PIString ret;
ret << self_info.name << ":" << trustPeerName();
return ret;
}
void PIPeer::configureFromFullPathDevice(const PIString & full_path) {
PIStringList pl = full_path.split(":");
for (int i = 0; i < pl.size_s(); ++i) {
@@ -1022,6 +1023,20 @@ void PIPeer::configureFromFullPathDevice(const PIString & full_path) {
}
PIPropertyStorage PIPeer::constructVariantDevice() const {
PIPropertyStorage ret;
ret.addProperty("name", self_info.name);
ret.addProperty("trust peer", trustPeerName());
return ret;
}
void PIPeer::configureFromVariantDevice(const PIPropertyStorage & d) {
changeName(d.propertyValueByName("name").toString());
setTrustPeerName(d.propertyValueByName("trust peer").toString());
}
void PIPeer::initNetwork() {
// piCoutObj << "initNetwork ...";
eth_send.init();