toip.tools

type · Browser and Node

SimFault

@toip-tools/mesh-transport/simView source
TypeScriptImport
import { type SimFault } from "@toip-tools/mesh-transport/sim";

Declaration

TypeScripttype
type SimFault =
  | { kind: "drop"; from?: string; to?: string; match?: (bytes: Uint8Array) => boolean; count?: number }
  | { kind: "duplicate"; from?: string; to?: string; match?: (bytes: Uint8Array) => boolean; count?: number }
  /** Delays delivery by `delayMs`, so later frames overtake it. */
  | { kind: "delay"; from?: string; to?: string; match?: (bytes: Uint8Array) => boolean; count?: number; delayMs: number }
  /** Flips a byte. Without `passCrc` the radio's CRC catches it and the frame is lost. */
  | { kind: "corrupt"; from?: string; to?: string; match?: (bytes: Uint8Array) => boolean; count?: number; passCrc?: boolean };