summaryrefslogtreecommitdiffstats
path: root/src/isotp/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/isotp/send.c')
-rw-r--r--src/isotp/send.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/isotp/send.c b/src/isotp/send.c
index 85e35744..b87c5602 100644
--- a/src/isotp/send.c
+++ b/src/isotp/send.c
@@ -44,7 +44,7 @@ IsoTpHandle isotp_send_single_frame(IsoTpShims* shims, IsoTpMessage* message,
IsoTpHandle isotp_send_multi_frame(IsoTpShims* shims, IsoTpMessage* message,
IsoTpMessageSentHandler callback) {
- // TODO make sure to copy payload into a local buffer
+ // TODO make sure to copy message into a local buffer
shims->log("Only single frame messages are supported");
IsoTpHandle handle = {
success: false,
@@ -57,14 +57,14 @@ IsoTpHandle isotp_send_multi_frame(IsoTpShims* shims, IsoTpMessage* message,
}
IsoTpHandle isotp_send(IsoTpShims* shims, const uint16_t arbitration_id,
- const uint8_t* payload, uint16_t size,
+ const uint8_t payload[], uint16_t size,
IsoTpMessageSentHandler callback) {
IsoTpMessage message = {
arbitration_id: arbitration_id,
- payload: payload,
size: size
};
+ memcpy(message.payload, payload, size);
if(size < 8) {
return isotp_send_single_frame(shims, &message, callback);
} else {