adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
598 stars 488 forks source link

Beacon example fails to compile with BLE_GAP_ADV_TYPE_ADV_NONCONN_IND uncommented #799

Closed moppymopperson closed 7 months ago

moppymopperson commented 8 months ago

Operating System

MacOS

IDE version

Arduino 2.2.1

Board

nRF52840 Express

BSP version

GitHub latest

Sketch

BlueFruit52Lib/examples/Peripheral/beacon/beacon.ino

What happened ?

If you uncomment line 82, compilation fails because the macro is undefined.

 //Bluefruit.Advertising.setType(BLE_GAP_ADV_TYPE_ADV_NONCONN_IND);

I searched the web and found this definition

#define BLE_GAP_ADV_TYPE_ADV_NONCONN_IND  0x03

How to reproduce ?

  1. Uncomment the line above and try to compile the example

Debug Log

No response

Screenshots

No response

moppymopperson commented 8 months ago

While we're at it, these comments could be more clear about what needs to be changed for Apple platforms. I'm not quite sure what values I should use with setInterval.

  /*
   * Apple Beacon specs
   * - Type: Non connectable, undirected
   * - Fixed interval: 100 ms -> fast = slow = 100 ms
   */
  //Bluefruit.Advertising.setType(BLE_GAP_ADV_TYPE_ADV_NONCONN_IND);
  Bluefruit.Advertising.restartOnDisconnect(true);
  Bluefruit.Advertising.setInterval(160, 160);    // in unit of 0.625 ms
nunomiguelferreira commented 7 months ago

Agree with the problem, defining the macro BLE_GAP_ADV_TYPE_ADV_NONCONN_IND and trying to upload a code, the BLE stack won't even start. It would be very useful to have this working!

hathach commented 7 months ago

should be fixed by #801 , thank you for reporting the issue.

moppymopperson commented 7 months ago

Thanks for the fix, and for making the comments clearer!