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

0.22.22 XCP, when I run your Test_master.py, error is :AttributeError: 'dict' object has no attribute 'general' #200

Open
XuHaobang opened this issue Jan 14, 2025 · 3 comments

Comments

@XuHaobang
Copy link

No description provided.

@XuHaobang XuHaobang changed the title 0.22.22 XCP, when I 0.22.22 XCP, when I run your Test_master.py, error is :AttributeError: 'dict' object has no attribute 'general' Jan 14, 2025
@XuHaobang
Copy link
Author

image
import struct
import time
from collections import deque
from unittest import mock
from pyxcp.master import Master

from pyxcp.transport.candriver.pc_vector import Vector

from pyxcp.transport.candriver.pc_pcan import PCan

DefaultConnectResponse = "FF 3D C0 FF DC 05 01 01"

with Master("can", config={"transport": "CAN","RECEIVE_OWN_MESSAGES" : True,"RX_QUEUE_SIZE" :16384,"BITRATE" : 500000, "PADDING_VALUE":0xAA,"CAN_USE_DEFAULT_LISTENER":True,"CAN_DRIVER": "Vector","CHANNEL": "0","MAX_DLC_REQUIRED": True,"CAN_ID_MASTER":0x581,"CAN_ID_SLAVE":0x580,
"FD" :True,"DATA_BITRATE": 2000000,"sjw_abr":8,"tseg1_abr" :31,"tseg2_abr" : 8,"sam_abr" : 1,"sjw_dbr" : 8,"tseg1_dbr": 31,"tseg2_dbr" : 8,"LOGLEVEL" :"DEBUG"}) as xm:
mock_caninterface = xm.transport.can_interface
mock_caninterface.push_packet(DefaultConnectResponse)
res = xm.connect()
xm.setMta(0x70b632, 0x00)
Value= xm.shortUpload(1, 0x70b632, 0x00)
time.sleep(10)
print(Value)

@christoph2
Copy link
Owner

Yes, the test cases are not up-to-date

@XuHaobang
Copy link
Author

Yes, the test cases are not up-to-date

I want to use your latest library, because after the previous library is packaged as exe, some modules will lose their paths and become unusable. The current version of 0.22.22 software, can you give me a usage example of Test_master.py? Thanks a million

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

No branches or pull requests

2 participants