Skip to content

Commit

Permalink
Fix FM RAW mode resampler bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jul 15, 2024
1 parent 5a0f35e commit cf96a26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion FMNetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ bool CFMNetwork::open()
}
}

#if !defined(HAS_SRC)
if ((m_protocol == FMNP_RAW) && (m_sampleRate != MMDVM_SAMPLERATE)) {
LogError("The resampler needed for non-native sample rates has not been included");
return false;
}
#endif

return m_socket.open(m_addr);
}
Expand Down Expand Up @@ -544,7 +546,7 @@ bool CFMNetwork::writeUSRPStart()
buffer[length++] = 0x08U;

// TLV Length
buffer[length++] = 3U + 4U + 3U + 1U + 1U + m_callsign.size() + 1U;
buffer[length++] = 3U + 4U + 3U + 1U + 1U + (unsigned char)m_callsign.size() + 1U;

// DMR Id
buffer[length++] = 0x00U;
Expand Down
8 changes: 4 additions & 4 deletions RemoteControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ REMOTE_COMMAND CRemoteControl::getCommand()
#endif
}

m_socket.write((unsigned char*)replyStr.c_str(), replyStr.length(), address, addrlen);
m_socket.write((unsigned char*)replyStr.c_str(), (unsigned int)replyStr.length(), address, addrlen);
}

return m_command;
Expand All @@ -209,14 +209,14 @@ unsigned int CRemoteControl::getArgCount() const
case RCD_MODE_P25:
case RCD_MODE_NXDN:
case RCD_MODE_M17:
return m_args.size() - SET_MODE_ARGS;
return (unsigned int)m_args.size() - SET_MODE_ARGS;
case RCD_PAGE:
case RCD_PAGE_BCD:
case RCD_PAGE_A1:
case RCD_PAGE_A2:
return m_args.size() - 1U;
return (unsigned int)m_args.size() - 1U;
case RCD_CW:
return m_args.size() - 1U;
return (unsigned int)m_args.size() - 1U;
default:
return 0U;
}
Expand Down

0 comments on commit cf96a26

Please sign in to comment.