-
Notifications
You must be signed in to change notification settings - Fork 75
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
Hotfix for backward compatibility #158
Conversation
for change from Gap:AddressType_t to BLEProtocol::AddressType_t
@@ -57,7 +57,7 @@ class Gap { | |||
* deprecated state to transparenly support existing applications which may | |||
* have used Gap::ADDR_TYPE_*. | |||
*/ | |||
enum { | |||
enum AddressTypeOverload_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LiyouZhou The whole idea of making this enum anonymous is to deprecate it. What exactly is the situation that you would like to support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error I'm trying to correct is:
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp: In function 'void advertisementCallback(const Gap::AdvertisementCallbackParams_t*)':
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp:38:93: error: no matching function for call to 'Gap::connect(Address_t, Gap::<anonymous enum>, NULL, NULL)'
BLE::Instance().gap().connect(params->peerAddr, Gap::ADDR_TYPE_RANDOM_STATIC, NULL, NULL);
^
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp:38:93: note: candidate is:
In file included from /work/iot/ble-examples/BLE_LEDBlinker/yotta_modules/ble/ble/BLE.h:21:0,
from /work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp:18:
/work/iot/ble-examples/BLE_LEDBlinker/yotta_modules/ble/ble/Gap.h:265:25: note: virtual ble_error_t Gap::connect(const uint8_t*, BLEProtocol::AddressType_t, const Gap::ConnectionParams_t*, const GapScanningParams*)
virtual ble_error_t connect(const BLEProtocol::Address_t peerAddr,
^
/work/iot/ble-examples/BLE_LEDBlinker/yotta_modules/ble/ble/Gap.h:265:25: note: no known conversion for argument 2 from 'Gap::<anonymous enum>' to 'BLEProtocol::AddressType_t {aka BLEProtocol::AddressType::Type}'
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp: At global scope:
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp:111:26: warning: unused parameter 'ble' [-Wunused-parameter]
void onBleInitError(BLE &ble, ble_error_t error)
^
/work/iot/ble-examples/BLE_LEDBlinker/source/main.cpp:111:43: warning: unused parameter 'error' [-Wunused-parameter]
void onBleInitError(BLE &ble, ble_error_t error)
^
ninja: build stopped: subcommand failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Liyou, could you rename AddressTypeOverload_t into DeprecatedAddressType_t or something like this ?
I would be very happy if we all start to use the __deprecated_message
from compiler-polyfill. More information here: #152
@andresag01 @pan- please review |
Hotfix for backward compatibility
for change from Gap:AddressType_t to BLEProtocol::AddressType_t
@pan- @andresag01 please review.