Skip to content

Commit

Permalink
Merge pull request #117 from I2SE/plcrate-tx-only
Browse files Browse the repository at this point in the history
plcrate: introduce command line parameter -s
  • Loading branch information
ch-aurich authored Mar 6, 2018
2 parents 50cc013 + fcae072 commit d2cd8f7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion plc/Traffic2.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ signed Traffic2 (struct plc * plc)
while (devices-- > 1)
{
Transmit (plc, devicelist [0], devicelist [devices]);
Antiphon (plc, devicelist [devices], devicelist [0]);
if (_allclr (plc->flags, PLC_TXONLY))
{
Antiphon (plc, devicelist [devices], devicelist [0]);
}
}
}
return (0);
Expand Down
4 changes: 2 additions & 2 deletions plc/amprate.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void manager (struct plc * plc, signed count, signed pause)
{
PhyRates2 (plc);
}
if (_anyset (plc->flags, (PLC_TXONLY|PLC_RXONLY)))
if (_anyset (plc->flags, PLC_RXONLY))
{
RxRates2 (plc);
}
Expand Down Expand Up @@ -350,7 +350,7 @@ int main (int argc, char const * argv [])
}
argc -= optind;
argv += optind;
if (_allclr (plc.flags, (PLC_VERSION | PLC_LOCAL_TRAFFIC | PLC_NETWORK_TRAFFIC | PLC_RESET_DEVICE | PLC_TXONLY | PLC_RXONLY)))
if (_allclr (plc.flags, (PLC_VERSION | PLC_LOCAL_TRAFFIC | PLC_NETWORK_TRAFFIC | PLC_RESET_DEVICE | PLC_RXONLY)))
{
_setbits (plc.flags, PLC_NETWORK);
}
Expand Down
7 changes: 7 additions & 0 deletions plc/plcrate.1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ Reads device hardware and software revision information using VS_SW_VER and prin
.RB - R
Resets the device using VS_RS_DEV.

.TP
.RB - s
Generate only TX traffic between the local device and each remote device on powerline network.
This option is useful to speed up PLC network testing if the test is run on every node and
each receiving side is checked individually. In other words: this flag is only used in combination
with \fB-t\fR (one-to-many), not when generating traffic between all powerline peers.

.TP
.RB - t
Generate powerline traffic between the local device and each remote device on each powerline network connected to the host.
Expand Down
6 changes: 5 additions & 1 deletion plc/plcrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int main (int argc, char const * argv [])
extern struct channel channel;
static char const * optv [] =
{
"cd:ei:l:o:nqrRtTuvw:x",
"cd:ei:l:o:nqrRstTuvw:x",
"device [device] [...]",
"Qualcomm Atheros PLC PHY Rate Monitor",
"c\tdisplay coded PHY rates",
Expand All @@ -242,6 +242,7 @@ int main (int argc, char const * argv [])
"q\tquiet mode",
"r\trequest device information",
"R\treset device with VS_RS_DEV",
"s\tgenerate TX traffic only",
"t\tgenerate network traffic (one-to-many)",
"T\tgenerate network traffic (many-to-many)",
"u\tdisplay uncoded PHY rates",
Expand Down Expand Up @@ -315,6 +316,9 @@ int main (int argc, char const * argv [])
case 'R':
_setbits (plc.flags, PLC_RESET_DEVICE);
break;
case 's':
_setbits (plc.flags, PLC_TXONLY);
break;
case 't':
_setbits (plc.flags, PLC_LOCAL_TRAFFIC);
break;
Expand Down

0 comments on commit d2cd8f7

Please sign in to comment.