-
Notifications
You must be signed in to change notification settings - Fork 57
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
GetBuffer(byte[] buffer) Not working #421
Comments
The underlying core DLL will not copy more data than is in the tag's internal buffer. |
Yes good find.
Looks like I messed this up during the big changes in #407.
It should be as it was after #394 was merged
…On Wed, 9 Oct 2024, 2:14 pm David Malenke, ***@***.***> wrote:
Seems like the function here:
https://github.com/libplctag/libplctag.NET/blob/a4ebff5ba60946e1af0fc53e6f30f269a3d973a3/src/libplctag/Tag.cs#L907-L916
does not fill the provided buffer.
It just reads the bytes into a temp buffer.
Line 914 can be updated to:
var result = (Status)_native.plc_tag_get_raw_bytes(nativeTagHandle, offset, buffer, length);
Maybe add a check to prevent reading more than the tag's size if a buffer
larger than the tag is passed in?
—
Reply to this email directly, view it on GitHub
<#421>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESB44YWWXE4BRUX5XFTQ5LZ2SNQHAVCNFSM6AAAAABPTRRBX2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGU3TINRSGI4DQOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@dnmalenke - should be fixed with in main branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seems like the function here:
libplctag.NET/src/libplctag/Tag.cs
Lines 907 to 916 in a4ebff5
does not fill the provided buffer.
It just reads the bytes into a temp buffer.
Line 914 can be updated to:
Maybe add a check to prevent reading more than the tag's size if a buffer larger than the tag is passed in?
The text was updated successfully, but these errors were encountered: