I am attempting to send some LIN messages, and it seems I'm either not doing it correctly, or it isn't working correctly. This is effetely what I have so far. It seems to be sending some sort of message (looking at the oscilloscope), but my LIN analyzer is not able to even detect the packets. I followed the example of the only LIN snippet I could find on here. The documentation isn't very clear on sending LIN messages.
local h = Serial.GetTransmitHandle(true);
local dataOffset = Serial.SetLinHeader(h, 0, 4, [message_id], true, true);
offset = Serial.SetUnsignedInteger(h, offset, 4, [data]);
offset = Serial.SetUnsignedInteger(h, offset, 1, ~Serial.Sum8(h, dataOffset - 1, 5)); // is this even necessary?
Serial.Transmit(h, 1, offset);
Any insight into the proper way to send LIN messages?