particle-iot / particle-android

Particle Open Source for Android
Apache License 2.0
37 stars 38 forks source link

Unknown serial device id API lookup fix #73

Closed jensck closed 5 years ago

jensck commented 5 years ago

This is the hotfix solution for the issue which David and Raimis described from Germany with devices not pairing.

jensck commented 5 years ago

I would avoid having variables / constants with idx attached at the end (like prefix1, prefix2, prefix3), because it makes code harder to read and understand. I would much rather have as part of the array or hardcoded values in one place where the actual comparison is happening (definitely avoid hardcoding them in more than 1 place :)).

Yeah, that makes sense. I'll change that on my current development branch, but since this is a hotfix, I'm going to leave it as-is here. :)

Will this code handle timeout / error when calling API?

Yes, API timeouts and errors are handled (in as much as they can be handled, i.e.: the lookup fails, setup stops, and the app shows an error to the user)

jensck commented 5 years ago

Thanks for the review!