espressif / esp-modbus

ESP-Modbus - the officially suppported library for Modbus protocol (serial RS485 + TCP over WiFi or Ethernet).
Apache License 2.0
117 stars 55 forks source link

strange behaviour when you disable ASCII serial support (IDFGH-13866) #77

Open AtomBalmBaby opened 1 month ago

AtomBalmBaby commented 1 month ago

Checklist

How often does this bug occurs?

always

Expected behavior

with modbus ASCII support disabled in the Configuration editor, I expect a simple modbus implemention ( modbus rtu slave example project) to compile without error

Actual behavior (suspected bug)

if i disable ascii mode (which I don't want or need for my application) I cannot compile cleanly.

enabling ascii support causes the issue to go away, and I can get things to compile. seems like an issue with the library configuration cmake stuff to me.

Error logs or terminal output

/mnt/NAS1/DEVEL/Crypto/firefly/managed_components/espressif__esp-modbus/modbus/mb_objects/mb_slave.c: In function 'mbs_ascii_create':
/mnt/NAS1/DEVEL/Crypto/firefly/managed_components/espressif__esp-modbus/modbus/mb_objects/mb_slave.c:148:11: error: implicit declaration of function 'mbs_ascii_transp_create'; did you mean 'mbs_tcp_transp_create'? [-Werror=implicit-function-declaration]
  148 |     ret = mbs_ascii_transp_create(ser_opts, (void **)&transp_obj);
      |           ^~~~~~~~~~~~~~~~~~~~~~~
      |           mbs_tcp_transp_create
/mnt/NAS1/DEVEL/Crypto/firefly/managed_components/espressif__esp-modbus/modbus/mb_objects/mb_slave.c:164:9: error: implicit declaration of function 'mbs_ascii_transp_delete'; did you mean 'mbs_tcp_transp_delete'? [-Werror=implicit-function-declaration]
  164 |         mbs_ascii_transp_delete(transp_obj);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         mbs_tcp_transp_delete

Steps to reproduce the behavior

configure modbus module parameters and then try to build

Project release version

2.0.0 beta

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Fedora 40

Shell

Bash

Additional context

No response

alisitsyn commented 4 weeks ago

@AtomBalmBaby ,

Thank you for reporting. This will be fixed. This will be added to plan and I will let you know once merged.