SofwareSerial as a private member of my class

Hi.
i have been looking for a solution on this for some days now, but with no success.

The code is attached.
I have a class, Communications, to handle communications on RS485.
I am using SoftwareSerial as a private attribute of my class.
I have a USB converter to sniff the line. (A and B).

The problem:
Evey time i send some bytes to serialport i get a bunch of zeroes.
If i take the SoftwareSerial from inside my class, and declare it an *.ino file, it works.

The ideia of getting the SoftwareSerial inside my class, is to make an abstraction of communications.

What is wrong here?
Why am i getting zeroes, when the SoftwareSerial is declared within my class?

The full code is in attachment.

HEEEEELP. i am getting nuts.

*the arduino is Leonardo ETH

Master.zip (7.33 KB)

I haven't look at the code because I'm not a fan of downloading random .zip files. If your code is smaller than 9KB, post it inline here using code tags.

Generally speaking, I don't think it's a good idea to encapsulate a SW Serial object in your class. Doing so limits flexibility. Rather, use polymorphism (one of the pillars of OOP). Pass your class a pointer to a Stream object in its constructor or a begin() method. Save that pointer into a private class member variable and do all class I/O through it.

Doing it this way allows you to set up any Stream object (SW Serial, HW Serial, whatever) in your main code and have your custom class use it without knowing the difference.

I understand, but my main code, doesn't need to know the implementation used to communicate.

The code is on zip file, because there are many separated files, and not only one class/file

C4m4l340:
I understand, but my main code, doesn't need to know the implementation used to communicate.

Well, it need to be known somewhere. To me it make sense for that "somewhere" to be the main code. That way, the class is agnostic to the actual Stream and can be used in other cases where using a different Stream is preferred.