ttlappalainen / NMEA2000

NMEA2000 library for Arduino
508 stars 211 forks source link

question: read/modify/forward to serial #372

Open wjquigs11 opened 6 months ago

wjquigs11 commented 6 months ago

I would like to read a message from N2K, modify it, and forward to serial. I can set up a tNMEA2000Handler for the PGN I want, and use the Set... function to configure the tN2kMsg, but it seems that the only way to get it to serial is to configure SetForwardStream() and then send the message back to the N2K bus with SendMsg(). However, I don't want to put the modified message on the bus; just send it to serial. If I set the mode to N2km_ListenOnly, will that allow the new message to be forwarded to serial but not to the bus?

ttlappalainen commented 6 months ago

As in documentation you can use tN2kMsg::SendInActisenseFormat for modified message. Automatic forwarding also uses that. If you not like that all messages will be forwarded, you just forward only selected messages on call back.