on7lds / NextionDriver

Driver program to connect MMDVMhost with Nextion Displays, adding extra functionality
33 stars 33 forks source link

Don't send duplicate time. #3

Closed dehain closed 5 years ago

dehain commented 5 years ago

This change keeps track of the last time of day that was sent to display and prevents sending the time of day to the display if it hasn't changed. This reduces the amount of information that gets sent to the display.

dehain commented 5 years ago

I think I have found a better way to accomplish what I want.

on7lds commented 5 years ago

What was your goal ?

dehain commented 5 years ago

At first I was just trying to minimize the data going to the display because it would stop updating but it looks like you fixed that issue in V1.06. Looking at it more I wasn't sure your intent was for people to modify the transmit buffer directly in processCommands, because some commands get sent from basicCommands without processCommands being able to modify them.

So, I was think about something like having sendMessage() call a preProcess() command on every sent message. That would make it to where any basic message could be modified if necessary and processCommands() could be used just for new functionalilty.

I'm not sure if this is the best way to do it, but I'm still understanding all the pieces between the MMDVMHost and the NextionDriver code.

on7lds commented 5 years ago

The goal is indeed to let processCommands do al postprocessing (deleting, changing or adding), assuming that what is done as extra in basicCommands always needs to be send to the display. I'll think about it how to change it to let you postprocess all commands. It might be by calling processCommands before any communication to the display.

It should, however, not be necessary to minimize data sent to the display as long as there is time for it. And you can get more time by switching to the HighSpeed layout (115kbps) if that should be necessary.

dehain commented 5 years ago

Sounds good. Thanks for making the software. It works pretty well for me as of the 1.06 version and has been fun to play around with.