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

OS-Upgrade: Add a BT storage transformation tool. #22

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

chejinxian
Copy link
Contributor

bug: v/47945

Rootcause: Due to the differences in the storage format of Bluetooth information in different system versions, in order to ensure that saved information can continue to be used after system upgrades, the storage transformation tool has been added.

@chejinxian chejinxian requested a review from hyson710 as a code owner January 2, 2025 15:25
@hyson710 hyson710 added the enhancement New feature or request label Jan 2, 2025
bug: v/47945

Rootcause: Due to the differences in the storage format of Bluetooth information in different system versions, in order to ensure that saved information can continue to be used after system upgrades, the storage transformation tool has been added.

Signed-off-by: chejinxian1 <[email protected]>
@hyson710 hyson710 merged commit a08d305 into open-vela:dev Jan 3, 2025
4 checks passed
uint32_t size;
uint32_t num;
SERVICE_REMOTE_BLE_DEVICE_S* devices;
} gap_ble_whitelist_data;

Choose a reason for hiding this comment

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

Why doesn't this structure type end in _t?

syslog(LOG_DEBUG, "device type size is %zu", sizeof(SERVICE_REMOTE_BLE_DEVICE_S));

whitelist_device = (SERVICE_REMOTE_BLE_DEVICE_S*)(&ble_whitelist->devices); // obtain the address of the first device
device_properties = (remote_device_le_properties_t*)malloc(sizeof(remote_device_le_properties_t) * ble_whitelist->num);

Choose a reason for hiding this comment

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

Here need to determine if ble_whitelist->num ! = 0 to call malloc otherwise there will be a crash.

}

keys = (ble_keys_t*)(&bt_storage->bonded_devices);
device_properties = (remote_device_le_properties_t*)malloc(sizeof(remote_device_le_properties_t) * bt_storage->bonded_number);

Choose a reason for hiding this comment

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

Here need to determine if bt_storage->bonded_number ! = 0 to call malloc otherwise there will be a crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right.

syslog(LOG_DEBUG, "device type size is %zu", sizeof(SERVICE_REMOTE_DEVICE_S));

device = (SERVICE_REMOTE_DEVICE_S*)(&bt_storage->bonded_devices);
device_properties = (remote_device_properties_t*)malloc(sizeof(remote_device_properties_t) * bt_storage->bonded_number);

Choose a reason for hiding this comment

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

Here need to determine if bt_storage->bonded_number ! = 0 to call malloc otherwise there will be a crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants