Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析 ASCII.LL 到 LLLL 配置失败! #139

Open
zhtianhe opened this issue Oct 20, 2021 · 0 comments
Open

解析 ASCII.LL 到 LLLL 配置失败! #139

zhtianhe opened this issue Oct 20, 2021 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@zhtianhe
Copy link

简单测试过程如下:
1、组16进制数串

1=null
2 Fixed[22] =                 31323334353637383930313233343536373839303154  
3 LL            =3232          31323334353637383930313233343536373839303154
4 LLL          =303232      31323334353637383930313233343536373839303154
5 LLLL        =30303232  31323334353637383930313233343536373839303154

2、cat test/test-9999.bin

3030313036383030303030780000000000000031323334353637383930313233343536373839303154323231323334353637383930313233343536373839303154303232313233343536373839303132333435363738393031543030323231323334353637383930313233343536373839303154

4、cat test/test-9999.json

{
	"name": "ISO 8583 v1987 HEX",
	"fields": {
		"0": {
			"type": "String",
			"length": 11,
			"description": "报文头【N7+N4】:PKGHEAD",
			"enc": "HexToASCII",
			"prefix": "ASCII.Fixed"
		},
		"1": {
			"type": "Bitmap",
			"length": 16,
			"description": "位图【B128】:Bitmap",
			"enc": "HexToASCII",
			"prefix": "ASCII.Fixed"
		},
		"2": {
			"type": "String",
			"length": 22,
			"description": "2.Fixed:",
			"enc": "HexToASCII",
			"prefix": "ASCII.Fixed"
		},
		"3": {
			"type": "String",
			"length": 99,
			"description": "3.LL:",
			"enc": "HexToASCII",
			"prefix": "ASCII.LL"
		},
		"4": {
			"type": "String",
			"length": 999,
			"description": "4.LLL:",
			"enc": "HexToASCII",
			"prefix": "ASCII.LLL"
		},
		"5": {
			"type": "String",
			"length": 9999,
			"description": "5.LLLL:",
			"enc": "HexToASCII",
			"prefix": "ASCII.LLLL"
		}		
	}
}

5、./iso8583.exe describe -spec-file test/test-9999.json test/test-9999.bin

Failed to create message from file: unpacking message: failed to unpack field 4 (4.LLL:): failed to decode content: not enough data to read
Trying to describe file anyway...
ISO 8583 v1987 HEX Message:
MTI.......................: 00106800000
Bitmap....................: 7800000000000000
Bitmap bits...............: 01111000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
F000 报文头【N7+N4】:PKGHEAD...: 00106800000
F002 2.Fixed:.............: 123456789012345678901T
F003 3.LL:................: 2123456789012345678901T022123456
F004 4.LLL:...............:

预期结果:

ISO 8583 v1987 HEX Message:
MTI.......................: 00106800000
Bitmap....................: 7800000000000000
Bitmap bits...............: 01111000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
F000 报文头【N7+N4】:PKGHEAD...: 00106800000
F002 2.Fixed:.............: 123456789012345678901T
F003 3.LL:...................: 123456789012345678901T
F004 4.LLL:.................: 123456789012345678901T
F005 5.LLLL:...............: 123456789012345678901T
@adamdecaf adamdecaf added the bug Something isn't working label Oct 20, 2021
@adamdecaf adamdecaf added good first issue Good for newcomers help wanted Extra attention is needed labels Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants