BTLE
BTLE copied to clipboard
Print absolute raw bits 1,0s no parsing
- Who are you? Application Engineer
- What is your own modification (if any)? None
- Environments: OS type/version, BTLE repo branch and commit revision Ubuntu Latest. BTLE main branch
- Board/hardware type HACKRF
- Detailed commands/steps to reproduce the issue, and the related error message, screenshot, etc NONE
- Your debug efforts and results (if any) NA
- 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.?
You can print the bit decision here: https://github.com/JiaoXianjun/BTLE/blob/5fbbead53c5758a9042f55fed80d7c0780d10ef1/host/btle-tools/src/btle_rx.c#L1382
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");
}
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.
Thanks , I will look into it.
Ok, @JiaoXianjun is there anyway I can get this level of data , bits of the entire packet.
Obviously this is done with an scope or signal analyzer.
But could I accomplish this with your code ?
Yes you can.
I have accomplished to do this much.
I am not sure why I feel maybe there should be more data... ? but i could be wrong
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