gpt4 book ai didi

c++ - 在 OSX 上刷写 Asuro Robot (Arexx)

转载 作者:太空宇宙 更新时间:2023-11-04 14:06:09 29 4
gpt4 key购买 nike

我在刷新 asuro 时遇到问题在 osx 狮子上。

按照一些论坛的建议,对刷机程序con_flash的源码进行了一些修改后,编译成功。

IR 设备正在工作,我可以通过 screen 命令向/从其他记事本发送/接收数据。我什至可以接收来自 asuro 的原生 IR 信号(例如 Starting XYZ-test...)。

机器人绝对不是坏的,他可以在windows上闪现。这是一个 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;
}

我会尝试找出 osx 上的 screen 是如何工作的,也许我可以调整功能。

最佳答案

我正在使用最新版本的 con_flash ( http://www.arexx.com/downloads/asuro/asuro_flash_linux_mac_src.zip ) 并且遇到了同样的问题。

我在德国的Roboternetz论坛找到了解决办法: http://www.roboternetz.de/community/threads/59640-osx-asuro-flash-tool?p=565801&viewfull=1#post565801

您必须使用/dev/cu.usbserial* 而不是使用/dev/tty.usbserial*,它显然不使用握手。我还没有完全理解其中的区别。

关于c++ - 在 OSX 上刷写 Asuro Robot (Arexx),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16780877/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com