MCPcopy Create free account
hub / github.com/ecto/muni / buildHeader

Function buildHeader

depot/console/src/lib/protocol.ts:79–91  ·  view source on GitHub ↗

Build command header.

(
  view: DataView,
  msgType: number,
  flags: number = 0
)

Source from the content-addressed store, hash-verified

77
78/** Build command header. */
79function buildHeader(
80 view: DataView,
81 msgType: number,
82 flags: number = 0
83): number {
84 const seq = nextSequence();
85 const ts = nowMs();
86 view.setUint8(0, msgType);
87 view.setUint8(1, flags);
88 view.setUint16(2, seq, true);
89 view.setUint32(4, ts, true);
90 return seq;
91}
92
93export function encodeTwist(
94 linear: number,

Callers 8

encodeTwistFunction · 0.85
encodeEStopFunction · 0.85
encodeEStopReleaseFunction · 0.85
encodeHeartbeatFunction · 0.85
encodeSetModeFunction · 0.85
encodeSetGoalFunction · 0.85
encodeToolFunction · 0.85
encodeLidarToggleFunction · 0.85

Calls 2

nextSequenceFunction · 0.85
nowMsFunction · 0.85

Tested by

no test coverage detected