更新 'src/Network/fgcom.cxx'

This commit is contained in:
zhongjin 2022-11-10 00:24:53 +08:00
parent c5fb798d74
commit 6508159642

View File

@ -407,7 +407,7 @@ void FGCom::setupCommFrequency(int channel) {
void FGCom::connectToCommFrequency() {
// ensure that the current comm is still in range
SG_LOG(SG_SOUND,SG_INFO,"connectToCommFrequency");
SG_LOG(SG_SOUND,SG_INFO,"connectToCommFrequency:" << _currentCallFrequency);
if ((_currentCallFrequency > 0.0) && !isInRange(_currentCallFrequency)) {
SG_LOG(SG_SOUND, SG_WARN, "FGCom: call out of range of: " << _currentCallFrequency);
@ -446,6 +446,9 @@ void FGCom::connectToCommFrequency() {
}
return;
}
else
SG_LOG(SG_SOUND, SG_WARN, "FGCom: frequency");
if (!num.empty()) {
_currentCallIdent = iaxc_call(num.c_str());
if (_currentCallIdent == -1)
@ -744,6 +747,10 @@ std::string FGCom::computePhoneNumber(const double& freq, const std::string& ica
bool FGCom::isInRange(const double &freq) const
{
// zhongjin 测试环境始终返回1
return 1;
for(size_t i=0; i<sizeof(special_freq)/sizeof(special_freq[0]); i++) { // Check if it's a special freq
if( (special_freq[i]) == getCurrentFrequencyKhz()) {
return 1;