AgentSkillsCN

ecb-typescript

为EcuBus-Pro(ECB)汽车诊断系统编写TypeScript代码。提供UDS、CAN、LIN、DoIP、SOME/IP、CRC、Crypto、SerialPort等协议的API参考,以及测试框架的使用指南。适用于编写ECB脚本、对接汽车通信协议,或开发各类诊断服务。

SKILL.md
--- frontmatter
name: ecb-typescript
description: Write TypeScript code for EcuBus-Pro (ECB) automotive diagnostics. Provides API reference for UDS, CAN, LIN, DoIP, SOME/IP, CRC, Crypto, SerialPort, and test framework. Use when writing ECB scripts, working with automotive protocols, or developing diagnostic services.

ECB TypeScript Development

API Reference

Read the type definitions from node_modules/@types/ECB/ to get accurate API information and code examples.

Type Definition Files

FileContent
index.d.tsMain exports, global Util instance
uds.d.tsUDS services (DiagRequest, DiagResponse), CAN/LIN/DoIP/SOMEIP types, test framework, signals, variables, SerialPort
crc.d.tsCRC class and built-in CRC algorithms
cryptoExt.d.tsCMAC function
secureAccess.d.tsSecureAccessDll class for security key generation
utli.d.tsHexMemoryMap and S19MemoryMap classes

Workflow

  1. Read the relevant .d.ts files to understand available APIs and see JSDoc examples
  2. Write code based on the type definitions
  3. Import from 'ECB' module

Key Points

  • Use Util.Init(fn) for initialization code
  • Use Util.End(fn) for cleanup code
  • Use Util.Register(jobName, fn) to register job handlers
  • Use Util.On*() methods for event handling (CAN, LIN, Signal, Key, Var)
  • process.env.PROJECT_ROOT provides the ECB project root path
  • Service/Job names follow TesterName.ServiceName format