Commits

Anonymous committed 6a357fb

Fixed device pattern on Darwin

  • Participants
  • Parent commits 347cbdb

Comments (0)

Files changed (1)

src/Carica/Io/Stream/Serial/Device.php

           $this->_baudRates[$baud]
         );
       } elseif (substr(PHP_OS, 0, 6) === "Darwin") {
-        $pattern = '(^COM\d+:$)';
-        $command = sprintf('stty -f %s %d', $device, $baud);
+        $pattern = '(^/dev/tty\.[^\s]+$)';
+        $command = sprintf('stty -f %s speed %d', $device, $baud);
       } elseif (substr(PHP_OS, 0, 5) === "Linux") {
         $pattern = '(^/dev/tty\w+\d+$)';
         $prepare = sprintf('stty -F %s %d', $device, $baud);