Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Serial connector unstuffing behavior

Solved111 views1 day agoprotocol replace data Response unstuffing
5
Edib Šupić [SLC] [DevOps Enabler]2.53K 2 days ago 0 Comments

Hi Dojo,

I'm working on a serial connector and have some questions about unstuffing.

The protocol I'm implementing(Pro-Bel SW-P-08) defines start of message(0x10 0x02) and end of message(0x10 0x03) control characters and defines a rule for cases where 0x10 appears in the data segment. The rule is simple, if the 0x10 appears in the data segment double it.

I'm receiving the following stuffed message:
0x10 0x02  0x0B 0x00 0x03 0x10 0x10 0x03 0x00 0x06 0xD9 0x10 0x03

Original implementation:
Initially I was removing stuffing from inside of the QAction, after reading the response, which works if the 0x10 is not followed by 0x03.

First attempt:
I added advanced tag to remove stuffing from the response.

As result the stream viewer was showing expected unstuffed message:
>> 16:40:10 - Incoming raw data
000000  1002 0B 00 00 10 03 00 06 DC 1003

However, this was still failing in the matching step and the data that was being passed to the QAction was 0x0B 0x00 0x00 which means that response reading was still interpreting 0x10 0x03(in the data segment) as end of message.

My response is defined like so:

Second attempt:
I added replace data action, instead of advanced tag.

Stream Viewer:

After increasing the log levels I was left with the following log:

Here we see that data is replaced properly, however the message is still cut short on the stream viewer level, and matching fails because 0x10 0x03 no longer exists(although it does actually come in).

Third attempt:
I added advanced tag, replace data action and stuffing removal in the QAction.

The advanced tag is the same as in the 1st attempt and replace data action is as follows:

The idea here is that odd number of 0x10 bytes is not possible because of doubling rule, so if I see odd number of bytes in the QAction, I can guarantee that the only source of them is my custom stuffing so I can safely replace them with 0x10 0x02 or 0x10 0x03 in the QAction. This only works if data is actually stuffed so I have to add back the stuffing as well, thus the first replacement rule 0x10 -> 0x10 0x10

All of this seems like a very weird way to achieve a common functionality of the serial communication, something I would expect to be available out of the box.

Is there a better, more straight forward way of achieving this?

Cheers

Edib Šupić [SLC] [DevOps Enabler] Selected answer as best 1 day ago

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
3
Laurens Moutton [SLC] [DevOps Enabler]9.43K Posted 1 day ago 1 Comment

Hi,

-Using the stuffing attribute in the Advanced tag will not work with a "serial" TCP connection.

-The response will need to consist of 3 parameters:

  • Header parameter (0x10 0x02)
  • Read parameter of Interprete LengthType "last next param"
  • Fixed parameter (0x10 0x03). Important to note that this is not a "trailer" type

By not defining the trailer type, we avoid that SLPort would forward the data to SLProtocol as soon as it would find the first occurrence of 0x10 0x03. The downside is that SLPort will wait until the defined timeout time of the command before forwarding the data to SLProtocol.

Once data enters in SLProtocol, it first needs to remove the stuffing bytes. This can be done by adding a trigger that goes off before the response and executes an action on the response of type "read stuffing" and inside the Type has the attributes value="0x10" startoffset="2" endoffset="2"

Then the data can be filled in the different parameters, which is done by executing the action to read the response.

As the read parameter in the response is of type "last next param", we avoid that the data would be cut off with the first occurrence that SLProtocol would find of 0x10 0x03.

Regards,

Edib Šupić [SLC] [DevOps Enabler] Selected answer as best 1 day ago
Edib Šupić [SLC] [DevOps Enabler] commented 1 day ago

Thank you for your help Laurens. I will add another comment with conclusion on the topic for this specific case in another comment since I can't add images here. For anyone who might run in to this problem in the future make sure to read that comment as well for the full picture.
Cheers

You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin