Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions transports/libhoth_dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ static int release(struct libhoth_device* dev) {
return LIBHOTH_OK;
}

static int reconnect(struct libhoth_device* dev) {
// no-op
return LIBHOTH_OK;
}

char* with_hoth_id(const char* base, char delimiter, const char* hoth_id) {
size_t base_len = strlen(base);
size_t hoth_id_len = strlen(hoth_id);
Expand Down Expand Up @@ -242,6 +247,7 @@ int libhoth_dbus_open(const struct libhoth_dbus_device_init_options* options,
dev->close = close;
dev->claim = claim;
dev->release = release;
dev->reconnect = reconnect;
dev->user_ctx = dbus_dev;

*out = dev;
Expand Down
7 changes: 7 additions & 0 deletions transports/libhoth_mtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int libhoth_mtd_receive_response(struct libhoth_device* dev, void* response,
int timeout_ms);

int libhoth_mtd_close(struct libhoth_device* dev);
int libhoth_mtd_reconnect(struct libhoth_device* dev);

static int mtd_read(int fd, unsigned int address, void* data, size_t data_len) {
if (fd < 0 || !data) {
Expand Down Expand Up @@ -191,6 +192,7 @@ int libhoth_mtd_open(const struct libhoth_mtd_device_init_options* options,
dev->close = libhoth_mtd_close;
dev->claim = libhoth_mtd_claim;
dev->release = libhoth_mtd_release;
dev->reconnect = libhoth_mtd_reconnect;
dev->user_ctx = mtd_dev;

*out = dev;
Expand Down Expand Up @@ -280,3 +282,8 @@ int libhoth_mtd_close(struct libhoth_device* dev) {
free(dev->user_ctx);
return LIBHOTH_OK;
}

int libhoth_mtd_reconnect(struct libhoth_device* dev) {
// no-op
return LIBHOTH_OK;
}
4 changes: 2 additions & 2 deletions transports/libhoth_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ static int libhoth_spi_release(struct libhoth_device* dev) {
}

static int libhoth_spi_reconnect(struct libhoth_device* dev) {
// TODO: A correct implementation
usleep(1000 * 1000);
// TODO: Maybe check for JEDEC ID?
// no-op
return 0;
}

Expand Down
Loading