d/opengloves: Communication api change

This commit is contained in:
Daniel Willmott 2022-09-08 23:41:40 +01:00 committed by Moses Turner
parent 0bed585018
commit 74f14f2414
3 changed files with 4 additions and 6 deletions

View file

@ -41,7 +41,7 @@ opengloves_bt_read(struct opengloves_communication_device *ocdev, char *data, si
} }
static int static int
opengloves_bt_write(struct opengloves_communication_device *ocdev, const uint8_t *data, size_t length) opengloves_bt_write(struct opengloves_communication_device *ocdev, const char *data, size_t length)
{ {
struct opengloves_bt_device *obdev = (struct opengloves_bt_device *)ocdev; struct opengloves_bt_device *obdev = (struct opengloves_bt_device *)ocdev;

View file

@ -26,7 +26,7 @@ struct opengloves_communication_device
{ {
int (*read)(struct opengloves_communication_device *comm_dev, char *data, size_t size); int (*read)(struct opengloves_communication_device *comm_dev, char *data, size_t size);
int (*write)(struct opengloves_communication_device *comm_dev, const uint8_t *data, size_t size); int (*write)(struct opengloves_communication_device *comm_dev, const char *data, size_t size);
void (*destroy)(struct opengloves_communication_device *comm_dev); void (*destroy)(struct opengloves_communication_device *comm_dev);
}; };
@ -38,9 +38,7 @@ opengloves_communication_device_read(struct opengloves_communication_device *com
} }
static inline int static inline int
opengloves_communication_device_write(struct opengloves_communication_device *comm_dev, opengloves_communication_device_write(struct opengloves_communication_device *comm_dev, const char *data, size_t size)
const uint8_t *data,
size_t size)
{ {
return comm_dev->write(comm_dev, data, size); return comm_dev->write(comm_dev, data, size);
} }

View file

@ -31,7 +31,7 @@ opengloves_serial_read(struct opengloves_communication_device *ocdev, char *data
} }
static int static int
opengloves_serial_write(struct opengloves_communication_device *ocdev, const uint8_t *data, size_t length) opengloves_serial_write(struct opengloves_communication_device *ocdev, const char *data, size_t length)
{ {
struct opengloves_serial_device *osdev = (struct opengloves_serial_device *)ocdev; struct opengloves_serial_device *osdev = (struct opengloves_serial_device *)ocdev;