View | Details | Raw Unified | Return to bug 179331
Collapse All | Expand All

(-)libcec/Makefile (-2 / +2 lines)
Lines 2-8 Link Here
2
# $FreeBSD: multimedia/libcec/Makefile 316355 2013-04-23 14:20:25Z bapt $
2
# $FreeBSD: multimedia/libcec/Makefile 316355 2013-04-23 14:20:25Z bapt $
3
3
4
PORTNAME=	libcec
4
PORTNAME=	libcec
5
PORTVERSION=	2.0.4
5
PORTVERSION=	2.1.3
6
CATEGORIES=	multimedia
6
CATEGORIES=	multimedia
7
7
8
MAINTAINER=	manuel.creach@icloud.com
8
MAINTAINER=	manuel.creach@icloud.com
Lines 13-19 Link Here
13
13
14
USE_GITHUB=	yes
14
USE_GITHUB=	yes
15
GH_ACCOUNT=	Pulse-Eight
15
GH_ACCOUNT=	Pulse-Eight
16
GH_COMMIT=	178d498
16
GH_COMMIT=	54be21e
17
GH_TAGNAME=	${PORTNAME}-${PORTVERSION}
17
GH_TAGNAME=	${PORTNAME}-${PORTVERSION}
18
18
19
USES=		pkgconfig
19
USES=		pkgconfig
(-)libcec/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (libcec-2.0.4.tar.gz) = 652f8bddf8629eb4d14c93bc97efbeb7406482f69626302c8489df8e1fd8431f
1
SHA256 (libcec-2.1.3.tar.gz) = 2aa88451b528184b02077ee8c6cd10e2f89121a6a05b1b35b4b792b03108a9d1
2
SIZE (libcec-2.0.4.tar.gz) = 1075334
2
SIZE (libcec-2.1.3.tar.gz) = 1087121
(-)libcec/files/patch-src__lib__adapter__Pulse-Eight__USBCECAdapterDetection.cpp (-9 / +91 lines)
Lines 1-11 Link Here
1
--- ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp.orig	2012-10-17 11:35:39.000000000 +0200
1
diff --git src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp
2
+++ ./src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp	2012-10-17 11:35:52.000000000 +0200
2
index 35ba386..dc1c79b 100644
3
@@ -427,8 +427,6 @@
3
--- src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp
4
   for (i = 0; i < 8; ++i)
4
+++ src/lib/adapter/Pulse-Eight/USBCECAdapterDetection.cpp
5
@@ -63,6 +63,8 @@ extern "C" {
6
 #elif defined(__FreeBSD__)
7
 #include <stdio.h>
8
 #include <unistd.h>
9
+#include <sys/types.h>
10
+#include <sys/sysctl.h>
11
 #endif
12
 
13
 #define CEC_VID  0x2548
14
@@ -434,22 +436,68 @@ uint8_t CUSBCECAdapterDetection::FindAdapters(cec_adapter_descriptor *deviceList
15
   }
16
 #elif defined(__FreeBSD__)
17
   char devicePath[PATH_MAX + 1];
18
+  char infos[512];
19
+  char sysctlname[32];
20
+  char ttyname[8];
21
+  char *pos;
22
+  size_t infos_size = sizeof(infos);
23
   int i;
24
 
25
-  for (i = 0; i < 8; ++i)
26
+  for (i = 0; ; ++i)
5
   {
27
   {
6
     (void)snprintf(devicePath, sizeof(devicePath), "/dev/ttyU%d", i);
28
-    (void)snprintf(devicePath, sizeof(devicePath), "/dev/ttyU%d", i);
7
-    if (strDevicePath && strcmp(devicePath, strDevicePath) != 0)
29
-    if (strDevicePath && strcmp(devicePath, strDevicePath) != 0)
8
-      continue;
30
+    memset(infos, 0, sizeof(infos));
9
     if (!access(devicePath, 0))
31
+    (void)snprintf(sysctlname, sizeof(sysctlname),
10
     {
32
+      "dev.umodem.%d.%%pnpinfo", i);
11
       snprintf(deviceList[iFound].path, sizeof(deviceList[iFound].path), "%s", devicePath);
33
+    if (sysctlbyname(sysctlname, infos, &infos_size,
34
+      NULL, 0) != 0)
35
+        break;
36
+    if (strstr(infos, "vendor=0x2548") == NULL)
37
       continue;
38
-    if (!access(devicePath, 0))
39
-    {
40
-      snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath);
41
-      snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath);
42
-      deviceList[iFound].iVendorId = CEC_VID;
43
-      deviceList[iFound].iProductId = CEC_VID;
44
-      deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
45
-      iFound++;
46
+    if (strstr(infos, "product=0x1001") == NULL
47
+    && strstr(infos, "product=0x1002") == NULL)
48
+      continue;
49
+    pos = strstr(infos, "ttyname=");
50
+    if (pos == NULL)
51
+      continue;
52
+    sscanf(pos, "ttyname=%s ", ttyname);
53
+
54
+    (void)snprintf(devicePath, sizeof(devicePath),
55
+      "/dev/tty%s", ttyname);
56
+
57
+    if (strDevicePath) {
58
+      char currStrDevicePath[512];
59
+      int port = 0;
60
+      int devaddr = 0;
61
+      memset(currStrDevicePath, 0, sizeof(currStrDevicePath));
62
+      memset(infos, 0, sizeof(infos));
63
+      (void)snprintf(sysctlname, sizeof(sysctlname),
64
+        "dev.umodem.%d.%%location", i);
65
+      if (sysctlbyname(sysctlname, infos, &infos_size,
66
+        NULL, 0) != 0)
67
+          break;
68
+
69
+      pos = strstr(infos, "port=");
70
+      if (pos == NULL)
71
+        continue;
72
+      sscanf(pos, "port=%d ", &port);
73
+
74
+      pos = strstr(infos, "devaddr=");
75
+      if (pos == NULL)
76
+        continue;
77
+      sscanf(pos, "devaddr=%d ", &devaddr);
78
+
79
+      (void)snprintf(currStrDevicePath, sizeof(currStrDevicePath),
80
+        "/dev/ugen%d.%d", port, devaddr);
81
+
82
+      if (strcmp(currStrDevicePath, strDevicePath) != 0)
83
+        continue;
84
     }
85
+    snprintf(deviceList[iFound].strComPath, sizeof(deviceList[iFound].strComPath), "%s", devicePath);
86
+    snprintf(deviceList[iFound].strComName, sizeof(deviceList[iFound].strComName), "%s", devicePath);
87
+    deviceList[iFound].iVendorId = CEC_VID;
88
+    deviceList[iFound].iProductId = CEC_VID;
89
+    deviceList[iFound].adapterType = ADAPTERTYPE_P8_EXTERNAL; // will be overridden when not doing a "quick scan" by the actual type
90
+    iFound++;
91
   }
92
 #else
93
   //silence "unused" warnings
(-)libcec/pkg-message (+8 lines)
Line 0 Link Here
1
WARNING:
2
3
You need write permissions on the USB device to make it work properly.
4
Consider adding a rule in /etc/devfs.rules like this one :
5
6
[system=10]
7
add path 'ttyU*' mode 0660 group operator 
8

Return to bug 179331