Revision 98ba0cc0 host/lib/usrp/dboard/db_xcvr2450.cpp
| b/host/lib/usrp/dboard/db_xcvr2450.cpp | ||
|---|---|---|
| 438 | 438 |
* RX Get and Set |
| 439 | 439 |
**********************************************************************/ |
| 440 | 440 |
void xcvr2450::rx_get(const wax::obj &key_, wax::obj &val){
|
| 441 |
wax::obj key; std::string name; |
|
| 442 |
boost::tie(key, name) = extract_named_prop(key_); |
|
| 441 |
named_prop_t key = named_prop_t::extract(key_); |
|
| 443 | 442 |
|
| 444 | 443 |
//handle the get request conditioned on the key |
| 445 | 444 |
switch(key.as<subdev_prop_t>()){
|
| ... | ... | |
| 452 | 451 |
return; |
| 453 | 452 |
|
| 454 | 453 |
case SUBDEV_PROP_GAIN: |
| 455 |
assert_has(_rx_gains.keys(), name, "xcvr rx gain name"); |
|
| 456 |
val = _rx_gains[name]; |
|
| 454 |
assert_has(_rx_gains.keys(), key.name, "xcvr rx gain name");
|
|
| 455 |
val = _rx_gains[key.name];
|
|
| 457 | 456 |
return; |
| 458 | 457 |
|
| 459 | 458 |
case SUBDEV_PROP_GAIN_RANGE: |
| 460 |
assert_has(xcvr_rx_gain_ranges.keys(), name, "xcvr rx gain name"); |
|
| 461 |
val = xcvr_rx_gain_ranges[name]; |
|
| 459 |
assert_has(xcvr_rx_gain_ranges.keys(), key.name, "xcvr rx gain name");
|
|
| 460 |
val = xcvr_rx_gain_ranges[key.name];
|
|
| 462 | 461 |
return; |
| 463 | 462 |
|
| 464 | 463 |
case SUBDEV_PROP_GAIN_NAMES: |
| ... | ... | |
| 502 | 501 |
} |
| 503 | 502 |
|
| 504 | 503 |
void xcvr2450::rx_set(const wax::obj &key_, const wax::obj &val){
|
| 505 |
wax::obj key; std::string name; |
|
| 506 |
boost::tie(key, name) = extract_named_prop(key_); |
|
| 504 |
named_prop_t key = named_prop_t::extract(key_); |
|
| 507 | 505 |
|
| 508 | 506 |
//handle the get request conditioned on the key |
| 509 | 507 |
switch(key.as<subdev_prop_t>()){
|
| ... | ... | |
| 513 | 511 |
return; |
| 514 | 512 |
|
| 515 | 513 |
case SUBDEV_PROP_GAIN: |
| 516 |
this->set_rx_gain(val.as<float>(), name); |
|
| 514 |
this->set_rx_gain(val.as<float>(), key.name);
|
|
| 517 | 515 |
return; |
| 518 | 516 |
|
| 519 | 517 |
case SUBDEV_PROP_ANTENNA: |
| ... | ... | |
| 528 | 526 |
* TX Get and Set |
| 529 | 527 |
**********************************************************************/ |
| 530 | 528 |
void xcvr2450::tx_get(const wax::obj &key_, wax::obj &val){
|
| 531 |
wax::obj key; std::string name; |
|
| 532 |
boost::tie(key, name) = extract_named_prop(key_); |
|
| 529 |
named_prop_t key = named_prop_t::extract(key_); |
|
| 533 | 530 |
|
| 534 | 531 |
//handle the get request conditioned on the key |
| 535 | 532 |
switch(key.as<subdev_prop_t>()){
|
| ... | ... | |
| 542 | 539 |
return; |
| 543 | 540 |
|
| 544 | 541 |
case SUBDEV_PROP_GAIN: |
| 545 |
assert_has(_tx_gains.keys(), name, "xcvr tx gain name"); |
|
| 546 |
val = _tx_gains[name]; |
|
| 542 |
assert_has(_tx_gains.keys(), key.name, "xcvr tx gain name");
|
|
| 543 |
val = _tx_gains[key.name];
|
|
| 547 | 544 |
return; |
| 548 | 545 |
|
| 549 | 546 |
case SUBDEV_PROP_GAIN_RANGE: |
| 550 |
assert_has(xcvr_tx_gain_ranges.keys(), name, "xcvr tx gain name"); |
|
| 551 |
val = xcvr_tx_gain_ranges[name]; |
|
| 547 |
assert_has(xcvr_tx_gain_ranges.keys(), key.name, "xcvr tx gain name");
|
|
| 548 |
val = xcvr_tx_gain_ranges[key.name];
|
|
| 552 | 549 |
return; |
| 553 | 550 |
|
| 554 | 551 |
case SUBDEV_PROP_GAIN_NAMES: |
| ... | ... | |
| 588 | 585 |
} |
| 589 | 586 |
|
| 590 | 587 |
void xcvr2450::tx_set(const wax::obj &key_, const wax::obj &val){
|
| 591 |
wax::obj key; std::string name; |
|
| 592 |
boost::tie(key, name) = extract_named_prop(key_); |
|
| 588 |
named_prop_t key = named_prop_t::extract(key_); |
|
| 593 | 589 |
|
| 594 | 590 |
//handle the get request conditioned on the key |
| 595 | 591 |
switch(key.as<subdev_prop_t>()){
|
| ... | ... | |
| 599 | 595 |
return; |
| 600 | 596 |
|
| 601 | 597 |
case SUBDEV_PROP_GAIN: |
| 602 |
this->set_tx_gain(val.as<float>(), name); |
|
| 598 |
this->set_tx_gain(val.as<float>(), key.name);
|
|
| 603 | 599 |
return; |
| 604 | 600 |
|
| 605 | 601 |
case SUBDEV_PROP_ANTENNA: |
Also available in: Unified diff