shell: mqtt: Avoid using POSIX function names

This commit fixes this error seen in CI so that things
work even if CONFIG_POSIX_API is enabled.

subsys/shell/backends/shell_mqtt.c:727:12: error:
  conflicting types for 'write'; have
 'int(const struct shell_transport *, const void *, size_t,  size_t *)'
  727 | static int write(const struct shell_transport *transport,
                         const void *data, size_t length)

include/zephyr/posix/unistd.h:230:9: note: previous declaration
 of 'write' with type
 'ssize_t(int,  const void *, size_t)'
  230 | ssize_t write(int file, const void *buffer, size_t count);

subsys/shell/backends/shell_mqtt.c:787:12: error:
 conflicting types for 'read'; have
 'int(const struct shell_transport *, void *, size_t,  size_t *)'
  787 | static int read(const struct shell_transport *transport,
                        void *data, size_t length, size_t *cnt)

include/zephyr/posix/unistd.h:231:9: note: previous declaration
 of 'read' with type
 'ssize_t(int,  void *, size_t)'
  231 | ssize_t read(int file, void *buffer, size_t count);

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Jukka Rissanen 2024-03-08 15:27:18 +02:00 committed by David Leach
parent b4bf23220d
commit e158c1729a

View file

@ -724,8 +724,8 @@ static int enable(const struct shell_transport *transport, bool blocking)
return 0;
}
static int write(const struct shell_transport *transport, const void *data, size_t length,
size_t *cnt)
static int write_data(const struct shell_transport *transport, const void *data, size_t length,
size_t *cnt)
{
ARG_UNUSED(transport);
int rc = 0;
@ -784,7 +784,8 @@ out:
return rc;
}
static int read(const struct shell_transport *transport, void *data, size_t length, size_t *cnt)
static int read_data(const struct shell_transport *transport, void *data, size_t length,
size_t *cnt)
{
ARG_UNUSED(transport);
@ -812,8 +813,8 @@ static int read(const struct shell_transport *transport, void *data, size_t leng
const struct shell_transport_api shell_mqtt_transport_api = { .init = init,
.uninit = uninit,
.enable = enable,
.write = write,
.read = read };
.write = write_data,
.read = read_data };
static int enable_shell_mqtt(void)
{