Skip to content

Feature/optimize 02 datatypes getvalue maxstringlength - #12

Merged
jogibear9988 merged 3 commits into
dotnetprojects:masterfrom
Stiwa-PohG:feature/optimize-02-datatypes-getvalue-maxstringlength
Oct 7, 2026
Merged

jogibear9988 merged 3 commits into
dotnetprojects:masterfrom
Stiwa-PohG:feature/optimize-02-datatypes-getvalue-maxstringlength

Conversation

@Stiwa-PohG

Copy link
Copy Markdown

Contains the sources from branch feature/optimize-01

Port net functional changes from fork package 01 (DataTypes extension /
string array fix, commits 6aef271/519cdeb/ffe8daa):
- PlcTag: add virtual GetValue()/SetValue(object) reflecting the
  concrete tag's public Value property, for generic tag value access.
- POffsetInfoType: add virtual MaxStringLength(), returning 0 by
  default, UnspecifiedOffsetinfo1 for Array1Dim (string array max
  length), and Min(UnspecifiedOffsetinfo1, UnspecifiedOffsetinfo2) for
  String (fixes cases where firmware swaps both fields).

All other changes from this fork package are already superseded by the
target repo's own PlcTag/PlcTags implementation and are documented as
excluded in package 16.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Native TLS operations remain concurrently accessible, and multidimensional string arrays report an incorrect maximum length.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Adds generic PLC tag value access, string-length metadata, and synchronization around OpenSSL pending queues.

Changes:

  • Adds boxed GetValue/SetValue tag accessors.
  • Exposes maximum string lengths from offset metadata.
  • Locks pending OpenSSL buffer queues.
File Description
OpenSSLConnector.cs Synchronizes pending read/write queues.
POffsetInfoType.cs Adds maximum string-length lookup.
PlcTag.cs Adds generic boxed value accessors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +36 to +37
private readonly object m_readListLock = new object();
private readonly object m_writeListLock = new object();
Comment on lines +551 to +552
// For a string array, UnspecifiedOffsetinfo1 carries the maximum string length of the array elements.
public override int MaxStringLength() { return UnspecifiedOffsetinfo1; }
The string length is identical across all dimensions and is stored once in `UnspecifiedOffsetinfo1`.
@jogibear9988
jogibear9988 merged commit bdd9552 into dotnetprojects:master Oct 7, 2026
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

Successfully merging this pull request may close these issues.

3 participants