On Wed, Apr 18, 2018 at 11:48 AM, Linus Torvalds
<[email protected]> wrote:
> On Wed, Apr 18, 2018 at 12:55 AM, Sébastien Dugué
> <[email protected]> wrote:
>>
>> That's really cool! I'll try that out tonight (CET) with my Uwatec DCs
>> just to
>> check IRDA is still functional.
>
> I'm pretty sure I broke IRDA. It should be easy to fix.
This attached patch to subsurface may get IRDA working again..
Sébastien, if you can test this, and I'll commit it to my branch. I
can only test that it builds for me.
Linus
core/libdivecomputer.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 247051dad..c547a85b2 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -17,6 +17,8 @@
#include <libdivecomputer/version.h>
#include <libdivecomputer/usbhid.h>
#include <libdivecomputer/serial.h>
+#include <libdivecomputer/irda.h>
+
#include "libdivecomputer.h"
#include "core/version.h"
@@ -1122,6 +1124,27 @@ dc_status_t divecomputer_device_open(device_data_t *data)
#endif
}
+ if (transports & DC_TRANSPORT_IRDA) {
+ unsigned int address = 0;
+
+ dc_iterator_t *iterator = NULL;
+ dc_irda_device_t *device = NULL;
+ dc_irda_iterator_new (&iterator, context, descriptor);
+ while (dc_iterator_next (iterator, &device) == DC_STATUS_SUCCESS) {
+ address = dc_irda_device_get_address (device);
+ dc_irda_device_free (device);
+ break;
+ }
+ dc_iterator_free (iterator);
+
+ if (!address)
+ address = strtoul(data->devname, NULL, 0);
+
+ rc = dc_irda_open(&data->iostream, context, address, 1);
+ if (rc == DC_STATUS_SUCCESS)
+ return rc;
+ }
+
return DC_STATUS_UNSUPPORTED;
}
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface