setConfigDefaults function
Sets the values a key reads as before any fetch has succeeded.
That is most of an appliance's life: a device that cannot reach the network still has to behave.
Implementation
Future<void> setConfigDefaults(Map<String, Object?> defaults, {String? app}) {
final encoded = encodeVariant(defaults);
final buf = calloc<Uint8>(encoded.isEmpty ? 1 : encoded.length);
buf.asTypedList(encoded.length).setAll(0, encoded);
return _awaitOutcome(
app,
(a, port) => fdbRcSetDefaults(a, buf, encoded.length, port),
'setConfigDefaults',
).whenComplete(() => calloc.free(buf));
}