maxAge property

int maxAge
inherited

The max-age of this CoAP message.

Implementation

int get maxAge {
  final opt = getFirstOption(OptionType.maxAge);
  return opt?.value as int? ?? CoapConstants.defaultMaxAge;
}
void maxAge=(int value)
inherited

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));
}