Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/bus/rs232/FujiBusPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,16 @@ bool FujiBusPacket::parse(const std::string &input)
unsigned int idx, jdx;
uint32_t val, bt;

Debug_printv("Incoming:\n%s\n", util_hexdump(input.data(), input.size()).c_str());

if (input.size() < sizeof(fujibus_header) + 2)
return false;
if (((uint8_t) input[0]) != SLIP_END || ((uint8_t) input.back()) != SLIP_END)
return false;

decoded = decodeSLIP(input);
Debug_printv("Decoded:\n%s\n", util_hexdump(decoded.data(), decoded.size()).c_str());

if (decoded.size() < sizeof(fujibus_header))
return false;
hdr = (fujibus_header *) &decoded[0];
Expand All @@ -139,7 +143,7 @@ bool FujiBusPacket::parse(const std::string &input)
{
for (val = jdx = 0; jdx < _fieldSize; jdx++)
{
bt = decoded[offset + idx * _fieldSize + jdx];
bt = (uint8_t) decoded[offset + idx * _fieldSize + jdx];
val |= bt << (8 * jdx);
}
_params.push_back(val);
Expand Down
4 changes: 4 additions & 0 deletions lib/bus/rs232/rs232.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,13 @@ void virtualDevice::rs232_ack()
// RS232 COMPLETE
void virtualDevice::rs232_complete()
{
#ifdef OBSOLETE
fnSystem.delay_microseconds(DELAY_T5);
SYSTEM_BUS.write('C');
Debug_println("COMPLETE!");
#else
SYSTEM_BUS.sendReplyPacket(_devnum, true, nullptr, 0);
#endif /* OBSOLETE */
}

// RS232 ERROR
Expand Down
Loading