maxAge property
The max-age of this CoAP message.
Implementation
int get maxAge {
final opt = getFirstOption(OptionType.maxAge);
return opt?.value as int? ?? CoapConstants.defaultMaxAge;
}
Implementation
set maxAge(final int value) {
if (value < 0 || value > 4294967295) {
throw ArgumentError.value(
value,
'Message::maxAge',
'Max-Age option must be between 0 and 4294967295 '
'(4 bytes) inclusive',
);
}
setOption(CoapOption.createVal(OptionType.maxAge, value));
}