Skip to content

Commit

Permalink
Fix for if no data to send
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Sep 4, 2019
1 parent 64f7583 commit cd1e5d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/VASTFMT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ bool VASTFMT::sendSi4711Command(uint8_t cmd, const std::vector<uint8_t> &dataIn,
aucBufOut[2] = RequestSi4711Access;
aucBufOut[3] = dataIn.size() + 1;
aucBufOut[4] = cmd;
memcpy(&aucBufOut[5], &dataIn[0], dataIn.size());
if (dataIn.size() > 0) {
memcpy(&aucBufOut[5], &dataIn[0], dataIn.size());
}

hid_write(phd, aucBufOut, 43);
int r = hid_read(phd, aucBufIn, 42);
Expand Down

0 comments on commit cd1e5d8

Please sign in to comment.