-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Log facilities #690
base: master
Are you sure you want to change the base?
Log facilities #690
Conversation
so log facilities can now differenciate the origin of a message
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
any way to get the license agreement without google docs? For me, google docs is blocked on company policy. |
I think @stephane could export a PDF version of the Google form which you can then fill, sign and send back via email... On the other hand, does your company policy disallows you to sign this form with a personal/private browser/internet connection? |
## Synopsis | ||
|
||
```c | ||
void modbus_set_error_user_data(modbus_t *ctx, void* out_user_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these really void* or should they explicitly be FILE * pointers? The names and the examples and the descriptions don't really line up well here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is form the original PR. This also was the "usual" way to pass arbitrary data for callback when I last did "C", so I didn't change it.
|
||
## Example | ||
|
||
```c++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a C library, I think a plain boring C example is more suitable. C++ as well, sure, ifyou think it's important, but I don't think the only example should be c++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's copy/paste from my application code. Don't have a C example at hand.
## Synopsis | ||
|
||
```c | ||
typedef int (*modbus_stream_handler_t)(void *user, const char *format, va_list ap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to document the return type, at least. Again, void *user
vs FILE *
is... muddy here. I know you want void * user
for when you have a custom handler, and FILE*
magically working when you just set the "user data" without registering a custom handler, but this is... very unclear to people not well versed in these things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses printf return type / values. I don't know how to document the void pointer stuff properly, this is a concept you have to understand in order to not make errors...
MODBUS_API int modbus_trace(modbus_t *ctx, const char* format, ...); | ||
MODBUS_API int modbus_vtrace(modbus_t *ctx, const char* format, va_list ap); | ||
MODBUS_API int modbus_trace_error(modbus_t *ctx, const char* format, ...); | ||
MODBUS_API int modbus_vtrace_error(modbus_t *ctx, const char* format, va_list ap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these last 4 really part of the api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are form the original PR. I have no idea where else to put them / how to make them private. There is no harm if you call them.
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
fa74890
to
acacb7d
Compare
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
fixes double-free crash in unit-test server/client
We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please fill https://forms.gle/5635zjphDo5JEJQSA to get added. Your document will be manually checked by the maintainer. Be patient... |
I've had a look at the license agreement.
|
this updates PR #371 to the current stack version and adds the ability to set callback and file output per libmodbus instance (ctx)