bleBytes function
Copies and validates a complete ATT attribute value (at most 512 bytes).
Implementation
Uint8List bleBytes(List<int> value) {
if (value.length > 512 || value.any((b) => b < 0 || b > 255)) {
throw ArgumentError('BLE values must contain at most 512 bytes in 0..255');
}
return Uint8List.fromList(value);
}