Skip to content

Commit

Permalink
Show ASCII char of RS232C output.
Browse files Browse the repository at this point in the history
  • Loading branch information
captainys committed Nov 27, 2024
1 parent 2d6b13a commit 71430c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/towns/serialport/serialport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Redistribution and use in source and binary forms, with or without modification,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<< LICENSE */
#include <ctype.h>

#include "serialport.h"
#include "townsdef.h"
#include "cpputil.h"
Expand Down Expand Up @@ -118,7 +120,13 @@ void TownsSerialPort::DefaultClient::XMODEM_TO_VM_TransferNextBlock(uint32_t pac
case FILETFR_NONE:
default:
// Just echo
std::cout << "Tx from VM:" << cpputil::Ubtox(data) << std::endl;
std::cout << "Tx from VM:" << cpputil::Ubtox(data);
if(isprint(data))
{
char c=data;
std::cout << '[' << c << ']';
}
std::cout << std::endl;
toVMPtr=toVM.size();
toVM.push_back(data);
if(0x0D==data)
Expand Down

0 comments on commit 71430c4

Please sign in to comment.