diff --git a/source/hidapi.m b/source/hidapi.m index a8803b46dea4d1baaeaba85db5ec3737da8741ff..0815abd98b110b92bcfee2d168723c626611c596 100755 --- a/source/hidapi.m +++ b/source/hidapi.m @@ -383,6 +383,9 @@ classdef hidapi < handle % wmsg does not need to be the max packet size. Uncommenting this doesn't affect % anything, and I would prefer sending short messages over long ones. % Further testing may be required, so for now I don't change a thing. + % (MMI) Update:: Okay, so under Windows, this line IS necessary, as well as the + % fixed write-buffer size of 1025 bytes (== wMaxPacketSize+1; smaller packets fail; + % bigger packets do get handled by the brick, but the second assertion below will fail). wmsg(end+(hid.nWriteBuffer-length(wmsg))) = 0; % Create a uint8 pointer diff --git a/source/usbBrickIO.m b/source/usbBrickIO.m index 47a682098d4bc2fd538c9a944abd6dda20f9585d..6a7a7c5f95d4707b61b96bbe8c36865755e32db9 100755 --- a/source/usbBrickIO.m +++ b/source/usbBrickIO.m @@ -27,7 +27,7 @@ classdef usbBrickIO < BrickIO % read buffer size nReadBuffer = 1024; % write buffer size - nWriteBuffer = 1024; + nWriteBuffer = 1025; % time-out period in milliseconds (if 0, no time-out) timeOut = 10000; end