Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

New msg object initialize with from_json, not all data is getting updated #253

Open
vbipin opened this issue Jan 4, 2024 · 1 comment
Open

Comments

@vbipin
Copy link

vbipin commented Jan 4, 2024

When creating a new msg object and using from_json to fill the data, all of the json data is not getting updated. Is there an easy way to solve this.
I am using the pycrate 0.7 and python 3.11

  1. Create a sample json text to use.
pdu = unhexlify( '074300035200c2' ) # EMM Attach Complete
m, e = parse_NAS_MT(pdu)
att_complete_json = m.to_json()
print( att_complete_json )
  1. I want to create a new message with this json
new_msg = EMMAttachComplete()
new_msg.from_json( att_complete_json )
print( new_msg.to_json() )

The new_msg json is different and also the new_msg.to_bytes()

print ( hexlify( new_msg.to_bytes() ))
"07430003000000" this is different from the starting pdu.

@mitshell
Copy link
Contributor

mitshell commented Mar 1, 2024

Thanks for bringing this issue.
A new pycrate repository has been setup, including new fixes. This repo will keep being maintained : https://github.com/pycrate-org/pycrate.
Please checkout the latest 0.7.1 version which provides extended JSON support for mobile NAS messages, what should fix your case (I hope).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants