Skip to content

Commit

Permalink
Correct a few minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
aqbifzl authored and shajen committed Sep 1, 2023
1 parent 0a10b2b commit 2d9ad14
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ To ignore annoying frequency that you are not interested use `ignored_frequencie
}
```

## Use multipe devices
## Use multiple devices

To use two dongles with serials `11111111` and `22222222`:
```
Expand Down Expand Up @@ -259,7 +259,7 @@ To use two dongles with serials `11111111` and `22222222`:

If you have multiple `rtl-sdr` dongles with the same serial you can change it with `rtl_eeprom -s 12345678`.

## Scan multipe frequencies ranges
## Scan multiple frequencies ranges

To scan `144 Mhz - 146 Mhz` and `440 Mhz - 442 Mhz` in the same time:
```
Expand Down
2 changes: 1 addition & 1 deletion sources/radio/hackrf_sdr_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void HackrfSdrDevice::setup(const FrequencyRange &frequencyRange) {
if (frequencyRange.center() != m_frequency) {
Logger::debug("HackRf", "set center {}", frequencyToString(frequencyRange.center()));
if (hackrf_set_freq(m_device, frequencyRange.center()) != HACKRF_SUCCESS) {
throw std::runtime_error("can not set frequnecy");
throw std::runtime_error("can not set frequency");
}
m_frequency = frequencyRange.center();
}
Expand Down
4 changes: 2 additions & 2 deletions sources/radio/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ void Recorder::processSamples(const std::chrono::milliseconds& time, const Frequ
m_lastDataTime = std::max(m_lastDataTime, time);
for (auto it = m_workers.begin(); it != m_workers.end();) {
auto f = [it](const std::pair<FrequencyRange, bool>& data) { return it->first == data.first; };
const auto transmisionInProgress = std::any_of(activeTransmissions.begin(), activeTransmissions.end(), f);
if (transmisionInProgress) {
const auto transmissionInProgress = std::any_of(activeTransmissions.begin(), activeTransmissions.end(), f);
if (transmissionInProgress) {
it++;
} else {
const auto frequencyRange = it->first;
Expand Down
2 changes: 1 addition & 1 deletion sources/radio/sdr_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void SdrScanner::checkManualRecording() {
const auto frequencyRange = m_manualRecording->frequencyRange;
const auto totalTime = m_manualRecording->time;

Logger::info("Scanner", "start manual recoridng: {}, time: {} seconds", frequencyRange.toString(), std::chrono::duration_cast<std::chrono::seconds>(totalTime).count());
Logger::info("Scanner", "start manual recording: {}, time: {} seconds", frequencyRange.toString(), std::chrono::duration_cast<std::chrono::seconds>(totalTime).count());
m_device->startStream(frequencyRange);
while (m_isRunning && time() - startTime <= totalTime) {
m_device->waitForData();
Expand Down
8 changes: 4 additions & 4 deletions tests/test_ring_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TEST(RingBufferTest, Overflow) {

TEST(RingBufferTest, Round) {
std::vector<uint8_t> push;
std::vector<uint8_t> poped;
std::vector<uint8_t> popped;

constexpr auto PUSH_SIZE = 1229;
constexpr auto POP_SIZE = 1231;
Expand All @@ -50,16 +50,16 @@ TEST(RingBufferTest, Round) {

RingBuffer buffer(BUFFER_SIZE);
uint32_t pushed = 0;
while (poped.size() < push.size()) {
while (popped.size() < push.size()) {
while (buffer.availableDataSize() < POP_SIZE && pushed < push.size()) {
buffer.push(push.data() + pushed, PUSH_SIZE);
pushed += PUSH_SIZE;
}
while (POP_SIZE <= buffer.availableDataSize()) {
const auto tmp = buffer.pop(POP_SIZE);
std::copy(tmp.begin(), tmp.end(), std::back_inserter(poped));
std::copy(tmp.begin(), tmp.end(), std::back_inserter(popped));
}
}

EXPECT_EQ(push, poped);
EXPECT_EQ(push, popped);
}

0 comments on commit 2d9ad14

Please sign in to comment.