Hi there,
I’ve been debugging my Arduino code handling hub.sync.status responses over serial. I noticed that when an invalid Product UID is used, the Notecard returns an “alert”:true flag along with a specific error string: “opening notehub: no project was found…” and the system tag {product-noexist}.
To ensure my code is future-proof, should I rely on catching the “alert”:true boolean and the {product-noexist} tag in terms of validation of correct UID or not?
Thank you very much.
Best regards,
Ozaer A.
Hey @ozaer777,
And welcome to the Blues community!
Generally speaking, there’s no need to validate a ProductUID because you will be creating it and it will be stable forever.
Depending on your firmware requirements though, you may want to handle a response of "alert": true, as that means something went wrong in the last sync.
TJ
Hi TJ,
Thanks for the quick reply! I will definitely use “alert”: true to handle general sync issues in the field.
To give some context, I was just looking to build a strict pre-deployment safeguard on my workbench. If I make a simple copy-paste error with the UID and ship the Swan to a remote customer site, it means lost data and a physical trip to re-flash it. I just wanted a way to catch those silly mistakes before the hardware ever leaves my desk!
Thanks again for pointing me in the right direction.
Best regards,
Ozaer A.
PWB Design Service LLC