Skip to content
Discussion options

You must be logged in to vote

Never mind, I'm a idiot.
I give the buffer that I use to store data to check_as_completion, hence my result get overwritten.
So I give it another buffer then I print the buffer2 and its return value :

...
db_number = 4
start = 0
size = 14
buffer = ctypes.c_buffer(size,size)
buffer2 = ctypes.c_buffer(2,2)
as_read = client.as_db_read(db_number, start, size, buffer)

for i in range(15):
    print(client.check_as_completion(buffer2))
    print(bytearray(buffer2))
time.sleep(1)

data = client.db_read(db_number, start, size)
for i, i2 in zip(bytearray(data),bytearray(buffer)):
    print(i,"---",i2)


Now I got the correct result, but since the buffer2 doesn't change what it is used for ? Am I…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by luewh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #423 on March 01, 2023 17:37.