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

« back to all changes in this revision

Viewing changes to .pc/0001-License-Declaration.patch/src/rigs/DELTA-II.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 Delta-II driver
3
 
 *
4
 
 * a part of flrig
5
 
 * 
6
 
 * Copyright 2011, Dave Freese, W1HKJ
7
 
 * 
8
 
 */
9
 
 
10
 
#include "DELTA-II.h"
11
 
 
12
 
//=============================================================================
13
 
// TT-535
14
 
 
15
 
const char RIG_TT535name_[] = "DELTA-II";
16
 
 
17
 
const char *RIG_TT535modes_[] = {
18
 
                "LSB", "USB", "AM", "CW", "FM", NULL};
19
 
static const char RIG_TT535_mode_type[] = {'L', 'U', 'U', 'L', 'U'};
20
 
 
21
 
RIG_TT535::RIG_TT535() {
22
 
        name_ = RIG_TT535name_;
23
 
        modes_ = RIG_TT535modes_;
24
 
        comm_baudrate = BR1200;
25
 
        stopbits = 1;
26
 
        comm_retries = 2;
27
 
        comm_wait = 10;
28
 
        comm_timeout = 50;
29
 
        comm_echo = true;
30
 
        comm_rtscts = false;
31
 
        comm_rtsplus = false;
32
 
        comm_dtrplus = true;
33
 
        comm_catptt = false;
34
 
        comm_rtsptt = false;
35
 
        comm_dtrptt = false;
36
 
        modeA = 1;
37
 
        bwA = 0;
38
 
 
39
 
        has_mode_control = true;
40
 
//      has_ptt_control = true;
41
 
 
42
 
        pre_to[2] = ok[3] = bad[3] = pre_fm[3] = 0x01;
43
 
 
44
 
};
45
 
 
46
 
int  RIG_TT535::adjust_bandwidth(int m)
47
 
{
48
 
        return 0;
49
 
}
50
 
 
51
 
long RIG_TT535::get_vfoA ()
52
 
{
53
 
        return freqA;
54
 
}
55
 
 
56
 
 
57
 
void RIG_TT535::set_vfoA (long freq)
58
 
{
59
 
        freqA = freq;
60
 
        cmd = pre_to;
61
 
        cmd += '\x05';
62
 
        cmd.append( to_bcd_be( freq, 8 ) );
63
 
        cmd.append( post );
64
 
        int ret = sendCommand(cmd);
65
 
        if (ret != 6);
66
 
                checkresponse();
67
 
}
68
 
 
69
 
void RIG_TT535::set_vfoB (long freq)
70
 
{
71
 
        freqB = freq;
72
 
        cmd = pre_to;
73
 
        cmd += '\x05';
74
 
        cmd.append( to_bcd_be( freq, 8 ) );
75
 
        cmd.append( post );
76
 
        if (sendCommand(cmd) != 6);
77
 
                checkresponse();
78
 
}
79
 
 
80
 
long RIG_TT535::get_vfoB ()
81
 
{
82
 
        return freqB;
83
 
}
84
 
 
85
 
// ditto on CAT PTT
86
 
/*
87
 
void RIG_TT535::set_PTT_control(int val)
88
 
{
89
 
        cmd = pre_to;
90
 
        cmd += '\x16';
91
 
        cmd += val ? '\x01' : '\x02';
92
 
        cmd.append( post );
93
 
        sendICcommand(cmd,6);
94
 
        checkresponse(6);
95
 
}
96
 
*/
97
 
 
98
 
void RIG_TT535::set_modeA(int md)
99
 
{
100
 
        modeA = md;
101
 
        cmd = pre_to;
102
 
        cmd += '\x06';
103
 
        cmd += modeA;
104
 
        cmd.append(post);
105
 
        if (sendCommand(cmd) != 6);
106
 
                checkresponse();
107
 
}
108
 
 
109
 
// same with get mode
110
 
int RIG_TT535::get_modeA()
111
 
{
112
 
//      cmd = pre_to;
113
 
//      cmd += '\x04';
114
 
//      cmd.append(post);
115
 
//      if( sendICcommand (cmd, 8 )) {
116
 
//              modeA = replystr[5];
117
 
//              bwA = replystr[6];
118
 
//      }
119
 
        return modeA;
120
 
}
121
 
 
122
 
 
123
 
void RIG_TT535::set_modeB(int md)
124
 
{
125
 
        modeB = md;
126
 
        cmd = pre_to;
127
 
        cmd += '\x06';
128
 
        cmd += modeB;
129
 
        cmd.append(post);
130
 
        if (sendCommand(cmd) != 6);
131
 
                checkresponse();
132
 
}
133
 
 
134
 
// same with get mode
135
 
int RIG_TT535::get_modeB()
136
 
{
137
 
        return modeB;
138
 
}
139
 
 
140
 
 
141
 
int RIG_TT535::get_modetype(int n)
142
 
{
143
 
        return RIG_TT535_mode_type[n];
144
 
}
145
 
 
146