Skip to content

Verify bytes read are actually delimiter.#201

Merged
VanceVagell merged 3 commits intoVanceVagell:mainfrom
SmittyHalibut:kv4p-200
Jan 28, 2025
Merged

Verify bytes read are actually delimiter.#201
VanceVagell merged 3 commits intoVanceVagell:mainfrom
SmittyHalibut:kv4p-200

Conversation

@SmittyHalibut
Copy link
Collaborator

Verify that the characters read are actually the delimiter characters, and reset the count if not. This will re-sync communications between the ESP32 and the Android app if things get wonky.

Note that waiting on Serial.available() isn't necessary since Serial.read() already blocks until a character is available. If you were looking for some other condition in that loop to exit it, it would be useful. But since we aren't, I optimized it out.

@SmittyHalibut SmittyHalibut changed the title Kv4p 200 Verify bytes read are actually delimiter. Jan 28, 2025
int attenuation = ATTENUATION_MAX; // Full volume
bool lastSquelched = false;

// 11dB vs 12dB is a ...version thing?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err... This is #199. I suspect once it gets merged, this will update and go away.

@VanceVagell
Copy link
Owner

Please merge with main.

Also, did you test this on actual hardware and confirm it works as expected?

@SmittyHalibut
Copy link
Collaborator Author

Please merge with main.

Also, did you test this on actual hardware and confirm it works as expected?

I tested on actual hardware and ... it didn't break? That is, the sync at the top of loop() still syncs.

I THINK this was the problem we were running into with #181, but I'm not able to verify. I can't verify. I can verify that the sync is still working, but I can't verify this fixes anything. It is/should be safe belt-and-bracers sort of coding, IMHO.

@sonarqubecloud
Copy link

@VanceVagell VanceVagell merged commit f4ae70c into VanceVagell:main Jan 28, 2025
4 checks passed
@SmittyHalibut SmittyHalibut deleted the kv4p-200 branch January 28, 2025 02:08
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.

2 participants