-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
V4.2 Porting #534
base: master
Are you sure you want to change the base?
V4.2 Porting #534
Conversation
@@ -392,7 +400,7 @@ class BLEDeviceManager | |||
uint8_t _peer_adv_data[BLE_MAX_ADV_BUFFER_CFG][BLE_MAX_ADV_SIZE]; | |||
uint8_t _peer_adv_data_len[BLE_MAX_ADV_BUFFER_CFG]; | |||
uint8_t _peer_scan_rsp_data[BLE_MAX_ADV_BUFFER_CFG][BLE_MAX_ADV_SIZE]; | |||
int8_t _peer_scan_rsp_data_len[BLE_MAX_ADV_BUFFER_CFG]; | |||
uint8_t _peer_scan_rsp_data_len[BLE_MAX_ADV_BUFFER_CFG]; |
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.
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.
This change has been considered. Your implementation has an assumption, the scan response should followed by advertisement. But this may has some corner case to make ADV not be reported to sketch.
Now I use timeout mechanism. The central will report ADV data after 800ms delay.
Solution: Add service and appearance characteristic in the BLE lib. Changed files BLEDevice.cpp - check the local device BLEDeviceManager.cpp - Change the calls BLEDeviceManager.h - remove appearance member BLEProfileManager.cpp - Add GAP service and appearance characteristic BLEProfileManager.h - Add set/get API
Make the BLE support more characteristics and services by separate the service registration Changed files BLEProfileManager.cpp - Remove register all service at same time BLEProfileManager.h - Change the comments BLEServiceImp.cpp - Add the register service after update the characteristic
Root cause 1. The return value indecate the read/write request send successfully. 2. The subscribe will ignore the response and this will not be fixed. Solution 1. Add the error detect based on read/write response. Changed files BLECallbacks.cpp - Delete the error check for read response. BLECharacteristicImp.cpp - Add the error check. - Optimize the memory allocate and clear the allocated memory. BLECharacteristicImp.h - Add varibles to flag the response error
1. Implement the subscribe changed event notify feature. Changed files: BLECallbacks.cpp - Add subscribe changed handler and disconnect process BLECallbacks.h - Callback declaration BLECharacteristicImp.cpp - Add the event changed handler BLECharacteristicImp.h - Handler declaration
1. Subscribe/unsubscribe event cause notification can't send out 2. Delete unused code 3. Update the library.
1. Reconstruct the initial process to avoid call BLE API Changed files BLEDeviceManager.cpp - Change the init order ble_client.c - Add new call ble_service.h - Add new API declaration ble_service.c - Modify init logic ble_service_api.c - Delete unsed file nble_driver.c - Modify init logic
1. Fix Jira 769/git arduino#378. Discover GAP service by parameter. 2. Fix Jira 770/git arduino#379 to show the device name in central when discover GAP service. Changed service BLEDevice.cpp - Modify the API BLEDevice.h - Modify the API BLEDeviceManager.cpp - Add get device name logic BLEProfileManager.cpp - Implement get devicename and dicovery logic BLEProfileManager.h - Add API to get devicename from characteristic BLEServiceImp.cpp - Modify the filter logic BLEServiceImp.h - Modify the API
…nexpected Root cause: 1. The stack doesn't release the resource and makes peripheral crashed. Then central blocked. Solution: 1. Fix memory leak issue and release the resource. Changed File: gatt.c - Modify the code to make sure the resource can be released.
1. Dismiss the warnings. 2. Rebuild the library Changed files: BLEProfileManager.cpp - Init member variable rpc_deserialize.c - Delete unreachable code dtm.c - Init the variables gap.c - Init the variables gatt.c - Init the variables
1. Reinitial the BLE MAC address to avoid BLE start timer
Root cause 1. The central powered off peripherial device and make it not give response. Solution 1. Exit the wait loop when connection lost. Changed file BLECharacteristicImp.cpp - Change the wait logic
|
Porting V4.2 to improve the performance. Please don't merge.