Skip to content
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

Patch 2 #194

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Patch 2 #194

wants to merge 3 commits into from

Conversation

bernatalbet
Copy link

Description

I created a class which inherits and extends the current functionality, so that now I can do this:

void preTransmission() override {
    digitalWrite(mEnablePin, HIGH); // Enable Modbus communication
}
void postTransmission() override {
    digitalWrite(mEnablePin, LOW); // Disable Modbus communication
}

Where "mEnablePin" is passed as part of the constructor.

In the current implementation, I tried to implement a solution to use different Enable pins in different instantiated objects, but then I must set static functions externally to the class.

Issues Resolved

With this modification, I now can encapsulate the functionality to my inherited class.

I created a class which inherits and extends the current functionality, so that now I can do this:

    void preTransmission() override {
        digitalWrite(mEnablePin, HIGH); // Enable Modbus communication
    }
    void postTransmission() override {
        digitalWrite(mEnablePin, LOW); // Disable Modbus communication
    }

Where "mEnablePin" is passed as part of the constructor.

In the current implementation, I tried to implement a solution to use different Enable pins in different instantiated objects, but then I must set static functions externally to the class, so I can't encapsulate the functionality to my inherited class.
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.

1 participant