I try to send custom BLE packet by modifying the Python script, and sniff packets with Wireshark.
I find that:
1.When sending SCAN_REQ with a valid advertiser address (advertising address of a real peripheral), the LED of nRF52840 flashes blue, and Wireshark can sometimes sniff the sent packet.
Codes as follow
Logs as follow
Captured packets as follow
2.When sending SCAN_REQ with an invalid advertiser address (advertising address not used by peripherals), the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet.
Codes as follow
nRF52840 looks like
3.When sending custom ADV_NONCONN_IND, the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet.
Codes as follow
Pcap saved by wrpcap looks like
And the question is:
1.Why can nRF52840 send SCAN_REQ only with a valid advertiser address, is there any additional logic in the firmware?
2.What does it mean that the LED of nRF52840 stays blue, is that an abnormal state? How can I confirm that the packet is sent to the air successfully?
3.Can I send custom ADV_NONCONN_IND packet (more specifically, custom BLE mesh packet) with your firmware? If so, would you like to give me a hint about how to do?
Yes, scan requests are only sent by the firmware after it receives a valid advertisement from a peripheral. More precisely it sends a scan request after ~150us of receiving an advertisement from the real peripheral (as intended by the spec). As you can guess, if you send a scan request with invalid advertiser address, the firmware will wait forever for an nonexistent peripheral advertisement.
It means: "Waiting reception of peripheral advertisement with the address you have informed via scan request PDU". When the blue led goes off, it means that the scan request has been sent to the peripheral.
Certainly you can, but you would need to modify the firmware source code in it. If you like low-level firmware programming, feel free to send to sweyntooth@gmail.com a request from your university email. Regards.
Hi @Matheus-Garbelini ,
First of all, thanks for this work!
I try to send custom BLE packet by modifying the Python script, and sniff packets with Wireshark.
I find that:
1.When sending SCAN_REQ with a valid advertiser address (advertising address of a real peripheral), the LED of nRF52840 flashes blue, and Wireshark can sometimes sniff the sent packet. Codes as follow
Logs as follow
Captured packets as follow
![Wireshark](https://user-images.githubusercontent.com/45156301/147632191-0aa4d783-f501-4a7c-9cf4-5958290d7196.png)
2.When sending SCAN_REQ with an invalid advertiser address (advertising address not used by peripherals), the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet. Codes as follow
nRF52840 looks like
![image](https://user-images.githubusercontent.com/45156301/147633892-29a60798-837c-453e-aed6-5ca6caaeb14c.png)
3.When sending custom ADV_NONCONN_IND, the LED of nRF52840 stays blue, and Wireshark can not sniff the sent packet. Codes as follow
Pcap saved by wrpcap looks like
![image](https://user-images.githubusercontent.com/45156301/147633140-acecabed-d862-4d5f-9520-e386653f6f65.png)
And the question is: 1.Why can nRF52840 send SCAN_REQ only with a valid advertiser address, is there any additional logic in the firmware? 2.What does it mean that the LED of nRF52840 stays blue, is that an abnormal state? How can I confirm that the packet is sent to the air successfully? 3.Can I send custom ADV_NONCONN_IND packet (more specifically, custom BLE mesh packet) with your firmware? If so, would you like to give me a hint about how to do?
Appreciate for your help.
Regards, yan_xiao_xi