summaryrefslogtreecommitdiffstats
path: root/src/isotp/send.c
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 17:14:56 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-02 17:14:56 -0500
commit3b25a0491ce9ef9b55c903c6c7f0929bc2910d1a (patch)
tree95b61b97468093c079a19a9ad8b8f2100cf6e983 /src/isotp/send.c
parente3637d97ecaef1768d3f9ef40cb0204a0e668ff2 (diff)
Allocate ISO-TP message buffer on the stack.
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 {