DanielMartensson / Open-SAE-J1939

SAE J1939 protocol free to use for embedded systems or PC with CAN-bus
MIT License
455 stars 164 forks source link

different code for Commanded_Address.c #33

Closed helikl closed 10 months ago

helikl commented 10 months ago

I've found this file in a link with a bit of different code but the pointer to your repository. Can you explain what is the difference? Thank you Here is the code: /*

include "Network_Management_Layer.h"

/*

/*

DanielMartensson commented 10 months ago

What part do you want to have an explanation at?

helikl commented 10 months ago

BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } There is this referral to your repositoryThis is how I solved the issue with a PGN number, made by my self. github.com/DanielMartensson/Open-SAE-J1939/blob/… [1] – euraad [2] Aug 11, 2021 at 16:47part of stack overflow discussion.Is adding this code/ Send to all ECU that the address DA unused /SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); should be the right way to delte the ECU address? Thank you. Elik On Sat 13/01/24 11:59 PM , Daniel Mårtensson @.*** sent: What part do you want to have an explanation at?

Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you authored the thread. Message ID: [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622", "url": "https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ]


Msg sent via WebMail

Links:

[1] https://github.com/DanielMartensson/Open-SAE-J1939/blob/3a506fc1d96519a5281991fe401a1500361dbe1a/Src/SAE%20J1939/SAE%20J1939-81%20Network%20Management%20Layer/Commanded_Address.c#L34 [2] https://stackoverflow.com/users/1008405/euraad [3] https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 [4] https://github.com/notifications/unsubscribe-auth/BD6Y5UYMPJJNVLLE5KKYZPDYOKVMTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGUZTQNRSGI

DanielMartensson commented 10 months ago

BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } There is this referral to your repositoryThis is how I solved the issue with a PGN number, made by my self. github.com/DanielMartensson/Open-SAE-J1939/blob/… [1] – euraad [2] Aug 11, 2021 at 16:47part of stack overflow discussion.Is adding this code/ Send to all ECU that the address DA unused /SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); should be the right way to delte the ECU address? Thank you. Elik On Sat 13/01/24 11:59 PM , Daniel Mårtensson @. sent: What part do you want to have an explanation at? — Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you authored the thread. Message ID: [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#33 (comment)", "url": "#33 (comment)", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ] ------------------------- Msg sent via WebMail Links: ------ [1] https://github.com/DanielMartensson/Open-SAE-J1939/blob/3a506fc1d96519a5281991fe401a1500361dbe1a/Src/SAE%20J1939/SAE%20J1939-81%20Network%20Management%20Layer/Commanded_Address.c#L34 [2] https://stackoverflow.com/users/1008405/euraad [3] #33 (comment) [4] https://github.com/notifications/unsubscribe-auth/BD6Y5UYMPJJNVLLE5KKYZPDYOKVMTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGUZTQNRSGI

@helikl sorry, i don't understanding your message.

helikl commented 10 months ago

Sorry, I try to clarify.

There is a discussion at url:

can bus - J1939 - What PGN number should I use for request about delete NAME? - Stack Overflow https://stackoverflow.com/questions/68337373/j1939-what-pgn-number-should-i-use-for-request-about-delete-name

As a result the conclusion was to add this line

SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA);

to the file Commanded Address.c.

In the repository this line does not show in the file Commanded Address.c..

Is that the right approach for delete the ECU information?

Thank you.

Elik

From: Daniel Mårtensson @.> Sent: Sunday, January 14, 2024 9:19 AM To: DanielMartensson/Open-SAE-J1939 @.> Cc: helikl @.>; Mention @.> Subject: Re: [DanielMartensson/Open-SAE-J1939] different code for Commanded_Address.c (Issue #33)

BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } There is this referral to your repositoryThis is how I solved the issue with a PGN number, made by my self. github.com/DanielMartensson/Open-SAE-J1939/blob/… [1] – euraad [2] Aug 11, 2021 at 16:47part of stack overflow discussion.Is adding this code/* Send to all ECU that the address DA unused /SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); should be the right way to delte the ECU address? Thank you. Elik On Sat 13/01/24 11:59 PM , Daniel Mårtensson @.** sent: What part do you want to have an explanation at? — Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you authored the thread. Message ID: [ { @.": " http://schema.org http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 ", "url": "#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 ", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ] … ------------------------- Msg sent via WebMail Links: ------ [1] https://github.com/DanielMartensson/Open-SAE-J1939/blob/3a506fc1d96519a5281991fe401a1500361dbe1a/Src/SAE%20J1939/SAE%20J1939-81%20Network%20Management%20Layer/Commanded_Address.c#L34 [2] https://stackoverflow.com/users/1008405/euraad [3] #33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 [4] https://github.com/notifications/unsubscribe-auth/BD6Y5UYMPJJNVLLE5KKYZPDYOKVMTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGUZTQNRSGI

@helikl https://github.com/helikl sorry, i don't understanding your message.

— Reply to this email directly, view it on GitHub https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1891010312 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BD6Y5U6JLVVLAFRWVYB526TYOQHRTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGAYTAMZRGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BD6Y5U7EMPBQVIUOVOLOHHTYOQHRTA5CNFSM6AAAAABBXOQHESWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTQW2DQQ.gif Message ID: @. @.> >

DanielMartensson commented 10 months ago

Sorry, I try to clarify. There is a discussion at url: can bus - J1939 - What PGN number should I use for request about delete NAME? - Stack Overflow https://stackoverflow.com/questions/68337373/j1939-what-pgn-number-should-i-use-for-request-about-delete-name As a result the conclusion was to add this line SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); to the file Commanded Address.c. In the repository this line does not show in the file Commanded Address.c.. Is that the right approach for delete the ECU information? Thank you. Elik From: Daniel Mårtensson @.> Sent: Sunday, January 14, 2024 9:19 AM To: DanielMartensson/Open-SAE-J1939 @.> Cc: helikl @.>; Mention @.> Subject: Re: [DanielMartensson/Open-SAE-J1939] different code for Commanded_Address.c (Issue #33) BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } There is this referral to your repositoryThis is how I solved the issue with a PGN number, made by my self. github.com/DanielMartensson/Open-SAE-J1939/blob/… [1] – euraad [2] Aug 11, 2021 at 16:47part of stack overflow discussion.Is adding this code/ Send to all ECU that the address DA unused /SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); should be the right way to delte the ECU address? Thank you. Elik On Sat 13/01/24 11:59 PM , Daniel Mårtensson @. sent: What part do you want to have an explanation at? — Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you authored the thread. Message ID: [ { @.": " http://schema.org http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#33 (comment) <#33 (comment)> ", "url": "#33 (comment) <#33 (comment)> ", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ] … ------------------------- Msg sent via WebMail Links: ------ [1] https://github.com/DanielMartensson/Open-SAE-J1939/blob/3a506fc1d96519a5281991fe401a1500361dbe1a/Src/SAE%20J1939/SAE%20J1939-81%20Network%20Management%20Layer/Commanded_Address.c#L34 [2] https://stackoverflow.com/users/1008405/euraad [3] #33 (comment) <#33 (comment)> [4] https://github.com/notifications/unsubscribe-auth/BD6Y5UYMPJJNVLLE5KKYZPDYOKVMTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGUZTQNRSGI @helikl https://github.com/helikl sorry, i don't understanding your message. — Reply to this email directly, view it on GitHub <#33 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/BD6Y5U6JLVVLAFRWVYB526TYOQHRTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGAYTAMZRGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BD6Y5U7EMPBQVIUOVOLOHHTYOQHRTA5CNFSM6AAAAABBXOQHESWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTQW2DQQ.gif Message ID: @. @.***> >

@helikl

"Is that the right approach for delete the ECU information?"

It's not part of the SAE J1939 standard, as explained at the comments.

The delete ECU PGN is a function call to remove the awareness of the ECU ID from other ECUs.

Example: If there are 10 ECU with the adresses: 0, 1,..., 9. And we remove ECU 5. Then we tell the other ECUs that number 5 is gone from the network.

But if ECU 5 is reconnected, then it will broadcast its NAME and all the other ECU will accept this new member.

helikl commented 10 months ago

Thank you for the explanation and the contribution to use in a simple way the J1939.

Elik

From: Daniel Mårtensson @.> Sent: Monday, January 15, 2024 1:46 PM To: DanielMartensson/Open-SAE-J1939 @.> Cc: helikl @.>; Mention @.> Subject: Re: [DanielMartensson/Open-SAE-J1939] different code for Commanded_Address.c (Issue #33)

Sorry, I try to clarify. There is a discussion at url: can bus - J1939 - What PGN number should I use for request about delete NAME? - Stack Overflow https://stackoverflow.com/questions/68337373/j1939-what-pgn-number-should-i-use-for-request-about-delete-name As a result the conclusion was to add this line SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); to the file Commanded Address.c. In the repository this line does not show in the file Commanded Address.c.. Is that the right approach for delete the ECU information? Thank you. Elik From: Daniel Mårtensson @.> Sent: Sunday, January 14, 2024 9:19 AM To: DanielMartensson/Open-SAE-J1939 @.> Cc: helikl @.>; Mention @.> Subject: Re: [DanielMartensson/Open-SAE-J1939] different code for Commanded_Address.c (Issue #33 https://github.com/DanielMartensson/Open-SAE-J1939/issues/33 ) BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; } There is this referral to your repositoryThis is how I solved the issue with a PGN number, made by my self. github.com/DanielMartensson/Open-SAE-J1939/blob/… [1] – euraad [2] Aug 11, 2021 at 16:47part of stack overflow discussion.Is adding this code/ Send to all ECU that the address DA unused /SAE_J1939_Send_Address_Delete(j1939, 0xFF, DA); should be the right way to delte the ECU address? Thank you. Elik On Sat 13/01/24 11:59 PM , Daniel Mårtensson @. sent: What part do you want to have an explanation at? — Reply to this email directly, view it on GitHub [3], or unsubscribe [4]. You are receiving this because you authored the thread. Message ID: [ { @.": " http://schema.org http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#33 https://github.com/DanielMartensson/Open-SAE-J1939/issues/33 (comment) <#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 > ", "url": "#33 https://github.com/DanielMartensson/Open-SAE-J1939/issues/33 (comment) <#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 > ", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ] … ------------------------- Msg sent via WebMail Links: ------ [1] https://github.com/DanielMartensson/Open-SAE-J1939/blob/3a506fc1d96519a5281991fe401a1500361dbe1a/Src/SAE%20J1939/SAE%20J1939-81%20Network%20Management%20Layer/Commanded_Address.c#L34 [2] https://stackoverflow.com/users/1008405/euraad [3] #33 https://github.com/DanielMartensson/Open-SAE-J1939/issues/33 (comment) <#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1890538622 > [4] https://github.com/notifications/unsubscribe-auth/BD6Y5UYMPJJNVLLE5KKYZPDYOKVMTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQGUZTQNRSGI @helikl https://github.com/helikl https://github.com/helikl sorry, i don't understanding your message. — Reply to this email directly, view it on GitHub <#33 (comment) https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1891010312 > , or unsubscribe https://github.com/notifications/unsubscribe-auth/BD6Y5U6JLVVLAFRWVYB526TYOQHRTAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRGAYTAMZRGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BD6Y5U7EMPBQVIUOVOLOHHTYOQHRTA5CNFSM6AAAAABBXOQHESWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTQW2DQQ.gif Message ID: @. @.***> >

@helikl https://github.com/helikl

"Is that the right approach for delete the ECU information?"

It's not part of the SAE J1939 standard, as explained at the comments.

The delete ECU PGN is a function call to remove the awareness of the ECU ID from other ECUs.

Example: If there are 10 ECU with the adresses: 0, 1,..., 9. And we remove ECU 5. Then we tell the other ECUs that number 5 is gone from the network.

But if ECU 5 is reconnected, then it will broadcast its NAME and all the other ECU will accept this new member.

— Reply to this email directly, view it on GitHub https://github.com/DanielMartensson/Open-SAE-J1939/issues/33#issuecomment-1892796725 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BD6Y5UY5V6FNOACVGVENVOLYOWPSZAVCNFSM6AAAAABBXOQHESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSG44TMNZSGU . You are receiving this because you were mentioned. https://github.com/notifications/beacon/BD6Y5U3HJTKA57SWP3VOTZTYOWPSZA5CNFSM6AAAAABBXOQHESWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTQ2HETK.gif Message ID: @. @.> >

DanielMartensson commented 10 months ago

Thank you so much. If there are anything else, just send a pull request to contribute to this open library.