antprotocol-websdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +27 -0
  2. package/dist/common/config/ProtocolRuntimeConfig.d.ts +36 -0
  3. package/dist/common/config/ProtocolRuntimeConfig.d.ts.map +1 -0
  4. package/dist/common/config/SdkConfig.d.ts +136 -0
  5. package/dist/common/config/SdkConfig.d.ts.map +1 -0
  6. package/dist/common/config/index.d.ts +8 -0
  7. package/dist/common/config/index.d.ts.map +1 -0
  8. package/dist/common/model/ProtocolGlobalModel.d.ts +416 -0
  9. package/dist/common/model/ProtocolGlobalModel.d.ts.map +1 -0
  10. package/dist/common/utils/CalculateCRC16Modbus.d.ts +2 -0
  11. package/dist/common/utils/CalculateCRC16Modbus.d.ts.map +1 -0
  12. package/dist/common/utils/UuidUtil.d.ts +19 -0
  13. package/dist/common/utils/UuidUtil.d.ts.map +1 -0
  14. package/dist/common/utils/gbk-encoder/GbkEncoder.d.ts +107 -0
  15. package/dist/common/utils/gbk-encoder/GbkEncoder.d.ts.map +1 -0
  16. package/dist/common/utils/gbk-encoder/generate-dictionary.d.ts +29 -0
  17. package/dist/common/utils/gbk-encoder/generate-dictionary.d.ts.map +1 -0
  18. package/dist/common/utils/gbk-encoder/hanzi-dictionary.d.ts +35 -0
  19. package/dist/common/utils/gbk-encoder/hanzi-dictionary.d.ts.map +1 -0
  20. package/dist/common/utils/gbk-encoder/index.d.ts +8 -0
  21. package/dist/common/utils/gbk-encoder/index.d.ts.map +1 -0
  22. package/dist/common/utils/gbk-encoder/single-byte-dictionary.d.ts +35 -0
  23. package/dist/common/utils/gbk-encoder/single-byte-dictionary.d.ts.map +1 -0
  24. package/dist/common/utils/logPlugins.d.ts +9 -0
  25. package/dist/common/utils/logPlugins.d.ts.map +1 -0
  26. package/dist/common/utils/time.d.ts +29 -0
  27. package/dist/common/utils/time.d.ts.map +1 -0
  28. package/dist/custom_analyze/bms_0x11_1.0.0.d.ts +24 -0
  29. package/dist/custom_analyze/bms_0x11_1.0.0.d.ts.map +1 -0
  30. package/dist/custom_analyze/bms_0x13_1.0.0.d.ts +20 -0
  31. package/dist/custom_analyze/bms_0x13_1.0.0.d.ts.map +1 -0
  32. package/dist/custom_analyze/bms_0x14_1.0.0.d.ts +22 -0
  33. package/dist/custom_analyze/bms_0x14_1.0.0.d.ts.map +1 -0
  34. package/dist/custom_analyze/bms_0x61_1.0.0.d.ts +35 -0
  35. package/dist/custom_analyze/bms_0x61_1.0.0.d.ts.map +1 -0
  36. package/dist/custom_analyze/bms_0x63_1.0.0.d.ts +16 -0
  37. package/dist/custom_analyze/bms_0x63_1.0.0.d.ts.map +1 -0
  38. package/dist/custom_analyze/bms_0x80_1.0.0.d.ts +22 -0
  39. package/dist/custom_analyze/bms_0x80_1.0.0.d.ts.map +1 -0
  40. package/dist/custom_analyze/bms_common_1.0.0.d.ts +50 -0
  41. package/dist/custom_analyze/bms_common_1.0.0.d.ts.map +1 -0
  42. package/dist/index.d.ts +14 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +11416 -0
  45. package/dist/protocol/BMSProtocol.d.ts +5 -0
  46. package/dist/protocol/BMSProtocol.d.ts.map +1 -0
  47. package/dist/protocol/ChargerProtocol.d.ts +5 -0
  48. package/dist/protocol/ChargerProtocol.d.ts.map +1 -0
  49. package/dist/protocol/DisplayerProtocol.d.ts +5 -0
  50. package/dist/protocol/DisplayerProtocol.d.ts.map +1 -0
  51. package/dist/protocol/PowerProtocol.d.ts +5 -0
  52. package/dist/protocol/PowerProtocol.d.ts.map +1 -0
  53. package/dist/protocol/common/ProtocolBasic.d.ts +320 -0
  54. package/dist/protocol/common/ProtocolBasic.d.ts.map +1 -0
  55. package/dist/protocol/common/ProtocolInterface.d.ts +91 -0
  56. package/dist/protocol/common/ProtocolInterface.d.ts.map +1 -0
  57. package/package.json +55 -0
