observe property

int? observe
inherited

Observe

Implementation

int? get observe {
  final opt = getFirstOption(OptionType.observe);
  return opt?.value as int?;
}
  1. @internal
void observe=(int? value)
inherited

Implementation

@internal
set observe(final int? value) {
  if (value == null) {
    removeOptions(OptionType.observe);
  } else if (value < 0 || ((1 << 24) - 1) < value) {
    throw ArgumentError.value(
      value,
      'Message::observe',
      'Observe option must be between 0 and '
          '${(1 << 24) - 1} (3 bytes) inclusive',
    );
  } else {
    setOption(CoapOption.createVal(OptionType.observe, value));
  }
}