我在 osx lion 上闪现我的asuro时遇到问题。
按照一些论坛的建议,对刷机程序的来源进行了一些修复后con_flash
,它编译成功。
screen
IR 设备正在工作,我可以通过命令向/从其他记事本发送/接收数据。我什至可以接收来自 asuro 的本机 IR 信号(例如Starting XYZ-test...
)。
机器人绝对没有坏,他可以在窗户上闪现。这是一个 osx 问题,论坛条目表明其他用户也有问题。但没有提供解决方案。
domain:asuro mike$ sudo con_flash /dev/tty.usbserial-AXWAUG8P Asuro\ 020.hex
ASURO Flash Copyright (c)2003-2004 DLR RM
ASURO Flash comes with
ABSOLUTELY NO WARRANTY
This program is free software
you can redistribute it and/or modify
it under the terms of the
GNU General Public License
as published by
the Free Software Foundation
either version 2 of the License
or any later version
ASURO Flash Tool
Version 1.2
Author: Jan Grewe
(c)DLR 2003-20004
Linux Version
.
Open /dev/tty.usbserial-AXWAUG8P --> # always freezes here
^Cdomain:asuro mike$
编辑
问题在于通过open
命令打开设备。甚至没有工作,因为我将设备名称硬编码到其中!
bool CPosixSerial::Open(char* port)
{
char text[256];
#ifdef LINUX
/*
#elif defined(Q_OS_IRIX) || defined(_OS_IRIX_)
sprintf(portName,"/dev/ttyf%d",port+1);
#elif defined(Q_OS_HPUX) || defined(_OS_HPUX_)
sprintf(portName,"/dev/tty1p%d",port);
#elif defined(Q_OS_SOLARIS) || defined(_OS_SOLARIS_)
sprintf(portName,"/dev/ttyS%d",port);
#elif defined(Q_OS_ULTRIX) || defined(_OS_ULTRIX_)
sprintf(portName,"/dev/tty%02d",port+1);
*/
#else
#error Wrong OS only LINUX implemented
#endif
strcpy(m_portName,port);
m_portHandle = open ((const char*)m_portName, O_RDWR | O_NOCTTY);
if (m_portHandle == -1) {
sprintf(text,"Could not open %s\nAlready in use ?!?!\n",m_portName);
MyMessageBox(text);
return false;
}
// configure port settings
tcgetattr(m_portHandle, &CommConfig);
// 2400 Baud
cfsetspeed(&CommConfig, B2400);
// Data Size 8-Bit / 1 Stop Bit / No Parity / No Flow Control / Zero TimeOut
CommConfig.c_cflag = (CREAD | CLOCAL | CS8);
CommConfig.c_lflag = 0;
CommConfig.c_oflag = 0;
CommConfig.c_iflag = 0;
CommConfig.c_cc[VMIN] = 0;
CommConfig.c_cc[VTIME]= 0;
cfsetispeed(&CommConfig, B2400); // fix for osx
cfsetospeed(&CommConfig, B2400); // fix for osx
// Set DTR & RTS
ioctl(m_portHandle, TIOCMSET, TIOCM_DTR | TIOCM_RTS);
if (tcsetattr(m_portHandle, TCSAFLUSH, &CommConfig)) {
sprintf(text,"Can't write port settings on %s\n",m_portName);
MyMessageBox(text);
return false;
}
return true;
}
我会尝试找出screen
osx 的工作原理,也许我可以调整功能。