@@ -0,0 +1,107 @@
1
+ /**
2
+ * GBK 编码器/解码器
3
+ *
4
+ * 编码规则:
5
+ * - 单字节范围:0x0001-0x00FF (1-255),存储 ASCII 字符
6
+ * - 汉字范围:从 0x0101 (257) 开始,字典中的汉字按顺序编码
7
+ * - 字节序:小端序(低字节在前)
8
+ * - 未找到的字符:使用 '?' (0x3F)
9
+ */
10
+ /**
11
+ * GBK 编码器/解码器类
12
+ * 提供字符串与字节数组之间的编码/解码功能
13
+ */
14
+ export declare class GbkEncoder {
15
+ /**
16
+ * 未找到字符的替代字符
17
+ */
18
+ private static readonly UNKNOWN_CHAR;
19
+ /**
20
+ * 未找到字符的替代字符编码值
21
+ */
22
+ private static readonly UNKNOWN_CHAR_CODE;
23
+ /**
24
+ * 将数字转换为小端序字节数组(2字节)
25
+ * @private
26
+ * @static
27
+ * @param value 要转换的数字
28
+ * @returns 小端序字节数组
29
+ */
30
+ private static numberToLittleEndianBytes;
31
+ /**
32
+ * 从小端序字节数组(2字节)读取数字
33
+ * @private
34
+ * @static
35
+ * @param bytes 字节数组
36
+ * @param offset 偏移量
37
+ * @returns 读取的数字
38
+ */
39
+ private static littleEndianBytesToNumber;
40
+ /**
41
+ * 编码字符串为字节数组
42
+ * @public
43
+ * @static
44
+ * @param str 要编码的字符串
45
+ * @returns 编码后的字节数组
46
+ */
47
+ static encode(str: string): Uint8Array;
48
+ /**
49
+ * 解码字节数组为字符串
50
+ *
51
+ * 解码策略:
52
+ * 1. 优先尝试解析为双字节汉字(如果还有下一个字节)
53
+ * 2. 如果解析成功且在汉字范围内,使用汉字
54
+ * 3. 否则,作为单字节字符处理
55
+ *
56
+ * 注意:这种方案存在歧义性,例如 [0x01, 0x01] 可能是:
57
+ * - 两个ASCII字符 '0x01' + '0x01'
58
+ * - 一个汉字(如果0x0101在字典中)
59
+ *
60
+ * 实际使用时,编码端和解码端需要保持一致。
61
+ *
62
+ * @public
63
+ * @static
64
+ * @param bytes 要解码的字节数组
65
+ * @returns 解码后的字符串
66
+ */
67
+ static decode(bytes: Uint8Array): string;
68
+ /**
69
+ * 将编码后的字节数组转换为十六进制字符串
70
+ * @public
71
+ * @static
72
+ * @param bytes 字节数组
73
+ * @returns 十六进制字符串(大写)
74
+ */
75
+ static bytesToHex(bytes: Uint8Array): string;
76
+ /**
77
+ * 将十六进制字符串转换为字节数组
78
+ * @public
79
+ * @static
80
+ * @param hex 十六进制字符串
81
+ * @returns 字节数组
82
+ */
83
+ static hexToBytes(hex: string): Uint8Array;
84
+ /**
85
+ * 编码字符串并返回十六进制字符串
86
+ * @public
87
+ * @static
88
+ * @param str 要编码的字符串
89
+ * @returns 十六进制字符串(大写)
90
+ */
91
+ static encodeToHex(str: string): string;
92
+ /**
93
+ * 从十六进制字符串解码
94
+ * @public
95
+ * @static
96
+ * @param hex 十六进制字符串
97
+ * @returns 解码后的字符串
98
+ */
99
+ static decodeFromHex(hex: string): string;
100
+ }
101
+ export declare const encode: typeof GbkEncoder.encode;
102
+ export declare const decode: typeof GbkEncoder.decode;
103
+ export declare const encodeToHex: typeof GbkEncoder.encodeToHex;
104
+ export declare const decodeFromHex: typeof GbkEncoder.decodeFromHex;
105
+ export declare const bytesToHex: typeof GbkEncoder.bytesToHex;
106
+ export declare const hexToBytes: typeof GbkEncoder.hexToBytes;
107
+ //# sourceMappingURL=GbkEncoder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GbkEncoder.d.ts","sourceRoot":"","sources":["../../../../websdk/common/utils/gbk-encoder/GbkEncoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;GAGG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAe;IAEnD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAgB;IAEzD;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAMxC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAMxC;;;;;;OAMG;WACW,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAgC7C;;;;;;;;;;;;;;;;;;OAkBG;WACW,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAsD/C;;;;;;OAMG;WACW,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAMnD;;;;;;OAMG;WACW,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAYjD;;;;;;OAMG;WACW,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAK9C;;;;;;OAMG;WACW,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAIjD;AAGD,eAAO,MAAM,MAAM,0BAAoB,CAAC;AACxC,eAAO,MAAM,MAAM,0BAAoB,CAAC;AACxC,eAAO,MAAM,WAAW,+BAAyB,CAAC;AAClD,eAAO,MAAM,aAAa,iCAA2B,CAAC;AACtD,eAAO,MAAM,UAAU,8BAAwB,CAAC;AAChD,eAAO,MAAM,UAAU,8BAAwB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 字典生成脚本
3
+ * 从txt字典文件生成TypeScript字典工具文件
4
+ *
5
+ * 重要:此脚本完全保持txt文件中的原始内容和顺序
6
+ * - 不做任何去重处理
7
+ * - 不做任何排序处理
8
+ * - 不做任何内容修改
9
+ * 确保编码值的绝对稳定性
10
+ *
11
+ * 使用方法:
12
+ * npm run build-dictionary
13
+ * 或
14
+ * tsx generate-dictionary.ts
15
+ */
16
+ /**
17
+ * 生成单字节字典工具文件
18
+ */
19
+ declare function generateSingleByteDictionary(): void;
20
+ /**
21
+ * 生成汉字字典工具文件
22
+ */
23
+ declare function generateHanziDictionary(): void;
24
+ /**
25
+ * 生成所有字典工具文件
26
+ */
27
+ declare function generateAllDictionaries(): void;
28
+ export { generateAllDictionaries, generateSingleByteDictionary, generateHanziDictionary };
29
+ //# sourceMappingURL=generate-dictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-dictionary.d.ts","sourceRoot":"","sources":["../../../../websdk/common/utils/gbk-encoder/generate-dictionary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgCH;;GAEG;AACH,iBAAS,4BAA4B,IAAI,IAAI,CAiI5C;AAED;;GAEG;AACH,iBAAS,uBAAuB,IAAI,IAAI,CA0IvC;AAED;;GAEG;AACH,iBAAS,uBAAuB,IAAI,IAAI,CAQvC;AAQD,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 汉字字典工具文件
3
+ * 此文件由 generate-dictionary.ts 自动生成,请勿手动修改
4
+ *
5
+ * 编码规则:
6
+ * - 字符在数组中的索引 + HANZI_START_CODE = 编码值
7
+ * - 汉字编码值范围:0x0101 开始
8
+ */
9
+ export declare const HANZI_START_CODE = 257;
10
+ export declare const HANZI_CHARS: string[];
11
+ /**
12
+ * 获取字符对应的编码值
13
+ * @param char 字符
14
+ * @returns 编码值,如果字符不在字典中返回 null
15
+ */
16
+ export declare function charToCode(char: string): number | null;
17
+ /**
18
+ * 获取编码值对应的字符
19
+ * @param code 编码值
20
+ * @returns 字符,如果编码值不在字典中返回 null
21
+ */
22
+ export declare function codeToChar(code: number): string | null;
23
+ /**
24
+ * 检查字符是否在字典中
25
+ * @param char 字符
26
+ * @returns 是否在字典中
27
+ */
28
+ export declare function hasChar(char: string): boolean;
29
+ /**
30
+ * 检查编码值是否在字典中
31
+ * @param code 编码值
32
+ * @returns 是否在字典中
33
+ */
34
+ export declare function hasCode(code: number): boolean;
35
+ //# sourceMappingURL=hanzi-dictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hanzi-dictionary.d.ts","sourceRoot":"","sources":["../../../../websdk/common/utils/gbk-encoder/hanzi-dictionary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAGpC,eAAO,MAAM,WAAW,EAAE,MAAM,EAm2M/B,CAAC;AA+BF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7C"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * GBK 编码器/解码器模块
3
+ *
4
+ * 提供字符串与自定义GBK编码之间的转换功能
5
+ */
6
+ export { GbkEncoder } from "./GbkEncoder";
7
+ export { encode, decode, encodeToHex, decodeFromHex, bytesToHex, hexToBytes } from "./GbkEncoder";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../websdk/common/utils/gbk-encoder/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 单字节字典工具文件
3
+ * 此文件由 generate-dictionary.ts 自动生成,请勿手动修改
4
+ *
5
+ * 编码规则:
6
+ * - 字符在数组中的索引 + SINGLE_BYTE_START_CODE = 编码值
7
+ * - 单字节字符的编码值就是其ASCII码(0x0001-0x00FF)
8
+ */
9
+ export declare const SINGLE_BYTE_START_CODE = 1;
10
+ export declare const SINGLE_BYTE_CHARS: string[];
11
+ /**
12
+ * 获取字符对应的编码值
13
+ * @param char 字符
14
+ * @returns 编码值,如果字符不在字典中返回 null
15
+ */
16
+ export declare function charToCode(char: string): number | null;
17
+ /**
18
+ * 获取编码值对应的字符
19
+ * @param code 编码值
20
+ * @returns 字符,如果编码值不在字典中返回 null
21
+ */
22
+ export declare function codeToChar(code: number): string | null;
23
+ /**
24
+ * 检查字符是否在字典中
25
+ * @param char 字符
26
+ * @returns 是否在字典中
27
+ */
28
+ export declare function hasChar(char: string): boolean;
29
+ /**
30
+ * 检查编码值是否在字典中
31
+ * @param code 编码值
32
+ * @returns 是否在字典中
33
+ */
34
+ export declare function hasCode(code: number): boolean;
35
+ //# sourceMappingURL=single-byte-dictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-byte-dictionary.d.ts","sourceRoot":"","sources":["../../../../websdk/common/utils/gbk-encoder/single-byte-dictionary.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAGxC,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAgQrC,CAAC;AA+BF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGtD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG7C"}
@@ -0,0 +1,9 @@
1
+ export declare const log: {
2
+ trace: (...messages: unknown[]) => void;
3
+ debug: (...messages: unknown[]) => void;
4
+ info: (...messages: unknown[]) => void;
5
+ warn: (...messages: unknown[]) => void;
6
+ error: (...messages: unknown[]) => void;
7
+ fatal: (...messages: unknown[]) => void;
8
+ };
9
+ //# sourceMappingURL=logPlugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logPlugins.d.ts","sourceRoot":"","sources":["../../../websdk/common/utils/logPlugins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG;yBACO,OAAO,EAAE;yBACT,OAAO,EAAE;wBACV,OAAO,EAAE;wBACT,OAAO,EAAE;yBACR,OAAO,EAAE;yBACT,OAAO,EAAE;CAC/B,CAAC"}
@@ -0,0 +1,29 @@
1
+ interface TimeModel {
2
+ getNowDate: (format?: string) => string;
3
+ convertSecondsToMs: (seconds: number) => number;
4
+ sqliteDateFormat: string;
5
+ toFormat: (date: Date | string) => string;
6
+ }
7
+ export declare const sqliteDateFormat = "YYYY-MM-DD HH:mm:ss:SSS";
8
+ /**
9
+ * 获取当前日期的格式化字符串
10
+ * @param format 格式化字符串,默认值为 sqliteDateFormat
11
+ * @returns 当前日期的格式化字符串
12
+ */
13
+ export declare const getNowDate: (format?: string) => string;
14
+ /**
15
+ * 将日期对象或日期字符串转换为格式化字符串
16
+ * @param date 日期对象或日期字符串
17
+ * @param format 格式化字符串,默认值为 sqliteDateFormat
18
+ * @returns 格式化后的日期字符串
19
+ */
20
+ export declare const toFormat: (date: Date | string, format?: string) => string;
21
+ /**
22
+ * 将秒转换为毫秒
23
+ * @param seconds 秒数
24
+ * @returns 毫秒数
25
+ */
26
+ export declare const convertSecondsToMs: (seconds: number) => number;
27
+ declare const time: TimeModel;
28
+ export default time;
29
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../websdk/common/utils/time.ts"],"names":[],"mappings":"AAAA,UAAU,SAAS;IACjB,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,gBAAgB,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,KAAK,MAAM,CAAA;CAC1C;AACD,eAAO,MAAM,gBAAgB,4BAA4B,CAAA;AA2BzD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,SAAQ,MAAyB,KAAG,MAE9D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,GAAG,MAAM,EAAE,SAAQ,MAAyB,KAAG,MAGjF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,KAAG,MAAwB,CAAA;AAE7E,QAAA,MAAM,IAAI,EAAE,SAKX,CAAA;AAED,eAAe,IAAI,CAAA"}
@@ -0,0 +1,24 @@
1
+ export declare class bms_0x11_100 {
2
+ /**
3
+ * 提取指定位置的字节并设置到 JSON 结果中
4
+ */
5
+ private setData;
6
+ /**
7
+ * 实时状态数据解析主方法
8
+ * @param mgs 输入数据(Uint8Array)
9
+ * @param register 寄存器
10
+ */
11
+ analysisBytes(mgs: Uint8Array | null, register: Uint8Array | null): Record<string, any>;
12
+ /**
13
+ * 对外暴露的解析方法(16进制字符串入参)
14
+ * @param msgHexData 日志16进制字符串
15
+ * @param registerHexData 寄存器16进制字符串
16
+ */
17
+ analysis(msgHexData: string, registerHexData: string | null): Record<string, any>;
18
+ /**
19
+ * 主函数(测试入口)
20
+ */
21
+ static test(): void;
22
+ static getAnalysisCode(): string;
23
+ }
24
+ //# sourceMappingURL=bms_0x11_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x11_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x11_1.0.0.ts"],"names":[],"mappings":"AA2aA,qBAAa,YAAY;IAErB;;OAEG;IACH,OAAO,CAAC,OAAO;IAgBf;;;;OAIG;IACI,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAgT9F;;;;OAIG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMxF;;OAEG;WACW,IAAI,IAAI,IAAI;WAOZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,20 @@
1
+ export declare class bms_0x13_100 {
2
+ /**
3
+ * 核心解析方法(字节数组入参)
4
+ * @param msg 日志数据字节数组
5
+ * @param register 寄存器字节数组
6
+ */
7
+ private analysisBytes;
8
+ /**
9
+ * 对外暴露的解析方法(16进制字符串入参)
10
+ * @param msgHexData 日志16进制字符串
11
+ * @param registerHexData 寄存器16进制字符串
12
+ */
13
+ analysis(msgHexData: string, registerHexData: string | null): Record<string, any>;
14
+ /**
15
+ * 主函数(测试入口)
16
+ */
17
+ static test(): void;
18
+ static getAnalysisCode(): string;
19
+ }
20
+ //# sourceMappingURL=bms_0x13_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x13_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x13_1.0.0.ts"],"names":[],"mappings":"AAoMA,qBAAa,YAAY;IAErB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAkGrB;;;;OAIG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMxF;;OAEG;WACW,IAAI,IAAI,IAAI;WAWZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,22 @@
1
+ export declare class bms_0x14_100 {
2
+ /**
3
+ * 字节数组解析入口
4
+ * @param msg 消息字节数组
5
+ * @param register 寄存器字节数组
6
+ * @returns 解析结果JSON对象
7
+ */
8
+ private analysisBytes;
9
+ /**
10
+ * 对外暴露的解析方法
11
+ * @param msgHexData 消息的16进制字符串
12
+ * @param registerHexData 寄存器的16进制字符串
13
+ * @returns 解析结果JSON对象
14
+ */
15
+ analysis(msgHexData: string, registerHexData: string): Record<string, any>;
16
+ /**
17
+ * 主函数(测试入口)
18
+ */
19
+ static test(): void;
20
+ static getAnalysisCode(): string;
21
+ }
22
+ //# sourceMappingURL=bms_0x14_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x14_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x14_1.0.0.ts"],"names":[],"mappings":"AAuCA,qBAAa,YAAY;IAErB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IA+DrB;;;;;OAKG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMjF;;OAEG;WACW,IAAI,IAAI,IAAI;WAOZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,35 @@
1
+ interface _0X51RegisterItem {
2
+ code: Uint8Array;
3
+ name: string;
4
+ desc: string;
5
+ }
6
+ export declare const _0X51RegisterEnum: {
7
+ _0X3800: {
8
+ code: Uint8Array<ArrayBuffer>;
9
+ name: string;
10
+ desc: string;
11
+ };
12
+ getEnum(code: Uint8Array | null): _0X51RegisterItem | null;
13
+ uint8ArrayEquals(a: Uint8Array, b: Uint8Array): boolean;
14
+ };
15
+ export declare class bms_0x61_100 {
16
+ /**
17
+ * 解析从机信息(context 改为 Uint8Array)
18
+ */
19
+ private analysisSlaveInfo;
20
+ /**
21
+ * 字符串入参的解析入口(对外接口,内部转为 Uint8Array)
22
+ */
23
+ analysis(msgHexData: string, registerHexData: string): Record<string, any>;
24
+ /**
25
+ * 字节数组入参的核心解析逻辑(参数改为 Uint8Array)
26
+ */
27
+ private analysisBytes;
28
+ /**
29
+ * 主函数(测试入口)
30
+ */
31
+ static test(): void;
32
+ static getAnalysisCode(): string;
33
+ }
34
+ export {};
35
+ //# sourceMappingURL=bms_0x61_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x61_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x61_1.0.0.ts"],"names":[],"mappings":"AAmBA,UAAU,iBAAiB;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AA8GD,eAAO,MAAM,iBAAiB;;;;;;kBAIZ,UAAU,GAAG,IAAI,GAAG,iBAAiB,GAAG,IAAI;wBAqBtC,UAAU,KAAK,UAAU,GAAG,OAAO;CAO1D,CAAC;AAGF,qBAAa,YAAY;IAErB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgDzB;;OAEG;IACI,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMjF;;OAEG;IACH,OAAO,CAAC,aAAa;IAqCrB;;OAEG;WACW,IAAI,IAAI,IAAI;WAOZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,16 @@
1
+ export declare class bms_0x63_100 {
2
+ /** 解析字符类型字段(对应 Java rangeChar) */
3
+ private rangeChar;
4
+ /** 解析升级状态U8类型字段(对应 Java rangeUpgradeU8) */
5
+ private rangeUpgradeU8;
6
+ /** 解析DTU属性上报数据(对应 Java storeReportMess) */
7
+ private storeReportMess;
8
+ /** 对外暴露的解析入口(字符串入参) */
9
+ analysis(msgHexData: string, registerHexData: string): Record<string, any>;
10
+ /** 核心解析逻辑(Uint8Array入参) */
11
+ private analysisBytes;
12
+ /** 主函数(测试入口) */
13
+ static test(): void;
14
+ static getAnalysisCode(): string;
15
+ }
16
+ //# sourceMappingURL=bms_0x63_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x63_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x63_1.0.0.ts"],"names":[],"mappings":"AA6MA,qBAAa,YAAY;IAErB,kCAAkC;IAClC,OAAO,CAAC,SAAS;IAkBjB,2CAA2C;IAC3C,OAAO,CAAC,cAAc;IAKtB,2CAA2C;IAC3C,OAAO,CAAC,eAAe;IA4CvB,uBAAuB;IAChB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMjF,2BAA2B;IAC3B,OAAO,CAAC,aAAa;IA8DrB,gBAAgB;WACF,IAAI,IAAI,IAAI;WAWZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,22 @@
1
+ export declare class bms_0x80_100 {
2
+ /**
3
+ * 解析入口,处理 hex 字符串为 Uint8Array
4
+ * @param msgHexData 消息 Hex 字符串
5
+ * @param registerHexData 寄存器 Hex 字符串
6
+ */
7
+ analysis(msgHexData: string, registerHexData: string): Record<string, any>;
8
+ /**
9
+ * 解析字节数组,处理不同的 registerCode 进行解析
10
+ * @param msg 消息的字节数组
11
+ * @param register 寄存器的字节数组
12
+ */
13
+ private analysisBytes;
14
+ /**
15
+ * 字节数组按每两位切分
16
+ * @param src 字节数组
17
+ */
18
+ private splitPairs;
19
+ static test(): void;
20
+ static getAnalysisCode(): string;
21
+ }
22
+ //# sourceMappingURL=bms_0x80_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_0x80_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_0x80_1.0.0.ts"],"names":[],"mappings":"AAwDA,qBAAa,YAAY;IACrB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM1E;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAwCrB;;;OAGG;IACH,OAAO,CAAC,UAAU;WAaJ,IAAI,IAAI,IAAI;WAOZ,eAAe,IAAI,MAAM;CAG1C"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * 解析字节数组为指定类型的数值并格式化
3
+ * 包含所有数据类型的完整解析逻辑
4
+ */
5
+ export declare function getNumberVal(currentBytes: Uint8Array, dataType: string, range: number): string;
6
+ /**
7
+ * 将16进制字符串转换为字节数组
8
+ * @param hexString 带空格的16进制字符串
9
+ * @returns 字节数组
10
+ */
11
+ export declare function hexStringToByteArray(hexString: string): Uint8Array;
12
+ /**
13
+ * 从寄存器字节数组获取地址
14
+ * @param register 寄存器字节数组
15
+ * @returns 地址数值
16
+ */
17
+ export declare function getAddress(register: Uint8Array | null): number;
18
+ /**
19
+ * 数据修改为 1.13.4.2.45 的格式
20
+ * @param antData 原始数据
21
+ * @param startPos 起始位置
22
+ * @param dataLen 长度
23
+ * @return 规定格式的字符串
24
+ */
25
+ export declare function getDataPoint(antData: Uint8Array, startPos: number, dataLen: number): string;
26
+ /**
27
+ * bytes 转16进制字符串
28
+ * @param bytes 数据内容
29
+ * @return 16进制字符串
30
+ */
31
+ export declare function bytesPrintHex(bytes: Uint8Array): string;
32
+ /**
33
+ * 浮点数格式化(对应 Java 的 floatFormat)
34
+ * @param value 原始数值
35
+ * @param range 精度范围(除以 range 得到格式化结果)
36
+ */
37
+ export declare function floatFormat(value: number, range: number): string;
38
+ /**
39
+ * 时间格式化(对应 Java 的 formatDateTime)
40
+ * @param time 原始时间(秒数)
41
+ */
42
+ export declare function formatDateTime(time: number): string;
43
+ export declare function isVersion(str: string | undefined): boolean;
44
+ /**
45
+ * 兼容的UTF-8解码方法(当TextDecoder不可用时使用)
46
+ * @param bytes 字节数组
47
+ * @returns 解码后的字符串
48
+ */
49
+ export declare function decodeUtf8(bytes: Uint8Array): string;
50
+ //# sourceMappingURL=bms_common_1.0.0.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bms_common_1.0.0.d.ts","sourceRoot":"","sources":["../../websdk/custom_analyze/bms_common_1.0.0.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CACxB,YAAY,EAAE,UAAU,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACd,MAAM,CAgHR;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAclE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI,GAAG,MAAM,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAU3F;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAUvD;AAGD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI1D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAoEpD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * WebSDK 主入口文件
3
+ */
4
+ export { default as BMSProtocol } from "./protocol/BMSProtocol";
5
+ export { default as ChargerProtocol } from "./protocol/ChargerProtocol";
6
+ export { default as DisplayerProtocol } from "./protocol/DisplayerProtocol";
7
+ export { default as PowerProtocol } from "./protocol/PowerProtocol";
8
+ export { SdkConfig, default as sdkConfig } from "./common/config/index";
9
+ export { default as ProtocolBasic } from "./protocol/common/ProtocolBasic";
10
+ export type { default as ProtocolInterface } from "./protocol/common/ProtocolInterface";
11
+ export * from "./common/utils/logPlugins";
12
+ export * from "./common/utils/UuidUtil";
13
+ export * from "./common/utils/time";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../websdk/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,EAAE,SAAS,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC3E,YAAY,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAGxF,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}