10.8 を実行している Mac で、シリアル ポートを開こうとしています。
ls /dev/cu* は以下を返します:
/dev/cu.Bluetooth-Modem /dev/cu.Bluetooth-PDA-Sync /dev/cu.usbserial-A1009TT7
ポートがそこにあることがわかりますが、それを開こうとすると、未定義のエラーが発生します: 0(0)。これは、ポートを開くために使用する私のコードです。
char *path = "/dev/cu.usbserial-A1009TT7";
open(path , O_RDWR | O_NOCTTY | O_NONBLOCK); // open the port
if (file == -1) {
printf("Error opening port : %s(%d).\n", strerror(errno), errno);
close(file);
return -1;
}
ポートが開かない理由を知っている人はいますか?
前もって感謝します。