Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print absolute raw bits 1,0s no parsing #26

Open
EdwinFairchild opened this issue Jul 27, 2022 · 8 comments
Open

Print absolute raw bits 1,0s no parsing #26

EdwinFairchild opened this issue Jul 27, 2022 · 8 comments

Comments

@EdwinFairchild
Copy link

  1. Who are you?
    Application Engineer
  2. What is your own modification (if any)?
    None
  3. Environments: OS type/version, BTLE repo branch and commit revision
    Ubuntu Latest. BTLE main branch
  4. Board/hardware type
    HACKRF
  5. Detailed commands/steps to reproduce the issue, and the related error message, screenshot, etc
    NONE
  6. Your debug efforts and results (if any)
    NA
  7. Any other thing we need to know for helping you better?
    NA

This is not an issues, but you do not have discussions enabled, so I will ask my question here.
Question 1.
How would I modify your code in order to be able to print a bit stream of BLE traffic , absolute zero parsing ?. Or for more general purpose, how can I print the bits of what ever rf signal hackrf is giving me. ? Essentialy I am trying to demodulate a signal very similar to BLE and I need to see the raw data to make sure we are transmitting properly. Your work here seems like it can do the job I am just unsure how to do so.
Question 2.
I noticed the -r flag for btle_rx but is that really absolute raw? or are you parsing header and aa because is see it displayed there.?

@JiaoXianjun
Copy link
Owner

You can print the bit decision here:

bit_decision = (I0*Q1 - I1*Q0)>0? 1 : 0;

@EdwinFairchild
Copy link
Author

I went to demod_byte and I am printing 1,0s from there but I am not sure if this is indeed demodulaating the entirety of the signal or if something else is being stripped from the signal

void demod_byte(IQ_TYPE* rxp, int num_byte, uint8_t *out_byte) {
  int i, j;
  int I0, Q0, I1, Q1;
  uint8_t bit_decision;
  int sample_idx = 0;
  
  for (i=0; i<num_byte; i++) {
    out_byte[i] = 0;
    for (j=0; j<8; j++) {
      I0 = rxp[sample_idx];
      Q0 = rxp[sample_idx+1];
      I1 = rxp[sample_idx+2];
      Q1 = rxp[sample_idx+3];
      bit_decision = (I0*Q1 - I1*Q0)>0? 1 : 0;
      out_byte[i] = out_byte[i] | (bit_decision<<j);

      sample_idx = sample_idx + SAMPLE_PER_SYMBOL*2;
      printf("%d",bit_decision);
    }
  }
  printf("\r\n");
}

@JiaoXianjun
Copy link
Owner

Indeed, that is after the unique word hitting. You need to go to search_unique_bits function to understand how that works. That works for the raw streaming iq and tries to find the unique word in the the incoming raw iq.

@EdwinFairchild
Copy link
Author

Thanks , I will look into it.

@EdwinFairchild
Copy link
Author

Ok, @JiaoXianjun is there anyway I can get this level of data , bits of the entire packet.
image
Obviously this is done with an scope or signal analyzer.
But could I accomplish this with your code ?

@JiaoXianjun
Copy link
Owner

Yes you can.

@EdwinFairchild
Copy link
Author

I have accomplished to do this much.
image
I am not sure why I feel maybe there should be more data... ? but i could be wrong

@EdwinFairchild
Copy link
Author

I am unsure on how to go about this, i just do not understand a lot of it. Specially the IQ things. I noticed some preamble things in your code but its commented out. and the array is huge so im guessing its not decoded.
Any help would be welcomed and appareicated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants