Open mikkeldamsgaard opened 2 years ago
Hey @mikkeldamsgaard, thanks for the suggestion!
Could you elaborate a bit more what your mean with this? I'm not sure I fully understood.
The peripheral role is the computer acting as a remote device that others can connect to (or itself can connect to). In BLE terms it is often referred to as "Server", where as what is currently supported by SimpleBLE is "Client". It is somewhat confusing as BLE Servers are typically run on small devices, and BLE Clients are typically run on larger devices/computers.
The central role (client) is where the computer connects to peripherals. (servers)
The peripheral role requires advertising, registering services and chars. It acts as a server in that case, not a client.
Great for testing, but also, from true embedded devices, they can act as a peripheral and thus being controlled by another central.
On macos, it will be the CBPeripheralManager On bluez, dbus it would require implementing GattManager1 On windows, it will be GattServiceProvider
I made a quick patch to address this, but on Windows only:
Windows/PeripheralBase.cpp:
PeripheralBase::PeripheralBase(advertising_data_t advertising_data) {
identifier_ = advertising_data.identifier;
address_ = advertising_data.mac_address;
device_ = async_get(
BluetoothLEDevice::FromBluetoothAddressAsync(_str_to_mac_address(advertising_data.mac_address)));
manufacturer_data_ = advertising_data.manufacturer_data;
connectable_ = advertising_data.connectable;
advertised_services_ = advertising_data.advertised_services; // [xchen]: Add list of advertised services to peripheral without connecting.
}
// [xchen] BEGIN : Add list of advertised services to peripheral without connecting.
std::vector<BluetoothUUID> PeripheralBase::advertised_services() {
return advertised_services_;
}
// [xchen] END : Add list of advertised services to peripheral without connecting.
And of course plumb that through everything above.
That would make it advertise and connectable. You also need to handle read and writes of characteristics.
Yes, was just a partial hack. Awaiting real solution.
Great suggestion! I understand now what is needed. I'll add to the task list, but as it's a big feature it will take time to be implemented.
@kdewald What's the current status of that feature?
Hey @thewh1teagle, thanks for reaching out.
Unfortunately this is a 200+ hour long change that has fallen quite a bit in my priority list, especially due to lack of funding of the project. I would like to do this at some point but I don't see this happening anytime soon unless there's sufficient support on that front.
Hello, any news with this feature?
Hey @phil-chp, thanks for reaching out.
Some progress around this feature is underway, but it's unclear at this point when it will be ready. If you're interested, we'll be more than happy to extend a quote to increase our team size and get this out asap.
Hey.
Embedded devices often needs to have a peripheral role.
What are the plans of adding this to this lib? I looks like both windows, max and blueoz has the support.