Lesson 8 – WICED Bluetooth: The Advertising Scanner

WICED Bluetooth Using the CYW20719

# Title Comment
0 A Two Hour WICED Bluetooth Class WICED Bluetooth Using the CYW20719 in all its glory
1 Resources Links to all of the Cypress WICED information including videos, application notes etc.
2 Your First Project Making Hello World & the Blinky LED
3 The Super Mux Tool Learning about platforms and the Super Mux Tool
4 Snips Using the example projects to learn Bluetooth
5 Bluetooth Designer Using the tool to customize a project and get going fast
6 The CCCD & Notification Writing back to the Central
7 Advertising  Beacon Building a beacon project to advertise your custom information 
8 Scanner Viewing the world around you
9 Bluetooth Classic SPP Using the Serial Port Profile to Transmit Lots of Data

Source code: 

  • git@github.com:iotexpert/wiced_bt_intro.git
  • https://github.com/iotexpert/wiced_bt_intro



In the last lesson I showed you how to build a BLE Advertising Beacon.  In that lesson I used a program called the “AdvScanner” which ran on a CYW920719Q40EVB-01 and acted like a Bluetooth Sniffer.  In this lesson I’ll show you how to build a simpler version of that program to look for the L7_Advertiser we built in the last lesson.

The important concepts in this lesson are:

  1. BLE Scanning
  2. Parsing Advertising Packets

I am going to build a project that Scans for BLE Advertisers.  Then, I’ll add the ability to print out the advertising packet.  And finally, I will add filtering capability to only look for advertisers who are using the Cypress Manufacturers code.

The steps that we will follow are:

  1. Make a new project with WICED Bluetooth Designer called L8_Scanner
  2. Turn off the GATT Database
  3. Move it into your project folder
  4. Fix the WICED_BT_TRACE to use the PUART
  5. Create a make target and build it
  6. Add a new function that prints out Advertising Packets
  7. Update the l8_scanner_app_init function to remove Advertising
  8. Update the wiced_bt_config to never stop scanning
  9. Program the development kit and see what happens
  10. Update the newAdv function to print out the raw data in the advertising packet
  11. Program again and see all of the chaos
  12. Put a filter for the Advertisers using the Cypress MFG Code
  13. Program

Implement the Project

Create a new project called L8_Scanner using the Bluetooth Designer

Turn off the GATT Database and then press Generate Code

Move the project into the wiced_bt_class folder

Update the WICED_BT_TRACE to send output to the PUART

Modify the make target & program that was created by the BT Designer

Make a new function that will be called when WICED finds a new advertising packet.

Remove the start advertising from l8_scanner_app_init

Update wiced_bt_config.c to never stop scanning.

Program your development kit and see what happens.

Now lets update the program to print the advertising packets.

Now program the development kit and see what happens.  Where I am sitting this is not very helpful because there are boatloads of advertisers.

Now let’s make one more change.  Instead of printing all of the packets let’s only look only at the ones that have Manufacturer data, the right length and the Cypress manufacturer id.

Now I only see my L7_Advertising project