Skip to content

Adding dupport for sending and receiving CAN RTR messages.#1186

Closed
HenrikSolver wants to merge 1 commit intomicropython:masterfrom
HenrikSolver:newrtr
Closed

Adding dupport for sending and receiving CAN RTR messages.#1186
HenrikSolver wants to merge 1 commit intomicropython:masterfrom
HenrikSolver:newrtr

Conversation

@HenrikSolver
Copy link
Contributor

The rebase of the PR #1098 became a bit messy since that branch has been laying around for some time. So I have made this new fresh branch and moved relevant parts from the old one. I also merged the code for sending RTRs into the normal send method. It saved one hundred something bytes

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) to 93.14% when pulling dc9a9ad on PappaPeppar:newrtr into c1a77a0 on micropython:master.

@dpgeorge
Copy link
Member

I also thought about making normal send take an rtr parameter... but in that case the data argument is unused and so perhaps a little contrived. @PappaPeppar you have experience using this CAN class I assume, so you're in the best position to decide if it should be 1 send method for both normal and rtr, of if they should be separate methods as you originally had.

@HenrikSolver
Copy link
Contributor Author

I have changed my mind about this several times for the same reason. But I think this way is reasonable, it saves some flash and the maintenance might be a bit easier since the code in both functions are very similar.

@dpgeorge
Copy link
Member

Merged in e3cd154.

A think making send handle RTR frames is the right thing to do. An RTR frame is exactly the same as a normal data frame, except for the single RTR bit, so it should use the same method. In fact, the standard allows you to put a non-zero value in the DLC entry of an RTR frame (even though the data payload does not exist) so that makes the data parameter relevant.

@dpgeorge dpgeorge closed this Apr 18, 2015
@HenrikSolver HenrikSolver deleted the newrtr branch May 18, 2015 20:19
tannewt added a commit to tannewt/circuitpython that referenced this pull request Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants