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

BLE sensors data through a connect, LYWSD03MMC and MHO-C401 add #736

Merged
merged 5 commits into from
Aug 18, 2020

Conversation

1technophile
Copy link
Owner

@1technophile 1technophile commented Aug 17, 2020

Add LYWSD03MMC low-cost BLE temperature sensor, inspired from @polclota work
Add the possibility to have 1 BLE connect operation every X BLE scans
Add MHO-C401

and an associated BLE connect mechanism as the device advertise only encrypted data

-delete client if connect failed
-don't process the callback if we have a processlock
-free manufacturer data
-update library
-add check on pRemoteCharacteristic
Add the possibility to do a connect every X scan
Rename variables for consistency
Some refactoring for improved code reading
Add processlock check before launching on demand BLE scan and BLEconnect
@1technophile 1technophile added this to the v0.9.5 milestone Aug 17, 2020
@1technophile 1technophile changed the title Add the possibility to retrieve BLE sensors data through a connect function Add the possibility to retrieve BLE sensors data through a connect function LYWSD03MMC Aug 17, 2020
@1technophile 1technophile linked an issue Aug 18, 2020 that may be closed by this pull request
@1technophile 1technophile changed the title Add the possibility to retrieve BLE sensors data through a connect function LYWSD03MMC Retrieve BLE sensors data through a connect function LYWSD03MMC and MHO-C401 Aug 18, 2020
Same principle as LYWSD03MMC
Also change the LYWSD03MMC identification (by servicedata instead of name) for more robustness
@1technophile 1technophile changed the title Retrieve BLE sensors data through a connect function LYWSD03MMC and MHO-C401 BLE sensors data through a connect, LYWSD03MMC and MHO-C401 add Aug 18, 2020
Copy link
Contributor

@jmw6773 jmw6773 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry that I don't have either of these devices to test in my OMG environment.

@jmw6773
Copy link
Contributor

jmw6773 commented Aug 18, 2020

This PR also looks to address issue #725

@1technophile
Copy link
Owner Author

This PR also looks to address issue #725

You are right

@1technophile 1technophile linked an issue Aug 18, 2020 that may be closed by this pull request
@1technophile
Copy link
Owner Author

I'm sorry that I don't have either of these devices to test in my OMG environment.

We all contribute with the means and time we have :-) and I have no problem with that.

@jmw6773
Copy link
Contributor

jmw6773 commented Aug 18, 2020

Should the comment for this variable read something like: //Number of BLE scans between connection cycles

unsigned int BLEscanBeforeConnect = ScanBeforeConnect; //time between 2 scans

may be also used in the future for SYStoMQTT so did it for non ESP32 boards also
@1technophile
Copy link
Owner Author

Should the comment for this variable read something like: //Number of BLE scans between connection cycles

Yes, corrected

Copy link
Contributor

@Legion2 Legion2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep it simple

@1technophile
Copy link
Owner Author

Thanks for your comments @Legion2 & @jmw6773 !

@1technophile 1technophile merged commit d6d42bf into development Aug 18, 2020
@1technophile 1technophile deleted the connect-copy branch August 18, 2020 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leakage in getting manufacture data and the fix. Support for Mi Jia LYWSD03MMC
3 participants