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

« back to all changes in this revision

Viewing changes to src/rigs/IC728.cxx

  • Committer: Package Import Robot
  • Author(s): Kamal Mostafa
  • Date: 2014-06-07 11:28:52 UTC
  • Revision ID: package-import@ubuntu.com-20140607112852-v4d5tb1m3h3vi0dl
Tags: upstream-1.3.15
ImportĀ upstreamĀ versionĀ 1.3.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Icom IC-728
 
3
 * 
 
4
 * a part of flrig
 
5
 * 
 
6
 * Copyright 2009, Dave Freese, W1HKJ
 
7
 * 
 
8
 */
 
9
 
 
10
#include "IC728.h"
 
11
 
 
12
//=============================================================================
 
13
// IC-728
 
14
//
 
15
const char IC728name_[] = "IC-728";
 
16
const char *IC728modes_[] = { "LSB", "USB", "AM", "CW", "RTTY", "FM", NULL};
 
17
const char *IC728_widths[] = { "NARR", "WIDE", NULL};
 
18
 
 
19
RIG_IC728::RIG_IC728() {
 
20
        name_ = IC728name_;
 
21
        modes_ = IC728modes_;
 
22
        bandwidths_ = IC728_widths;
 
23
        comm_baudrate = BR1200;
 
24
        stopbits = 2;
 
25
        comm_retries = 2;
 
26
        comm_wait = 5;
 
27
        comm_timeout = 50;
 
28
        comm_echo = true;
 
29
        comm_rtscts = false;
 
30
        comm_rtsplus = true;
 
31
        comm_dtrplus = true;
 
32
        comm_catptt = true;
 
33
        comm_rtsptt = false;
 
34
        comm_dtrptt = false;
 
35
        modeA = 1;
 
36
        bwA = 0;
 
37
 
 
38
        defaultCIV = 0x38;
 
39
        adjustCIV(defaultCIV);
 
40
 
 
41
        precision = 10;
 
42
        ndigits = 7;
 
43
 
 
44
};
 
45
 
 
46
//=============================================================================
 
47
 
 
48
long RIG_IC728::get_vfoA ()
 
49
{
 
50
        string cstr = "\x03";
 
51
        string resp = pre_fm;
 
52
        resp.append(cstr);
 
53
        cmd = pre_to;
 
54
        cmd.append(cstr);
 
55
        cmd.append( post );
 
56
        if (waitFOR(10, "get vfo A")) {
 
57
                size_t p = replystr.rfind(resp);
 
58
                if (p != string::npos)
 
59
                        freqA = fm_bcd_be(&replystr[p+5], 8);
 
60
        }
 
61
        return freqA;
 
62
}
 
63
 
 
64
void RIG_IC728::set_vfoA (long freq)
 
65
{
 
66
        freqA = freq;
 
67
        cmd = pre_to;
 
68
        cmd += '\x05';
 
69
        cmd.append( to_bcd_be( freq, 8 ) );
 
70
        cmd.append( post );
 
71
        waitFB("set vfo A");
 
72
}
 
73