Skip to content

Conversation

colemancda
Copy link

@colemancda colemancda commented Nov 6, 2024

Adds new ESP32 example that advertises as an iBeacon in addition to its name and address.

Also adds some Swift wrappers for the ESP32 SDK and NimBLE.

Screenshot 2024-11-06 at 1 25 52 PM

IMG_49F20C2D8FDD-1

@erhankur
Copy link
Contributor

erhankur commented Nov 6, 2024

@colemancda In my opinion, blink example should be left to just blink, as intended by its nature. You could consider creating a separate Bluetooth example.

@colemancda
Copy link
Author

@erhankur I moved the example to its own and removed the blink code.

@colemancda colemancda changed the title Enable Bluetooth iBeacon advertisement for ESP32 Add iBeacon example for ESP32 Nov 6, 2024
@erhankur
Copy link
Contributor

erhankur commented Nov 7, 2024

@colemancda Thank you for the nice work!

I didn't play with bluetooth examples before. Just wanted to build to see if there is an issue.

Warnings regarding macro redefinitions ;

 warning: 'MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME' macro redefined
 warning: 'MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM' macro redefined
 ... 

Probably you will need to cleanup BringingHeader.h .Removing #include "esp_nimble_cfg.h" fixes the warnings.

And error;

esp32-ibeacon-sdk/main/String.swift:12:15: error: could not find module 'Darwin' for target 'riscv32-none-none-eabi'; found: arm64-apple-macos, arm64e-apple-macos, x86_64-apple-macos, at: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-09-11-a.xctoolchain/usr/lib/swift/embedded/Darwin.swiftmodule
10 | //===----------------------------------------------------------------------===//
11 | 
12 | #if canImport(Darwin)
  |               `- error: could not find module 'Darwin' for target 'riscv32-none-none-eabi'; found: arm64-apple-macos, arm64e-apple-macos, x86_64-apple-macos, at: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-09-11-a.xctoolchain/usr/lib/swift/embedded/Darwin.swiftmodule
13 | import Darwin
14 | #endif

@colemancda
Copy link
Author

@erhankur That's odd, I did not get that error with toolchain swift-DEVELOPMENT-SNAPSHOT-2024-10-30-a, I will download the latest and try again.

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

Successfully merging this pull request may close these issues.

2 participants