Skip to content

OOP style C vs C++ (for arduino users) #403

Open
@Dany-Boy55

Description

@Dany-Boy55

First of all, thank you very much for creating such a fantastic library, it is most certainly an amazing piece of work. I must admit I have little to no experience with plain C, but I do have quite a bit with "arduino" C++ and a lot with C#. At the beginning I was completely baffled by the way the library handles object oriented programming, until I did a bit of reading and understood the objects are handled with pointers to objects rather than the objects themselves. Are there any plans to change the style of the object handling to something similar to the current "arduino" like C++?
For example instead of using a pointer to a BLEScan object like this:

BLEScan *pBLEScanner = BLEDevice::getScan();
pBLEScanner->setAdvertisedDeviceCallbacks(new Callbacks());
pBLEScanner->setActiveScan(true);
pBLEScanner->start(30);

Using straight up objects like this:

BLEScan bleScanner = BLEDevice.getScan()
bleScanner.setAdvertisedDeviceCallbacks(new Callbacks())
bleScanner.setActiveScan(true)
bleScanner.start(30)

Thank you in advance for your response!
Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions