EcuBus-Pro Script API Documentation

EcuBus-Pro worker script API — modules re-exported here are bundled into resources/lib/js/index.js and loaded inside a Node.js worker_thread for diagnostics, panels, and automation scripts.

  • Worker thread: user TypeScript/JavaScript runs here with a restricted API surface.
  • Main process: hardware (CAN, LIN, DoIP, SOME/IP via vSomeIP, etc.) and IPC handlers live here.
  • Bridge: RPC (postMessage with type: 'rpc') and events (type: 'event') connect the worker to UdsTester (src/main/workerClient.ts), which dispatches to NodeClass (src/main/nodeItem.ts).
Export Role
Util / UtilClass Lifecycle, variables, CAN/LIN/SOME/IP listeners, diagnostics hooks
output, setSignal, setVar, … Send frames / signals / variables to the main side
someipRequest, someipNotify, someipSubscribe SOME/IP operations (RPC to vSomeIP client)
canopen namespace CANopen helpers (separate submodule)

Throughout this folder, public APIs use TSDoc conventions (@param, @returns, @throws, @example, @remarks, @category, @module) so they render cleanly in TypeDoc and IDE hovers.

import { Util } from 'ecubus-worker' // bundled path depends on your project template

Util.Init(async () => {
// runs after worker is wired to the main process
})

CAN

CAN_ADDR_FORMAT
CAN_ADDR_TYPE
CAN_ID_TYPE
CanAddr
CanMsgType
CanSignal
CanMessage
SignalName
getFrameFromDB
getSignal
output
setSignal

Crypto Extend

CMAC

DOIP

EntityAddr
EthAddr
RegisterEthVirtualEntity

E2E

setTxPending

LIN

LinChecksumType
LinDirection
LinMode
LinAddr
LinCableErrorInject
LinMsg
LinSignal
SignalName
getFrameFromDB
getLinCheckSum
getSignal
linBaudRateCtrl
linPowerCtrl
linStartScheduler
linStopScheduler
output
setSignal

Other

canopen
SomeipMessageType
AuthenticationSession
AuthenticationSessionAccountInformation
CanFingerprint
FuzzContext
FuzzOptions
SomeipMessage
SomeipScriptSendBase
SomeipSubscribeOpts
SomeipUnsubscribeOpts
CRCName
SomeipScriptPayload
VsomeipEventType
assert
fingerprintFromCanMessages
fuzz
getPID
reporter

PWM

setPwmDuty

SOME/IP

SomeipMessageBase
SomeipMessageEvent
SomeipMessageRequest
SomeipMessageResponse
SomeipNotifyOpts
someipNotify
someipRequest
someipRequestNoReturn
someipSubscribe
someipUnsubscribe

SOMEIP

output

SerialPort

SerialPortClient
SerialPortCloseEvent
SerialPortDataEvent
SerialPortErrorEvent
SerialPortInfo
SerialPortOptions
SerialPortSetSignals
SerialPortSignals

TEST

assert
after
afterEach
before
beforeEach
describe
test

UDS

DiagJob
DiagRequest
DiagResponse
SecureAccessDll
ServiceItem
TesterInfo
UdsAddress
JobName
ServiceEvent
ServiceId
ServiceName
ServiceNameRecv
ServiceNameSend
TesterName
UdsSeqName
VariableMap
runUdsSeq
stopUdsSeq

Util

CRC
HexMemoryMap
S19MemoryMap
UtilClass
Util

Variable

getVar
setVar
setVars

Worker infrastructure

emitWorkerEventWithReply
registerWorker
workerEmit