summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-03-27 12:22:01 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-03-27 15:04:30 +0100
commit611bb1c7be1278b144570e92dc70b1af987b010a (patch)
tree70aefabc8a7be4f783b5ffd81e0e52a826da3e9c
parent5f685836d9d0be09801c0829878705d119cda964 (diff)
Hss1394Controller: Print Warning if not all bytes were sent
-rw-r--r--src/controllers/midi/hss1394controller.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp
index d89268d644..3512f58e33 100644
--- a/src/controllers/midi/hss1394controller.cpp
+++ b/src/controllers/midi/hss1394controller.cpp
@@ -186,7 +186,7 @@ int Hss1394Controller::close() {
void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
unsigned char byte2) {
- unsigned char data[3] = { status, byte1, byte2 };
+ const unsigned char data[3] = {status, byte1, byte2};
int bytesSent = m_pChannel->SendChannelBytes(data, 3);
controllerDebug(MidiUtils::formatMidiMessage(getName(),
@@ -194,19 +194,19 @@ void Hss1394Controller::sendShortMsg(unsigned char status, unsigned char byte1,
MidiUtils::channelFromStatus(status),
MidiUtils::opCodeFromStatus(status)));
- //if (bytesSent != 3) {
- // qDebug()<<"ERROR: Sent" << bytesSent << "of 3 bytes:" << message;
- // //m_pChannel->Flush();
- //}
+ if (bytesSent != 3) {
+ qDebug() << "ERROR: Sent" << bytesSent << "of 3 bytes:" << status << byte1 << byte2;
+ //m_pChannel->Flush();
+ }
}
void Hss1394Controller::send(const QByteArray& data) {
- int bytesSent = m_pChannel->SendChannelBytes(
- (unsigned char*)data.constData(), data.size());
+ const int bytesSent = m_pChannel->SendChannelBytes(
+ reinterpret_cast<const unsigned char*>(data.constData()), data.size());
controllerDebug(MidiUtils::formatSysexMessage(getName(), data));
- //if (bytesSent != length) {
- // qDebug()<<"ERROR: Sent" << bytesSent << "of" << length << "bytes (SysEx)";
- // //m_pChannel->Flush();
- //}
+ if (bytesSent != data.size()) {
+ qDebug() << "ERROR: Sent" << bytesSent << "of" << data.size() << "bytes (SysEx)";
+ //m_pChannel->Flush();
+ }
}