byCode static method

Protocol? byCode(
  1. int code
)

Returns the protocol for the given code

Implementation

static Protocol? byCode(int code) {
  return _protocols.values.firstWhere(
    (p) => p.code == code,
    orElse: () => throw ArgumentError('Unknown protocol code: $code'),
  );
}