~ubuntu-branches/ubuntu/wily/flrig/wily

« back to all changes in this revision

Viewing changes to .pc/0001-License-Declaration.patch/src/rigs/TT563.cxx

  • Committer: Package Import Robot
  • Author(s): Kamal Mostafa
  • Date: 2014-10-25 11:17:10 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20141025111710-n32skgya3l9u1brw
Tags: 1.3.17-1
* New upstream release (Closes: #761839)
* Debian Standards-Version: 3.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * TenTec 563 (Omni-VI) driver
3
 
 * based on the IC746 driver
4
 
 *
5
 
 * a part of flrig
6
 
 * 
7
 
 * Copyright 2009, Dave Freese, W1HKJ
8
 
 * 
9
 
 */
10
 
 
11
 
#include "TT563.h"
12
 
 
13
 
//=============================================================================
14
 
// TT-563
15
 
 
16
 
const char RIG_TT563name_[] = "OMNI-VI";
17
 
 
18
 
const char *RIG_TT563modes_[] = {
19
 
                "LSB", "USB", "AM", "CW", "RTTY", "FM", NULL};
20
 
static const char RIG_TT563_mode_type[] = {'L', 'U', 'U', 'U', 'L', 'U'};
21
 
const char *RIG_TT563widths[] = { "NARR", "WIDE", NULL};
22
 
 
23
 
RIG_TT563::RIG_TT563() {
24
 
        name_ = RIG_TT563name_;
25
 
        modes_ = RIG_TT563modes_;
26
 
        bandwidths_ = RIG_TT563widths;
27
 
        comm_baudrate = BR9600;
28
 
        stopbits = 1;
29
 
        comm_retries = 2;
30
 
        comm_wait = 10;
31
 
        comm_timeout = 50;
32
 
        comm_echo = true;
33
 
        comm_rtscts = false;
34
 
        comm_rtsplus = true;
35
 
        comm_dtrplus = true;
36
 
        comm_catptt = true;
37
 
        comm_rtsptt = false;
38
 
        comm_dtrptt = false;
39
 
        modeA = 1;
40
 
        bwA = 0;
41
 
 
42
 
        def_mode = modeB = modeA = 1;
43
 
        def_bw = bwB = bwA = 1;
44
 
        def_freq = freqB = freqA = 14070000;
45
 
 
46
 
        has_mode_control = true;
47
 
        has_ptt_control = true;
48
 
 
49
 
        pre_to[2] = ok[3] = bad[3] = pre_fm[3] = 0x04;
50
 
 
51
 
        precision = 10;
52
 
        ndigits = 7;
53
 
 
54
 
};
55
 
 
56
 
long RIG_TT563::get_vfoA ()
57
 
{
58
 
        cmd = pre_to;
59
 
        cmd += '\x03';
60
 
        cmd.append( post );
61
 
        int ret = sendCommand(cmd);
62
 
        if (ret >= 11) {
63
 
                freqA = fm_bcd_be(&replystr[ret - 11 + 5], 10);
64
 
        }
65
 
        return freqA;
66
 
}
67
 
 
68
 
void RIG_TT563::set_vfoA (long freq)
69
 
{
70
 
        freqA = freq;
71
 
        cmd = pre_to;
72
 
        cmd += '\x05';
73
 
        cmd.append( to_bcd_be( freq, 8 ) );
74
 
        cmd.append( post );
75
 
        sendCommand(cmd);
76
 
        checkresponse();
77
 
}
78
 
 
79
 
void RIG_TT563::set_PTT_control(int val)
80
 
{
81
 
        cmd = pre_to;
82
 
        cmd += '\x16';
83
 
        cmd += val ? '\x01' : '\x02';
84
 
        cmd.append( post );
85
 
        sendCommand(cmd);
86
 
        checkresponse();
87
 
}
88
 
 
89
 
void RIG_TT563::set_modeA(int md)
90
 
{
91
 
        modeA = md;
92
 
        cmd = pre_to;
93
 
        cmd += '\x06';
94
 
        cmd += modeA;
95
 
        cmd.append(post);
96
 
        sendCommand(cmd);
97
 
        checkresponse();
98
 
}
99
 
 
100
 
int RIG_TT563::get_modeA()
101
 
{
102
 
        cmd = pre_to;
103
 
        cmd += '\x04';
104
 
        cmd.append(post);
105
 
        int ret = sendCommand(cmd);
106
 
        if (ret >= 8) {
107
 
                modeA = replystr[ret - 8 + 5];
108
 
                bwA = replystr[ret - 8 + 6];
109
 
        }
110
 
        return modeA;
111
 
}
112
 
 
113
 
int RIG_TT563::get_modetype(int n)
114
 
{
115
 
        return RIG_TT563_mode_type[n];
116
 
}
117
 
 
118