PointOneNav / polaris

Software for communicating with Point One Navigation's Polaris GNSS Corrections Service
MIT License
25 stars 12 forks source link

Added Polaris_AuthenticateTo() to allow use of an alternate API server. #44

Closed adamshapiro0 closed 3 years ago

adamshapiro0 commented 3 years ago

I thought about that a bit. To do it, we would still need to create a setter to modify the context since ideally we don't want anyone to mess with it directly in case it changes in the future. Even then, it would either store const char*, which would only work if the caller guaranteed the string didn't go out of scope ever, or have to store a char array, which increases memory footprint. With const char*, if they user used a temp string (e.g., wanted to use sprintf() or something) and it went out of scope, future calls to Authenticate() to handle reconnects would crash.

I figured this was the clearest and safest solution, and it's consistent with the existing ConnectTo() call.