Skip to content

Commit

Permalink
Merge branch 'mskvortsov-skip-netid2'
Browse files Browse the repository at this point in the history
  • Loading branch information
tapparelj committed May 17, 2024
2 parents db15411 + fea12d2 commit a303cb3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# v0.5.8
- Add option to ignore sync words checks and print the received values
# v0.5.7
- Add optional print of received payload as hex values
- Update conda-smithy configuration
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![GitHub last commit](https://img.shields.io/github/last-commit/tapparelj/gr-lora_sdr)](https://img.shields.io/github/last-commit/tapparelj/gr-lora_sdr)
![gnuradio](https://img.shields.io/badge/GNU%20Radio-3.10.6-important)
![version](https://img.shields.io/badge/Version-0.5.7-brightgreen)
![version](https://img.shields.io/badge/Version-0.5.8-brightgreen)
[![arXiv](https://img.shields.io/badge/arXiv-2002.08208-<COLOR>.svg)](https://arxiv.org/abs/2002.08208)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Ftapparelj%2Fgr-lora_sdr&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)
[![Build conda package](https://github.com/tapparelj/gr-lora_sdr/actions/workflows/conda-build.yml/badge.svg)](https://github.com/tapparelj/gr-lora_sdr/actions/workflows/conda-build.yml)
Expand Down Expand Up @@ -184,14 +184,15 @@ Thanks to Ryan Volz this OOT module can also directly be installed as a Conda pa
[grc]
local_blocks_path=path_to_the_downloaded_folder/gr-lora_sdr/grc
## Changelog
- Add option to ignore sync words checks and print the received values
- Add optional print of received payload as hex values
- Added tagged stream input support (for frame definition of frame length)
- Fixed LLR stream format between _fft\_demod_ and _deinterleaver_
- added tags to crc verification output stream indication frame start, length and CRC result.
- added separator option for file input
- added preamble length option
- added parameter for frame zero-padding
- add low datarate optimisation support
- add low data-rate optimization support
- add support of spreading factors smaller than 7

<font size="10"> [...](./Changelog.md)</font>
Expand Down
2 changes: 1 addition & 1 deletion grc/lora_sdr_frame_sync.block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ documentation: |-
Bandwidth: Bandwidth [Hz]
sf: spreading factor
impl_head: usage of an implicit header (explicit will be used otherwise)
sync_word: The frame sync word. Can be specified as an hex or dec value (e.g. 0x12 or 18), or directly as the decimal values modulating the two network identifiers upchirps in the preamble (e.g [8,16]).
sync_word: The frame sync word. Can be specified as an hex or dec value (e.g. 0x12 or 18), or directly as the decimal values modulating the two network identifiers upchirps in the preamble (e.g [8,16]). The values [0,0] will ignore sync word verification and print the detected values.
preamb_len: Number of upchirps in the preamble. Should be in [6-65535] (default value 8);
os_factor: oversampling factor of the input stream compared to the signal bandwidth. Oversampling is used to compensate STO and SFO.
Input:
Expand Down
14 changes: 12 additions & 2 deletions lib/frame_sync_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,14 @@ namespace gr
int netid2 = get_symbol_val(&net_ids_samp_dec[m_number_of_bins], &m_downchirp[0]);
one_symbol_off = 0;

if (abs(netid1 - (int32_t)m_sync_words[0]) > 2) // wrong id 1, (we allow an offset of 2)
if (m_sync_words[0] == 0) { // match netid1 only if requested
items_to_consume = 0;
m_state = SFO_COMPENSATION;
frame_cnt++;
std::cout << "netid1 is " << netid1 << ", netid2 is " << netid2 <<
", check skipped" << std::endl;
}
else if (abs(netid1 - (int32_t)m_sync_words[0]) > 2) // wrong id 1, (we allow an offset of 2)
{

// check if we are in fact checking the second net ID and that the first one was considered as a preamble upchirp
Expand Down Expand Up @@ -762,7 +769,8 @@ namespace gr
else // net ID 1 valid
{
net_id_off = netid1 - (int32_t)m_sync_words[0];
if (mod(netid2 - net_id_off, m_number_of_bins) != (int32_t)m_sync_words[1]) // wrong id 2
if (m_sync_words[1] != 0 && // match netid2 only if requested
mod(netid2 - net_id_off, m_number_of_bins) != (int32_t)m_sync_words[1]) // wrong id 2
{
m_state = DETECT;
symbol_cnt = 1;
Expand All @@ -780,6 +788,8 @@ namespace gr
items_to_consume = -m_os_factor * net_id_off;
m_state = SFO_COMPENSATION;
frame_cnt++;
if (m_sync_words[1] == 0)
std::cout << "netid2 is " << netid2 << std::endl;
}
}
if (m_state != DETECT)
Expand Down

0 comments on commit a303cb3

Please sign in to comment.