| 1408 | } |
| 1409 | |
| 1410 | static int |
| 1411 | pcr_set_level_cmd(RIG *rig, const char *base, int level) |
| 1412 | { |
| 1413 | char buf[12]; |
| 1414 | |
| 1415 | rig_debug(RIG_DEBUG_TRACE, "%s: base is %s, level is %d\n", |
| 1416 | __func__, base, level); |
| 1417 | |
| 1418 | if (level < 0x0) |
| 1419 | { |
| 1420 | rig_debug(RIG_DEBUG_ERR, "%s: too low: %d\n", |
| 1421 | __func__, level); |
| 1422 | return -RIG_EINVAL; |
| 1423 | } |
| 1424 | else if (level > 0xff) |
| 1425 | { |
| 1426 | rig_debug(RIG_DEBUG_ERR, "%s: too high: %d\n", |
| 1427 | __func__, level); |
| 1428 | return -RIG_EINVAL; |
| 1429 | } |
| 1430 | |
| 1431 | SNPRINTF(buf, 12, "%s%02X", base, level); |
| 1432 | buf[11] = '\0'; |
| 1433 | return pcr_transaction(rig, buf); |
| 1434 | } |
| 1435 | |
| 1436 | /* |
| 1437 | * Sets the volume of the rig to the level specified in the level integer. |
no test coverage detected