#include <pcp.h>
Public Members | |||
PCP (char *port=PCPDefaultPort, tcflag_t speed=PCPDefaultSpeed, const char *name=0) | |||
PCP Object constructor. More... | |||
~PCP () | |||
Your friendly destructor. More... | |||
bool | PCPInit (bool autoUpdate=false) | ||
Initialise the radio. More... | |||
bool | PCPPowerUp () | ||
Powers the radio on. More... | |||
bool | PCPPowerDown () | ||
Powers the radio down. More... | |||
bool | PCPSetSpeed (tcflag_t) | ||
Sets the speed for current session. More... | |||
bool | PCPSetPort (const char *) | ||
Set the port for the current session. More... | |||
bool | PCPSetVolume (int) | ||
Set the current session's volume. More... | |||
bool | PCPSetSquelch (int) | ||
Set the current session's squelch. More... | |||
bool | PCPSetFreq (pcrfreq_t) | ||
Set the current frequency. More... | |||
bool | PCPSetMode (const char *) | ||
Set the current session's mode. More... | |||
bool | PCPSetFilter (const char *) | ||
Sets current session's filter. More... | |||
int | PCPSigStrength () | ||
Querys the signal strength (int version). More... | |||
const char* | PCPSigStrengthStr () | ||
Signal strength query. (const char * version). More... | |||
bool | PCPSetToneSq (const char*) | ||
Sets current session CTCSS. More... | |||
bool | PCPSetToneSq (float) | ||
Sets session CTCSS based on a float value. More... | |||
bool | PCPSetAutoGain (bool) | ||
Toggle autogain functionality. More... | |||
bool | PCPSetNB (bool) | ||
Toggle Noiseblanking functionality. More... | |||
bool | PCPSetRFAttenuator (bool) | ||
Toggle RF Attenuation functionality. More... | |||
bool | PCPIsOn () | ||
Inquire radio status. More... | |||
bool | PCPQueryOn () | ||
Querys radio acutator status. More... | |||
bool | PCPQuerySquelch () | ||
Querys radio's squelch status. More... | |||
const char* | PCPGetPort () | ||
Gets current port / serial device setting. More... | |||
tcflag_t | PCPGetSpeed_t () | ||
Gets current speed (tcflag_t version). More... | |||
const char* | PCPGetSpeed () | ||
Gets current speed (const char* version). More... | |||
int | PCPGetVolume () | ||
Gets current session's volume setting (int version). More... | |||
const char* | PCPGetVolumeStr () | ||
Gets current session's volume setting (const char* version). More... | |||
int | PCPGetSquelch () | ||
Gets current session's squelch setting (int version). More... | |||
const char* | PCPGetSquelchStr () | ||
Gets current session's squelch setting (const char* version). More... | |||
pcrfreq_t | PCPGetFreq () | ||
Gets current session's frequency setting (pcrfreq_t version). More... | |||
const char* | PCPGetFreqStr () | ||
Gets current session's frequency setting (const char* version). More... | |||
const pcrcmd_t* | PCPGetMode () | ||
Gets current session's mode setting (pcrcmd_t version). More... | |||
const char* | PCPGetModeStr () | ||
Gets current session's mode setting (const char* version). More... | |||
const pcrcmd_t* | PCPGetFilter () | ||
Gets current session's filter setting (pcrcmd_t version). More... | |||
const char* | PCPGetFilterStr () | ||
Get the current session's filter setting (const char* version). More... | |||
const char* | PCPGetToneSq () | ||
Gets the current session's tone squelch (undecoded version). More... | |||
const char* | PCPGetToneSqStr () | ||
Gets the current session's tone squelch (decoded version). More... | |||
bool | PCPGetAutoGain () | ||
Get current session's autogain value (bool version). More... | |||
const char* | PCPGetAutoGainStr () | ||
Get current session's autogain value (const char* version). More... | |||
bool | PCPGetNB () | ||
Get current session's noiseblank value (bool version). More... | |||
const char* | PCPGetNBStr () | ||
Get current session's noiseblank value (const char* version). More... | |||
bool | PCPGetRFAttenuator () | ||
Get current session's RF Attenuation value (bool version). More... | |||
const char* | PCPGetRFAttenuatorStr () | ||
Get current session's RF Attenuation value (const char* version). More... | |||
const PRadInf | PCPGetRadioInfo () | ||
Retrieves the current radio struct. More... | |||
Private Members | |||
bool | PCPCheckResponse () | ||
Internally called method to check radio response. More... | |||
PComm* | PCPComm | ||
The currently active Primitive Communication Object ( PComm ). | |||
bool | PCPStatus | ||
The state of the PComm object (on or off). | |||
bool | PCPErrRead | ||
Was there an error reading from the PComm object? | |||
char | PCPTemp [256] | ||
Temporary buffer to hold PCP string data. | |||
struct PRadInf* | PCPRadio | ||
Currently active radio data. |
PCP Is the actual object that interfaces with the GUI This API deals with the error handling and the calls that must be made to and from the radio, via the PComm serial i/o object.
Definition at line 82 of file pcp.h.
PCP::PCP (char * port = PCPDefaultPort, tcflag_t speed = PCPDefaultSpeed, const char * name = 0) |
PCP Object constructor.
port | the device to open |
speed | the initial baudrate to open at |
name |
internal object name
|
PCPSpeed
to speed PCPVolume
to 0 PCPSquelch
to 0 PCPFreq
to 146.000 MHz PCPMode
to PCRMODNFM() PCP::~PCP () |
Your friendly destructor.
Deletes the Primitive Communication ( PComm ) object before exitting.
bool PCP::PCPInit (bool autoUpdate = false) |
Initialise the radio.
autoUpdate |
Initialise the radio in autoUpdate mode
|
After PCPCheckResponse tells it that the command succeeded, it sets PCPRadio->PCPAutoUpdate mode appropriately.
bool PCP::PCPPowerUp () |
Powers the radio on.
Turns the radio's receiver on. By sending the command code PCRPWRON()
bool PCP::PCPPowerDown () |
Powers the radio down.
Turns the radio's receiver off. By sending the command code PCRPWROFF
bool PCP::PCPSetSpeed (tcflag_t speed) |
Sets the speed for current session.
speed |
baudrate as defined in termios.h
|
Then we tell the radio to switch speeds and set baudrate on the port by destroying PComm and reinitiating it with the new baud setting
Warning: follow these procedures to use this function.
bool PCP::PCPSetPort (const char * port) |
Set the port for the current session.
Sets port by closing the filedes and reopening it on the new port.
bool PCP::PCPSetVolume (int volume) |
Set the current session's volume.
volume |
an integer between 0 and 99
|
bool PCP::PCPSetSquelch (int squelch) |
Set the current session's squelch.
squelch |
an integer between 0 and 99
|
bool PCP::PCPSetFreq (pcrfreq_t freq) |
Set the current frequency.
freq |
passed frequency compliant to pcrfreq_t
|
send the command to the radio, if it checks out set this as the new frequency
bool PCP::PCPSetMode (const char * mode) |
Set the current session's mode.
mode |
plain text string of mode (eg: "USB")
|
USB
upper side band LSB
lower side band AM
amplitude modulated NFM
narrow band FM WFM
wide band FM CW
continuous wave
bool PCP::PCPSetFilter (const char * filter) |
Sets current session's filter.
filter |
character string version of the filter
|
3
3.0 kHz 6
6.0 kHz 15
15.0 kHz 50
50.0 kHz 230
230.0 kHz
int PCP::PCPSigStrength () |
Querys the signal strength (int version).
const char * PCP::PCPSigStrengthStr () |
Signal strength query. (const char * version).
Querys radio to read the current signal strength.
bool PCP::PCPSetToneSq (const char * value) |
Sets current session CTCSS.
value |
character string of 01-35 hex
|
The valid for value are hex values from 00 for off through 35
bool PCP::PCPSetToneSq (float passvalue) |
Sets session CTCSS based on a float value.
passvalue |
tone squelch in Hz
|
bool PCP::PCPSetAutoGain (bool value) |
Toggle autogain functionality.
value |
true or false for autogain on or off
|
true
to activate autogain false
to deactivate autogain
bool PCP::PCPSetNB (bool value) |
Toggle Noiseblanking functionality.
value |
true or false for noiseblanking on or off
|
true
to activate noiseblanking false
to deactivate noiseblanking
bool PCP::PCPSetRFAttenuator (bool value) |
Toggle RF Attenuation functionality.
value |
true or false for RF Attenuation on or off
|
true
to activate RF Attenuation false
to deactivate RF Attenuation
bool PCP::PCPIsOn () |
Inquire radio status.
Check to see if the radio is on based on the internally stored data. This function should only be called after the object has been initiated and is ready for use.
PCP::PCPQueryOn () |
Querys radio acutator status.
Actually querys the radio for a status on it's receiver state (on or off). This differs from PCPIsOn() in that it makes a call to the radio, rather than checking a local variable
bool PCP::PCPQuerySquelch () |
Querys radio's squelch status.
Actually querys the radio for a status on it's squelch state (open or closed).
PCP::PCPGetPort () |
Gets current port / serial device setting.
Checks the PCPRadio struct for member PCPPort for the current port (serial) device setting (pathname).
tcflag_t PCP::PCPGetSpeed_t () |
Gets current speed (tcflag_t version).
Checks PCPRadio struct for member PCPSpeed for the current speed (baudrate) setting.
const char * PCP::PCPGetSpeed () |
Gets current speed (const char* version).
Checks PCPRadio struct for member PCPSpeed for the current speed (baudrate) setting. Decodes the tcflag_t baudrate in the struct
int PCP::PCPGetVolume () |
Gets current session's volume setting (int version).
Checks PCPRadio struct for member PCPVolume for the current volume (hex) setting.
const char * PCP::PCPGetVolumeStr () |
Gets current session's volume setting (const char* version).
Checks PCPRadio struct for member PCPVolume for the current volume (hex) setting. Decodes the hex to a character string
int PCP::PCPGetSquelch () |
Gets current session's squelch setting (int version).
Checks PCPRadio struct for member PCPSquelch for the current squelch (hex) setting.
const char * PCP::PCPGetSquelchStr () |
Gets current session's squelch setting (const char* version).
Checks PCPRadio struct for member PCPSquelch for the current squelch (hex) setting. Decodes the integer into a character string
pcrfreq_t PCP::PCPGetFreq () |
Gets current session's frequency setting (pcrfreq_t version).
Checks PCPRadio struct for member PCPFreq for the current frequency setting.
const char * PCP::PCPGetFreqStr () |
Gets current session's frequency setting (const char* version).
Checks PCPRadio struct for member PCPFreq for the current frequency setting. It converts the pcrfreq_t into a character string.
const pcrcmd_t * PCP::PCPGetMode () |
Gets current session's mode setting (pcrcmd_t version).
Checks PCPRadio struct for member PCPMode for the current mode setting.
const char * PCP::PCPGetModeStr () |
Gets current session's mode setting (const char* version).
Checks PCPRadio struct for member PCPMode for the current mode setting. Decodes the mode setting to plain english equivalent.
const pcrcmd_t * PCP::PCPGetFilter () |
Gets current session's filter setting (pcrcmd_t version).
Checks PCPRadio struct for member PCPFilter for the current filter setting.
const char * PCP::PCPGetFilterStr () |
Get the current session's filter setting (const char* version).
Checks PCPRadio struct for member PCPFilter for the current filter setting. It then decodes the pcrcmd_t version into standard string values.
const char * PCP::PCPGetToneSq () |
Gets the current session's tone squelch (undecoded version).
Checks PCPRadio struct for member PCPToneSq for the current tone squelch setting.
const char * PCP::PCPGetToneSqStr () |
Gets the current session's tone squelch (decoded version).
Checks PCPRadio struct for member PCPToneSq for the current tone squelch setting. It is decoded into plain english and it's value returned.
bool PCP::PCPGetAutoGain () |
Get current session's autogain value (bool version).
Checks PCPRadio struct for member PCPAutoGain for the current auto-gain setting.
const char * PCP::PCPGetAutoGainStr () |
Get current session's autogain value (const char* version).
Checks PCPRadio struct for member PCPAutoGain for the current auto-gain setting. Decodes true and false into string values "1" and "0".
bool PCP::PCPGetNB () |
Get current session's noiseblank value (bool version).
Checks PCPRadio struct for member PCPNoiseBlank for the current auto-gain setting.
const char * PCP::PCPGetNBStr () |
Get current session's noiseblank value (const char* version).
Checks PCPRadio struct for member PCPNoiseBlank for the current auto-gain setting. Decodes the boolean value into the string "1" for true or "0" for false
bool PCP::PCPGetRFAttenuator () |
Get current session's RF Attenuation value (bool version).
Checks PCPRadio struct for member PCPRFAttenuator for the current RF Attenuation setting.
const char * PCP::PCPGetRFAttenuatorStr () |
Get current session's RF Attenuation value (const char* version).
Checks PCPRadio struct for member PCPRFAttenuator for the current session's RF Attenuation setting. Decodes the boolean value into "1" for true or "0" for false.
const PRadInf PCP::PCPGetRadioInfo () |
Retrieves the current radio struct.
this gets the current radio information struct in case the user wants to save the state of the radio.
bool PCP::PCPCheckResponse () [private]
|
Internally called method to check radio response.
read from the radio for the PCRAOK() and PCRABAD() reply.
PComm* PCP::PCPComm [private]
|
The currently active Primitive Communication Object ( PComm ).
bool PCP::PCPStatus [private]
|
bool PCP::PCPErrRead [private]
|
char PCP::PCPTemp[256] [private]
|
struct PRadInf* PCP::PCPRadio [private]
|