diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-02-13 11:55:35 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2006-02-13 11:55:35 +0000 |
commit | f0b5cb444eba02a9b34e11b88d6a0458516450ce (patch) | |
tree | b95065e78ae185d2ad5b0d16dce1976e0c1f3980 /tools | |
parent | d0d48dda01cd66f89dc46c55e7b3741e5427da14 (diff) |
Add support for channel selection and reverting to normal hopping
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bccmd.8 | 6 | ||||
-rw-r--r-- | tools/bccmd.c | 31 |
2 files changed, 37 insertions, 0 deletions
diff --git a/tools/bccmd.8 b/tools/bccmd.8 index 91d3ba86..e4642fec 100644 --- a/tools/bccmd.8 +++ b/tools/bccmd.8 @@ -75,6 +75,12 @@ Disable TX on the device .BI enabletx Enable TX on the device .TP +.BI singlechan\ <channel> +Lock radio on specific channel +.TP +.BI hoppingon +Revert to channel hopping +.TP .BI rttxdata1\ <decimal\ freq\ MHz>\ <level> TXData1 radio test .TP diff --git a/tools/bccmd.c b/tools/bccmd.c index b48eb525..f86b93ea 100644 --- a/tools/bccmd.c +++ b/tools/bccmd.c @@ -429,6 +429,35 @@ static int cmd_enabletx(int transport, int argc, char *argv[]) return transport_write(transport, CSR_VARID_ENABLE_TX, NULL, 0); } +static int cmd_singlechan(int transport, int argc, char *argv[]) +{ + uint8_t array[8]; + uint16_t channel; + + OPT_HELP(1, NULL); + + channel = atoi(argv[0]); + + if (channel > 2401 && channel < 2481) + channel -= 2402; + + if (channel > 78) { + errno = EINVAL; + return -1; + } + + memset(array, 0, sizeof(array)); + array[0] = channel & 0xff; + array[1] = channel >> 8; + + return transport_write(transport, CSR_VARID_SINGLE_CHAN, array, 8); +} + +static int cmd_hoppingon(int transport, int argc, char *argv[]) +{ + return transport_write(transport, CSR_VARID_HOPPING_ON, NULL, 0); +} + static int cmd_rttxdata1(int transport, int argc, char *argv[]) { uint8_t array[8]; @@ -957,6 +986,8 @@ static struct { { "warmreset", cmd_warmreset, "", "Perform warm reset" }, { "disabletx", cmd_disabletx, "", "Disable TX on the device" }, { "enabletx", cmd_enabletx, "", "Enable TX on the device" }, + { "singlechan",cmd_singlechan,"<channel>", "Lock radio on specific channel" }, + { "hoppingon", cmd_hoppingon, "", "Revert to channel hopping" }, { "rttxdata1", cmd_rttxdata1, "<freq> <level>","TXData1 radio test" }, { "memtypes", cmd_memtypes, NULL, "Get memory types" }, { "psget", cmd_psget, "<key>", "Get value for PS key" }, |