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

Error Running Example dis_sender.py #60

Open
SciamingSim opened this issue Jun 6, 2024 · 1 comment
Open

Error Running Example dis_sender.py #60

SciamingSim opened this issue Jun 6, 2024 · 1 comment
Labels

Comments

@SciamingSim
Copy link

I have downloaded and installed the latest version of the library. However, when I run the example provided in <open-dis/open-dis-python/examples/dis_sender.py>, I encounter the following error:

File "C:\Users\User\Desktop\open-dis-python-master\open-dis-python-master\examples\dis_sender.py", line 57, in <module> send()
File "C:\Users\user\Desktop\open-dis-python-master\open-dis-python-master\examples\dis_sender.py", line 49, in send pdu.serialize(outputStream)
File "C:\Programmi\anaconda3\envs\myenv\lib\site-packages\opendis\dis7.py", line 5323, in serialize super(EntityStatePdu, self).serialize(outputStream)
File "C:\Programmi\anaconda3\envs\myenv\lib\site-packages\opendis\dis7.py", line 4204, in serialize super(EntityInformationFamilyPdu, self).serialize(outputStream)
File "C:\Programmi\anaconda3\envs\myenv\lib\site-packages\opendis\dis7.py", line 4181, in serialize outputStream.write_unsigned_byte(self.pduStatus)
File "C:\Programmi\anaconda3\envs\myenv\lib\site-packages\opendis\DataOutputStream.py", line 22, in write_unsigned_byte self.stream.write(struct.pack('B', val))
struct.error: required argument is not an integer
@jppsmc2
Copy link

jppsmc2 commented Jun 6, 2024

Hi SciamingSim,
Fix the script dis_sender.py by adding the following codes between line 24 and 25
pdu.pduType = 1
pdu.pduStatus = 0
pdu.entityAppearance=0
pdu.capabilities=0
NB: This is merely a stopgap solution, or a workaround. The crux of the issue actually resides in the default values within the code, which are utilized when the serialize method is executed.

@leif81 leif81 added the bug label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants