fix for symlinks with colon (fixes #1374)
This commit is contained in:
@@ -70,7 +70,8 @@ ProtocolHandler* ProtocolHandler::create(const ebus_protocol_config_t config,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Transport* transport;
|
Transport* transport;
|
||||||
if (strchr(name, '/') == nullptr || strchr(name, ':') != nullptr) {
|
// symlink device name may contain colon, so only check for absence of slash only
|
||||||
|
if (strchr(name, '/') == nullptr) {
|
||||||
char* in = strdup(name);
|
char* in = strdup(name);
|
||||||
bool udp = false;
|
bool udp = false;
|
||||||
char* addrpos = in;
|
char* addrpos = in;
|
||||||
@@ -97,6 +98,7 @@ ProtocolHandler* ProtocolHandler::create(const ebus_protocol_config_t config,
|
|||||||
transport = new NetworkTransport(name, config.extraLatency, hostOrIp, port, udp);
|
transport = new NetworkTransport(name, config.extraLatency, hostOrIp, port, udp);
|
||||||
} else {
|
} else {
|
||||||
// support ens:/dev/<device>, enh:/dev/<device>, and /dev/<device>
|
// support ens:/dev/<device>, enh:/dev/<device>, and /dev/<device>
|
||||||
|
// as well as symlinks like /dev/serial/by-id/...Espressif_00:01:02:03...
|
||||||
transport = new SerialTransport(name, config.extraLatency, !config.noDeviceCheck, speed);
|
transport = new SerialTransport(name, config.extraLatency, !config.noDeviceCheck, speed);
|
||||||
}
|
}
|
||||||
Device* device;
|
Device* device;
|
||||||
|
|||||||
Reference in New Issue
Block a user