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:
parent
b4bf23220d
commit
e158c1729a
|
@ -724,8 +724,8 @@ static int enable(const struct shell_transport *transport, bool blocking)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int write(const struct shell_transport *transport, const void *data, size_t length,
|
static int write_data(const struct shell_transport *transport, const void *data, size_t length,
|
||||||
size_t *cnt)
|
size_t *cnt)
|
||||||
{
|
{
|
||||||
ARG_UNUSED(transport);
|
ARG_UNUSED(transport);
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
@ -784,7 +784,8 @@ out:
|
||||||
return rc;
|
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);
|
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,
|
const struct shell_transport_api shell_mqtt_transport_api = { .init = init,
|
||||||
.uninit = uninit,
|
.uninit = uninit,
|
||||||
.enable = enable,
|
.enable = enable,
|
||||||
.write = write,
|
.write = write_data,
|
||||||
.read = read };
|
.read = read_data };
|
||||||
|
|
||||||
static int enable_shell_mqtt(void)
|
static int enable_shell_mqtt(void)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue