Skip to content

Conversation

@Apollon77
Copy link
Contributor

Hi,

this PR is not really for "accepting" but to start a feedback/discussion/enhancement round :-)
I hope this is ok.

While working on my nodejs native module for libmbus (https://github.com/Apollon77/node-mbus) I also started liiking into windows build capability and I managed to get it build on windows (currently the lib only, but adding the executables should be no big deal if someone knows how :-))

I did the following (and those are the changes in this PR):

  • content of my PR WIP: Add json methods to library #132 is in too (so mainly timestamp and build/config changes)
  • added appveyor testing for build (result see: https://ci.appveyor.com/project/Apollon77/libmbus)
  • added very basic (and to be honest from node-gyp creates-stripped-down) vcxproj file to build library. SO here is work to be done by ideally someone with MSVC knowledge
  • defined PRETTY_FUNCTION in all files when Windows build
  • main changes in mbus-serial and mbus-tcp mostly in includes at the beginning
  • especially for serial stuff I added a compat layer for termios.h (termiWin), found https://github.com/ChristianVisintin/termiWin which helped a lot. Alternative would be an own "mbus-erial-windows" :-)
  • during real tests and also from other repos adjusted default timeout settings for serial because some real-life devices need time to respond
  • smaller logging enhancements that were useful during debug/development

With these changes I was able to work with Serial and TCP on Windows too and I use this branch in my nodejs native module already.

It would be great to get feedback from you on this ... Especially about what your opinion if for Win support and such :-)

Ingo

This reverts commit 68dfbba.
# Do not touch the line above.
# Everything below will be removed.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch build-windows
# Your branch is up-to-date with 'origin/build-windows'.
#
# Changes to be committed:
#
# 	modified:   mbus/mbus-serial.c
# 	modified:   mbus/mbus-tcp.c
Apollon77 and others added 26 commits August 5, 2020 09:59
# Conflicts:
#	.travis.yml
#	mbus/mbus-protocol-aux.h
#	test/generate-xml.sh
# Conflicts:
#	.travis.yml
This hack makes mbus_data_record_decode print errors still as hex, but
allow negative BCD values for the rest.

(cherry picked from commit 48d25a8)
(cherry picked from commit f775d19)
* Rewritten TCP connection to support IPv6 and get rid of deprecated gethostbyname

Signed-off-by: Petr Kracík <[email protected]>

(cherry picked from commit cb28aca)
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.