Add description field for messages

Closes https://github.com/intrepidcs/libicsneo/issues/28
This commit is contained in:
Kyle Schwarz
2020-11-13 16:15:04 -05:00
parent e5920417ff
commit ffbb5e20c5
3 changed files with 13 additions and 3 deletions
+2
View File
@@ -46,6 +46,7 @@ static void NeoMessageToSpyMessage(const neodevice_t* device, const neomessage_t
memcpy(oldmsg.Data, newmsg.data, std::min(newmsg.length, (size_t)8));
oldmsg.ArbIDOrHeader = *(uint32_t*)newmsg.header;
oldmsg.NetworkID = (uint8_t)newmsg.netid; // Note: NetID remapping from the original API is not supported
oldmsg.DescriptionID = newmsg.description;
oldmsg.StatusBitField = newmsg.status.statusBitfield[0];
oldmsg.StatusBitField2 = newmsg.status.statusBitfield[1];
oldmsg.StatusBitField3 = newmsg.status.statusBitfield[2];
@@ -221,6 +222,7 @@ int icsneoTxMessagesEx(void* hObject, icsSpyMessage* pMsg, unsigned int lNetwork
const icsSpyMessage& oldmsg = pMsg[i];
newmsg = {};
newmsg.netid = (uint16_t)lNetworkID;
newmsg.description = oldmsg.DescriptionID;
memcpy(newmsg.header, &oldmsg.ArbIDOrHeader, sizeof(newmsg.header));
newmsg.length = oldmsg.NumberBytesData | (oldmsg.NodeID << 8);
if (oldmsg.ExtraDataPtr != nullptr)