📄 hs.h
字号:
// hs.h
// class interface for handset object
//
// June 27, 2000
// Added member data item pac_cal_type and Set/Get functions
// so that this object can differentiate between the
// different command sets. The Diana phone has a different
// method for setting the Tx power level.
//
#include "caltypes.h"
#include <stdio.h>
#include <io.h>
#include <math.h>
#include <time.h>
#include "stdafx.h"
class hs
{
ComPort_t ComPort;
CommDesc_t CommDesc;
HSMsg_t HSMsg[5];
BOOL logging; // T if logging is enabled
char log_filename[1024];
PACCalType_t pac_cal_type;
public:
hs();
// return the SIO device handle
HANDLE HS_GetDeviceHandle();
// Close the com port
void HS_CloseComPort();
// Set the pac_cal_type
void HS_SetPACCalType(PACCalType_t type);
// Get the pac_cal_type
void HS_GetPACCalType(PACCalType_t *type);
// Initialize log filename
void HS_SetLogFilename(char *filename);
// Log cmds and responses to SIO log file
void HS_LogSIO(char *buf);
// Enable/disable logging
void HS_EnableLogging(BOOL enable);
// Set the frequency channel number for TX/RX
// Channel arfcn number 0-125 511-885 for dualband
void HS_SetArfcn(UInt16 arfcn);
// Set TX power level
// Power level index 0 - 19 in ramp table
void HS_SetTxLev(UInt16 TxPwrIndex);
// Set peak DAC value (Diana only)
void HS_SetPeakDAC(UInt16 TxLevel, UInt16 Peak);
// Change tx power ramp table value currently used
// 32 words long ramp table for one power level
void HS_SetRamp(UInt16 *RampTable);
// Change 13MHZ VCO control signal voltage
// valtage value 0 - 0x3ff
void HS_SetDacVal(UInt16 DacVal);
// Change receive AGC value
// Expected receive signal power level 0 - 80
void HS_SetRxAgc(UInt16 TargetRxLevDb);
// Stop TX/RX
void HS_SetStop(void);
// Start transmit and receive signal on one channel
void HS_SetStart(void);
// Initialize the serial port
// port number com1 - com4
// returns FALSE on error
BOOL HS_InitComPort();
// Read the received signal level result
// Pointer to returned rx level value
// returns FALSE on error
BOOL HS_GetHSRxlev(UInt16 *Rxlev);
// Read each power level ramp maxmium value in current ramp table
// Band index 0 = GSM; 1=DCS;2=PCS
// Pointer to returned value 19 words
// returns FALSE on error
BOOL HS_GetHSCurRamp(BandIndex_t BandIndex, Parm_t *p);
// Read one value in current Gsys table for received signal level calulation
// Band index 0 = GSM; 1=DCS;2=PCS
// GsysIndex = index in Gsys
// GsysVal = Pointer to returned value
// returns FALSE on error
BOOL HS_GetHSCurGsys(BandIndex_t BandIndex,UInt16 GsysIndex,Int16 *GsysVal);
// Set band
void HS_SetBand(BandIndex_t BandIndex);
// Set the comm port
void HS_SetComPort(ComPort_t comport);
private:
void HS_SendOneLine(Int8 *cmd);
BOOL SioReadOneLine(Cmd_t *cmd_string, UInt8 *num_parm, Parm_t *parm);
BOOL GetOneNum(UInt8 **string_p, BOOL *is_valid, Int16 *value, BOOL *is_lineend);
BOOL ReceiveChar(UInt8 *ReceivedCh);
BOOL SioSendString(Int8 *ch_p);
BOOL SioPurge();
void SioSendCR();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -