-
-
Notifications
You must be signed in to change notification settings - Fork 284
Jira 916 BLE.connected() always return false. #507
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
Comments
@SidLeung has anyone from the Intel team looked into this? |
That's expected. Because your code use BLE object. The BLE object is used to manage the local device. So the code always return false. In your code, you need get the connected device and use this BLEDevice object to call connected method.
|
@sgbihu I disagree with this expected behaviour. The original spec we discussed had:
So I expect |
Hi @sandeepmistry , I disagree with your opinion too.
So I think your opinion want return true if the BLE has any connected device. Do you think this is necessary? |
The |
Another scenario is the BLE is work in central mode. Does it return true if peripheral connected to it? If return true. Does this API can adapt here? If not, why peripheral and central don't have same behavior? |
@sgbihu Hi, for my view For the ambiguous about the the connection state of central mode and peripheral mode at same time.
|
I agree with @jimaobian's comment above. |
Folks: Would like to summarize the discussion in a conclusive manner and to identify tasks to bring fruitful results,
To address the above issues, I would like to kick off a proposal to re-structure the BLEDevice class. Please consider the following class diagram, This is a realization of various classes based off the parent class, BLEDevice. Using the above class structure, performed a simple exercise of putting several methods (of the BLEDevice class) to the corresponding classes. It would be more efficient if we can first settle on the re-structuring of the BLEDevice class and that tag some of the methods to each identified class. Please note that this is a kick off of the re-structuring exercise, nothing is set in stone at this point. Please comment. |
I can see one major obstacle to my proposed changes to the BLEDevice class - the class definition is released to the public. There are sketches using this definition. If some of the methods are moved (re-classified) to the derived classes, these sketches will fail to compile. |
@SidLeung I propose we go with a more simpler change like PR #528 in the short term. The class diagram you proposed makes sense logically, however I don't think we need a major refactor now. Although, some users might want to call
We'll find out soon, when the CurieBLE reference on the Arduino site is updated for the new 2.0.2 release. I don't expect too many headaches at this point. |
@sandeepmistry Thank you for understanding the dilemma I was pondering upon - refactoring a public facing definition or document the operating condition for each method. Apparently, this is an unfortunate choice of the lesser evil.
That's a bit of explaining for one method, scan(). In fact, @sgbihu has grouped all the BLEDevice methods with the following spread sheet, I am concerned with the fact that we may have a user experience issue budding here and the time is now to nip it. I would urge you to reconsider the refactoring of the BLEDevice class. |
Hi @SidLeung , I'd merge #528 since it's an easy solution to a complicated problem, and wait to see the adoption rate of the new APIs and the number of forum requests to decide if we need to enforce some behaviours. |
Will make this change in Elnath. |
https://jira.ndg.intel.com/browse/ATLEDGE-857 |
Will re-test when merged for Elnath. |
testing other BLE issues. Will retest for Elnath release. |
Here is the code. It always return false, even BLE is connected.
corelib Version: 2.0.1-RC2
The text was updated successfully, but these errors were encountered: