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

Make the classes less private & more protected so we can extend some classes. #162

Open
genesiscz opened this issue Sep 3, 2021 · 2 comments

Comments

@genesiscz
Copy link
Contributor

genesiscz commented Sep 3, 2021

So I am in process of writing an app for Xbee-Pro S1 802.15.4, which probably has several differences between yours Xbee implementation and I need to be able to override the Initialize function from ZigBeeDongleXBee class. There are several properties such as _serialPort, _frameHandler which are not overridable/accessable which makes it really hard to extend the class & just rewrite to my own means without replicating/changing a lot of code.

Is there a possibility you could make a lot of these properties public so we can feely extend them?

Side question: Have you ever connected by TCP/IP (ser2net) instead of SerialPort?

@Mr-Markus
Copy link
Owner

Please describe a little bit more in detail which classes or fields do you need.
In general this library should be very flexible, so that extending will be possible. But because each user will need someting else not everything is there from beginning.

No, I haven't used ser2net, yet. For me it seems that it could be an own implementation of IZigBeePort

See https://github.com/Mr-Markus/ZigbeeNet/blob/develop/libraries/ZigBeeNet.Transport.SerialPort/ZigBeeSerialPort.cs

@genesiscz
Copy link
Contributor Author

genesiscz commented Sep 3, 2021

Yes, I did exactly that. Perfect.

I stepped into a different problem: I need to override the ZigBeeDongleXbee's Initialize method because I need to NOT send some packets (reset) & send more packets to set up it a little more. The _frameHandler could be public, so you can actually do some more low-level- stuff if you need to.

I literally copied the whole class because if I just extend the class & try to implement the Initialize method, it won't call the child method but the parent one (because it has no virtual keyword).

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

No branches or pull requests

2 participants