Skip to content

Clean code #4

@MTTA96

Description

@MTTA96

ble_sdk_custom.dart

Future _setNotifications(List listNotifications) async {
bool result = false;
for (final notification in listNotifications) {
await Future.delayed(const Duration(milliseconds: 500));
if (notification.properties.contains(CharacteristicProperties.NOTIFY)) {
// log('Set notification to ${notification.characteristicId} - ${DateTime.now()}');
result = await setNotification(notification);
}
if (notification.properties.contains(CharacteristicProperties.INDICATE)) {
// log('Set indication to ${notification.characteristicId} - ${DateTime.now()}');
result = await setIndication(notification);
}
if (!result) return false;
}

return true;

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions