Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Howdy,

I'm currently trying to implement MS/TP for linux, the issue I'm running into is the use of src/bacnet/datalink/dlmstp.h & ports/linux/dlmstp_linux.h. Both have a related C file in the ports/linux directory. If dlmstp.c is uncommented in the target source in the CMakeList.txt or dlmstp.h is added to dlmstp_linux.c, there is a multiple definition clash. My question is, is dlmstp_linux.h\c required? My Erlang NIF for setting the baud rate uses dlmstp_linux automatically when no changes have been made, however this function requires an additional parameter:
void dlmstp_set_baud_rate(void *poPort, uint32_t baud)

This is less desirable than just using the the dlmstp.h\c:
void dlmstp_set_baud_rate(uint32_t baud)

if dlmstp_linux.h\c are removed from the target_source in CMakelist.txt and the dlmstp.h\c is used instead will for example the baud rate be set?

Thanks

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

Only apps/router example uses dlmstp_linux.h\c within the library. The other example apps use dlmstp.c for MS/TP datalink.

The MS/TP baud rate for the example applications typically use environment variables - see dlenv.c module:

 * - BACDL_MSTP: (BACnet MS/TP)
 *   - BACNET_MAX_INFO_FRAMES
 *   - BACNET_MAX_MASTER
 *   - BACNET_MSTP_BAUD
 *   - BACNET_MSTP_MAC

Is there something that should be changed to better support your implementation?

You must be logged in to vote
1 reply
@dcmaverick
Comment options

dcmaverick Jun 5, 2024
Collaborator Author

thanks for the response, Would you be so kind on shedding some light on how the stack in the area of MS/TP is meant to be used/integrated? please so I can get a full understanding. My understanding after your comment suggests to me that the dlenv needs to be initialized using the BACDL_MSTP flag before the use of dlmstp.c for MS/TP datalink. Does this sound correct?

Comment options

There are a couple of ways to use BACnet MSTP in the library:
a) with a microcontroller, single datalink, BACDL_MSTP defined.
b) with the example apps running on Windows/BSD/Linux, single datalink, BACDL_MSTP defined. Note: the MS/TP datalink app must join the MS/TP network segment, which may take up to a minute , prior to accomplishing its task. Therefore, the apps/server (or gateway) are really the only appropriate apps to use in this manner.
c) BACnet/IP to MS/TP single purpose router, dual datalink - see apps/router-mstp for details.
d) general purpose BACnet router on Linux, arbitrary number of datalinks - see apps/router for details.

Note: the apps built for BACnet/IP can route through either BACnet/IP to MS/TP router...

You must be logged in to vote
1 reply
@dcmaverick
Comment options

dcmaverick Jun 11, 2024
Collaborator Author

Thanks for the help Skarg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.