Hi Smart People:
There are a ton of examples of using Wi-Fi to get the time for ESP32. However, I would like to be able to use Bluetooth LE to quickly pair an ESP32 just long enough to grab the system time on the mobile device, then disconnect. It is for a digital watch project. Anyone have some quick and easy examples on how to do this?
Thanks!
Mark
EMC32 Get Time from Android or Apple Using Bluetooth LE
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- xFishbonex
- Posts: 11
- Joined: Fri Jan 27, 2023 12:17 pm
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: EMC32 Get Time from Android or Apple Using Bluetooth LE
BLE doesn't really work that way.
Bluetooth splits devices into 'central' and 'peripheral' categories. Central devices initiate and control all data connections. Peripherals advertise their presence, but otherwise wait for a central to connect and tell them what to do.
Under that arrangement, there's no way for a peripheral to decide it wants to connect to a central. The central has to decide to talk to the peripheral.
Your phone can automatically try to connect to a BLE peripheral it's already been bonded to, and once the connection is made the phone can read a flag that says the peripheral wants a timestamp.
That involves creating an app for your phone to do the connecting, querying, and updating.
Bluetooth splits devices into 'central' and 'peripheral' categories. Central devices initiate and control all data connections. Peripherals advertise their presence, but otherwise wait for a central to connect and tell them what to do.
Under that arrangement, there's no way for a peripheral to decide it wants to connect to a central. The central has to decide to talk to the peripheral.
Your phone can automatically try to connect to a BLE peripheral it's already been bonded to, and once the connection is made the phone can read a flag that says the peripheral wants a timestamp.
That involves creating an app for your phone to do the connecting, querying, and updating.
Please be positive and constructive with your questions and comments.