Merged in antmerlino/apps/i8sak-txpwr (pull request #159)
wireless/ieee802154/i8sak: Adds support for getting/setting transmit power. Approved-by: GregoryN <gnutt@nuttx.org>
This commit is contained in:
parent
a26a7f9767
commit
1617e0dcf0
@ -103,6 +103,7 @@ void i8sak_get_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
" ep_eaddr = i8sak endpoint extended address\n"
|
" ep_eaddr = i8sak endpoint extended address\n"
|
||||||
" ep_addrmode = destination address mode"
|
" ep_addrmode = destination address mode"
|
||||||
" rxonidle = Receiver on when idle\n"
|
" rxonidle = Receiver on when idle\n"
|
||||||
|
" txpwr = Transmit power\n"
|
||||||
, argv[0]);
|
, argv[0]);
|
||||||
/* Must manually reset optind if we are going to exit early */
|
/* Must manually reset optind if we are going to exit early */
|
||||||
|
|
||||||
@ -245,6 +246,11 @@ void i8sak_get_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
printf("i8sak: Receive on Idle: false\n");
|
printf("i8sak: Receive on Idle: false\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[argind], "txpwr") == 0)
|
||||||
|
{
|
||||||
|
ieee802154_gettxpwr(fd, &u.attr.phy.txpwr);
|
||||||
|
printf("i8sak: Transmit Power: %d\n", (int)u.attr.phy.txpwr);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
||||||
@ -308,6 +314,11 @@ void i8sak_get_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
printf("i8sak: Receive on Idle: false\n");
|
printf("i8sak: Receive on Idle: false\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[argind], "txpwr") == 0)
|
||||||
|
{
|
||||||
|
sixlowpan_gettxpwr(fd, i8sak->ifname, &u.attr.phy.txpwr);
|
||||||
|
printf("i8sak: Transmit Power: %d\n", (int)u.attr.phy.txpwr);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
||||||
|
@ -102,6 +102,7 @@ void i8sak_set_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
" ep_addrmode s|e = destination addressing mode\n"
|
" ep_addrmode s|e = destination addressing mode\n"
|
||||||
" ep_port 1-65535 = port to send to\n"
|
" ep_port 1-65535 = port to send to\n"
|
||||||
" rxonidle = Receiver on when idle\n"
|
" rxonidle = Receiver on when idle\n"
|
||||||
|
" txpwr = Transmit Power\n"
|
||||||
, argv[0]);
|
, argv[0]);
|
||||||
/* Must manually reset optind if we are going to exit early */
|
/* Must manually reset optind if we are going to exit early */
|
||||||
|
|
||||||
@ -235,6 +236,10 @@ void i8sak_set_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
{
|
{
|
||||||
ieee802154_setrxonidle(fd, i8sak_str2bool(argv[argind + 1]));
|
ieee802154_setrxonidle(fd, i8sak_str2bool(argv[argind + 1]));
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[argind], "txpwr") == 0)
|
||||||
|
{
|
||||||
|
ieee802154_settxpwr(fd, i8sak_str2long(argv[argind + 1]));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
||||||
@ -275,6 +280,10 @@ void i8sak_set_cmd(FAR struct i8sak_s *i8sak, int argc, FAR char *argv[])
|
|||||||
{
|
{
|
||||||
sixlowpan_setrxonidle(fd, i8sak->ifname, i8sak_str2bool(argv[argind + 1]));
|
sixlowpan_setrxonidle(fd, i8sak->ifname, i8sak_str2bool(argv[argind + 1]));
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[argind], "txpwr") == 0)
|
||||||
|
{
|
||||||
|
sixlowpan_settxpwr(fd, i8sak->ifname, i8sak_str2long(argv[argind + 1]));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
fprintf(stderr, "ERROR: unsupported parameter: %s\n", argv[argind]);
|
||||||
|
Loading…
Reference in New Issue
Block a user