Package: brltty / 4.2-7+squeeze2

40-esys-64.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/Drivers/Braille/EuroBraille/eu_esysiris.c b/Drivers/Braille/EuroBraille/eu_esysiris.c
index c55574d..6409142 100644
--- a/Drivers/Braille/EuroBraille/eu_esysiris.c
+++ b/Drivers/Braille/EuroBraille/eu_esysiris.c
@@ -212,6 +212,8 @@ static int esysiris_SysIdentity(BrailleDisplay *brl, char *packet)
       break;
     case 'T':
       brlType = packet[1];
+      if (brlType >= TYPE_LAST)
+	brlType = UNKNOWN;
       break;
     default:
       LogUnknownProtocolKey("esysiris_SysIdentity", packet[0]);
diff --git a/Drivers/Braille/EuroBraille/eu_usb.c b/Drivers/Braille/EuroBraille/eu_usb.c
index 4a71345..9e00213 100644
--- a/Drivers/Braille/EuroBraille/eu_usb.c
+++ b/Drivers/Braille/EuroBraille/eu_usb.c
@@ -86,9 +191,18 @@ eubrl_usbRead (BrailleDisplay *brl, void *buffer, size_t length, int wait)
 ssize_t
 eubrl_usbWrite(BrailleDisplay *brl, const void *buffer, size_t length)
 {
-  if(length>USB_PACKET_SIZE) return(-1);
-  char packetToSend[USB_PACKET_SIZE];
-  memset(packetToSend,0x55,USB_PACKET_SIZE);
-  memcpy(packetToSend,buffer,length);
-  return usbHidSetReport(usb->device, usb->definition.interface, 0, packetToSend, USB_PACKET_SIZE, 10);
+  size_t pos = 0;
+  while (pos < length) {
+    char packetToSend[USB_PACKET_SIZE];
+    size_t tosend = length - pos;
+    if (tosend > USB_PACKET_SIZE) {
+      tosend = USB_PACKET_SIZE;
+    }
+    memset(packetToSend,0x55,USB_PACKET_SIZE);
+    memcpy(packetToSend,buffer+pos,tosend);
+    if (usbHidSetReport(usb->device, usb->definition.interface, 0, packetToSend, USB_PACKET_SIZE, 10) < 0)
+      return -1;
+    pos += tosend;
+  }
+  return length;
 }