#ifndef PCP_H_
#define PCP_H_
/*
Copyright (C) 1999 PolyWog and Javaman for Ghetto.Org
This file is part of the PCR-1000 API Library.
The PCR-1000 API Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The PCR-1000 API Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the PCR-1000 API Library; see the file LICENSE. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <pcrdef.h>
#include <pcomm.h>
#include <sys/termios.h> /* for tcflag_t */
#define PCPDefaultPort "/dev/pcr1000"
#define PCPDefaultSpeed B9600
struct PRadInf {
char PCPPort[64];
tcflag_t PCPSpeed;
char PCPInitSpeed[8];
int PCPVolume;
int PCPSquelch;
pcrfreq_t PCPFreq;
pcrcmd_t PCPMode[128];
pcrcmd_t PCPFilter[128];
bool PCPAutoUpdate;
const char *PCPToneSq;
float PCPToneSqFloat;
bool PCPAutoGain;
bool PCPNoiseBlank;
bool PCPRFAttenuator;
};
class PCP {
public:
PCP(char *port=PCPDefaultPort, tcflag_t speed=PCPDefaultSpeed,
const char *name=0);
~PCP();
bool PCPInit(bool autoUpdate=false);
bool PCPPowerUp();
bool PCPPowerDown();
// basic radio methods
bool PCPSetSpeed(tcflag_t);
bool PCPSetPort(const char *);
bool PCPSetVolume(int);
bool PCPSetSquelch(int);
bool PCPSetFreq(pcrfreq_t);
bool PCPSetMode(const char *);
bool PCPSetFilter(const char *);
int PCPSigStrength();
const char *PCPSigStrengthStr();
// advanced radio methods
bool PCPSetToneSq(const char*);
bool PCPSetToneSq(float);
bool PCPSetAutoGain(bool);
bool PCPSetNB(bool);
bool PCPSetRFAttenuator(bool);
bool PCPIsOn();
bool PCPQueryOn();
bool PCPQuerySquelch();
const char *PCPGetPort();
tcflag_t PCPGetSpeed_t();
const char *PCPGetSpeed();
int PCPGetVolume();
const char *PCPGetVolumeStr();
int PCPGetSquelch();
const char *PCPGetSquelchStr();
pcrfreq_t PCPGetFreq();
const char *PCPGetFreqStr();
const pcrcmd_t *PCPGetMode();
const char *PCPGetModeStr();
const pcrcmd_t *PCPGetFilter();
const char *PCPGetFilterStr();
const char *PCPGetToneSq();
const char *PCPGetToneSqStr();
bool PCPGetAutoGain();
const char *PCPGetAutoGainStr();
bool PCPGetNB();
const char *PCPGetNBStr();
bool PCPGetRFAttenuator();
const char *PCPGetRFAttenuatorStr();
const PRadInf PCPGetRadioInfo();
private:
bool PCPCheckResponse();
PComm *PCPComm;
bool PCPStatus;
bool PCPErrRead;
char PCPTemp[256];
struct PRadInf *PCPRadio;
};
#endif /* PCP_H_ */