| 1786 | } |
| 1787 | |
| 1788 | int pcr_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) |
| 1789 | { |
| 1790 | int i, err; |
| 1791 | struct pcr_priv_data *priv = (struct pcr_priv_data *) STATE(rig)->priv; |
| 1792 | struct pcr_rcvr *rcvr = is_sub_rcvr(rig, |
| 1793 | vfo) ? &priv->sub_rcvr : &priv->main_rcvr; |
| 1794 | |
| 1795 | rig_debug(RIG_DEBUG_VERBOSE, "%s: tone = %u\n", __func__, tone); |
| 1796 | |
| 1797 | if (tone == 0) |
| 1798 | { |
| 1799 | return pcr_transaction(rig, is_sub_rcvr(rig, vfo) ? "J7100" : "J5100"); |
| 1800 | } |
| 1801 | |
| 1802 | for (i = 0; rig->caps->ctcss_list[i] != 0; i++) |
| 1803 | { |
| 1804 | if (rig->caps->ctcss_list[i] == tone) |
| 1805 | { |
| 1806 | break; |
| 1807 | } |
| 1808 | } |
| 1809 | |
| 1810 | rig_debug(RIG_DEBUG_TRACE, "%s: index = %d, tone = %u\n", |
| 1811 | __func__, i, rig->caps->ctcss_list[i]); |
| 1812 | |
| 1813 | if (rig->caps->ctcss_list[i] != tone) |
| 1814 | { |
| 1815 | return -RIG_EINVAL; |
| 1816 | } |
| 1817 | |
| 1818 | err = pcr_set_level_cmd(rig, is_sub_rcvr(rig, vfo) ? "J71" : "J51", i + 1); |
| 1819 | |
| 1820 | if (err == RIG_OK) |
| 1821 | { |
| 1822 | rcvr->last_ctcss_sql = tone; |
| 1823 | } |
| 1824 | |
| 1825 | return RIG_OK; |
| 1826 | } |
| 1827 | |
| 1828 | int pcr_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *tone) |
| 1829 | { |
no test coverage detected