Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rough idea for backwards compatibility with old BLE API #12

Closed

Conversation

@sandeepmistry
Copy link
Contributor

@sandeepmistry sandeepmistry commented Sep 28, 2016

I'm not planning to merge this, it's more to get the discussion going.

cc/ @SidLeung @sgbihu

@damellis

This comment has been minimized.

Copy link

@damellis damellis commented on api/RealTimeClock.h in bde41a3 Apr 8, 2016

This is a very minor point, but what about calling this setTimeProvider()?

@@ -39,7 +39,8 @@ enum BLEProperty {
BLEIndicate = 0x20
};

typedef void (*BLECharacteristicEventHandler)(BLECentral& central, BLECharacteristic& characteristic);
typedef void (*BLECharacteristicEventHandler)(BLECentral central, BLECharacteristic characteristic);

This comment has been minimized.

@sgbihu

sgbihu Sep 29, 2016

Their has a conflict between BLECentral and BLEDevice. At least, their should define another function type with BLEDevice parameter. Or the new API can't schedule the event.

This comment has been minimized.

@sandeepmistry

sandeepmistry Sep 29, 2016
Author Contributor

I'll push a change for this:

typedef void (*BLECharacteristicEventHandler)(BLEDevice central, BLECharacteristic characteristic);
typedef void (*BLECharacteristicEventHandlerOld)(BLECentral &central, BLECharacteristic &characteristic); // deprecated
@@ -30,7 +30,7 @@ enum BLEDeviceEvent {
BLEDisconnected = 2,
};

typedef void (*BLEDeviceEventHandler)(BLEDevice& device);
typedef void (*BLEDeviceEventHandler)(BLEDevice device);

This comment has been minimized.

@sgbihu

sgbihu Sep 29, 2016

Can you tell me the reason about not use reference? The copy my have some overload.

This comment has been minimized.

@sandeepmistry

sandeepmistry Sep 29, 2016
Author Contributor

This was a request from @tigoe (#7 (comment)).

From what I recall, the bigger discussion was related to beginners being confused by the syntax. @tigoe let me know if I missed something or didn't explain it correctly.

@@ -39,7 +39,8 @@ enum BLEProperty {
BLEIndicate = 0x20
};

typedef void (*BLECharacteristicEventHandler)(BLECentral& central, BLECharacteristic& characteristic);
typedef void (*BLECharacteristicEventHandler)(BLECentral central, BLECharacteristic characteristic);

This comment has been minimized.

@sandeepmistry

sandeepmistry Sep 29, 2016
Author Contributor

I'll push a change for this:

typedef void (*BLECharacteristicEventHandler)(BLEDevice central, BLECharacteristic characteristic);
typedef void (*BLECharacteristicEventHandlerOld)(BLECentral &central, BLECharacteristic &characteristic); // deprecated
@@ -30,7 +30,7 @@ enum BLEDeviceEvent {
BLEDisconnected = 2,
};

typedef void (*BLEDeviceEventHandler)(BLEDevice& device);
typedef void (*BLEDeviceEventHandler)(BLEDevice device);

This comment has been minimized.

@sandeepmistry

sandeepmistry Sep 29, 2016
Author Contributor

This was a request from @tigoe (#7 (comment)).

From what I recall, the bigger discussion was related to beginners being confused by the syntax. @tigoe let me know if I missed something or didn't explain it correctly.

enum BLEPeripheralEvent {
BLEConnected = 0,
BLEDisconnected = 1
};

This comment has been minimized.

@sandeepmistry

sandeepmistry Sep 29, 2016
Author Contributor

These enums need to be removed as well, so they don't conflict with BLEDevice's.

@facchinm facchinm force-pushed the arduino:master branch from 141b283 to 8ad0c60 Oct 30, 2018
@aentinger
Copy link
Contributor

@aentinger aentinger commented Oct 7, 2020

Probably also widely outdated @facchinm what do you think, can we close it?

@facchinm facchinm closed this Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.