kopia lustrzana https://github.com/weetmuts/wmbusmeters
Add missing rawtty command code.
rodzic
97e64ae4b1
commit
c53367aca3
|
|
@ -66,7 +66,19 @@ shared_ptr<BusDevice> openRawTTYInternal(Detected detected,
|
|||
string device = detected.found_file;
|
||||
int bps = detected.found_bps;
|
||||
|
||||
assert(device != "");
|
||||
if (detected.specified_device.command != "")
|
||||
{
|
||||
string identifier = "cmd_" + to_string(detected.specified_device.index);
|
||||
|
||||
vector<string> args;
|
||||
vector<string> envs;
|
||||
args.push_back("-c");
|
||||
args.push_back(detected.specified_device.command);
|
||||
|
||||
auto serial = manager->createSerialDeviceCommand(identifier, "/bin/sh", args, envs, "rawtty");
|
||||
WMBusRawTTY *imp = new WMBusRawTTY(bus_alias, serial, manager, use_hex);
|
||||
return shared_ptr<BusDevice>(imp);
|
||||
}
|
||||
|
||||
if (serial_override)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if nc 2>&1 | grep -q apple
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PROG="$1"
|
||||
|
||||
TEST=testoutput
|
||||
|
|
@ -13,7 +18,7 @@ TESTRESULT="ERROR"
|
|||
PORT=$(( $RANDOM % 10000 + 30000 ))
|
||||
|
||||
rm -f $TEST/response
|
||||
$PROG --silent --oneshot --format=fields --selectfields=total_m3 "rtlwmbus:CMD(nc -lkv $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
||||
$PROG --silent --oneshot --exitafter=5s --format=fields --selectfields=total_m3 "rtlwmbus:CMD(nc -lkv $PORT)" MyWater iperl 33225544 NOKEY >> $TEST/response 2>&1 &
|
||||
|
||||
sleep 0.5
|
||||
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue