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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Kamal Mostafa
  • Date: 2014-06-07 11:28:52 UTC
  • Revision ID: package-import@ubuntu.com-20140607112852-pj9xhtlvwpgqjy5x
Tags: 1.3.15-1
* Initial release (Closes: #750861)
  flrig version 1.3.15 plus the following upstream commits:
  - 0001-License-Declaration.patch
  - 0002-FL_APPS-folder.patch
  - 0003-rig-home-dir.patch
  - 0004-RTS-DTR-restore.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
#include <iostream>
 
3
#include <fstream>
 
4
#include <vector>
 
5
#include <sys/types.h>
 
6
#include <sys/stat.h>
 
7
#include <stdlib.h>
 
8
#include <stdio.h>
 
9
#include <fcntl.h>
 
10
#include <pthread.h>
 
11
 
 
12
#include "ptt.h"
 
13
#include "debug.h"
 
14
#include "rig_io.h"
 
15
#include "rig.h"
 
16
#include "support.h"
 
17
 
 
18
using namespace std;
 
19
 
 
20
// used for transceivers with a single vfo, called only by rigPTT
 
21
static void fake_split(int on)
 
22
{
 
23
        if (on) {
 
24
                selrig->set_vfoA(vfoB.freq);
 
25
                selrig->set_modeA(vfoB.imode);
 
26
                selrig->set_bwA(vfoB.iBW);
 
27
        } else {
 
28
                selrig->set_vfoA(vfoA.freq);
 
29
                selrig->set_modeA(vfoA.imode);
 
30
                selrig->set_bwA(vfoA.iBW);
 
31
        }
 
32
}
 
33
 
 
34
// add fake rit to this function and to set_vfoA ??
 
35
 
 
36
void rigPTT(bool on)
 
37
{
 
38
//      wait_query = true;
 
39
        pthread_mutex_lock(&mutex_serial);
 
40
 
 
41
        if (on && progStatus.split && !selrig->can_split())
 
42
                fake_split(on);
 
43
 
 
44
        if (progStatus.comm_catptt) {
 
45
                selrig->set_PTT_control(on);
 
46
        } else if (progStatus.comm_dtrptt || progStatus.comm_rtsptt)
 
47
                RigSerial.SetPTT(on);
 
48
        else if (SepSerial.IsOpen() && (progStatus.sep_dtrptt || progStatus.sep_rtsptt) )
 
49
                SepSerial.SetPTT(on);
 
50
        else
 
51
                LOG_INFO("No PTT i/o connected");
 
52
 
 
53
        if (!on && progStatus.split && !selrig->can_split())
 
54
                fake_split(on);
 
55
 
 
56
        pthread_mutex_unlock(&mutex_serial);
 
57
//      wait_query = false;
 
58
}