-
Notifications
You must be signed in to change notification settings - Fork 2
Update sfe_sara_r5.h #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think I'm going to vote no on this PR, but happy to hear other opinions! @gigapod? The point of this library is to minimize the amount of duplicate code between different modules. That means one single set of macros/constants/enums/etc. between all modules; take the AT command strings for example: Merging this would mean we have duplicate AT command string definitions, but with different macro names: I'm guessing you're suggesting this change for backwards compatibility with the original SARA-R5 library, which is the exclusive purpose of As for your other comments regarding baud rates and URC processing - lets move those discussions to separate issues so we can keep each thread on topic. |
I'm mostly concerned about backward compatibility. Right now, this does not compile:
Including Having I don't mind if these defines are in I'm less worried about all the If there's a better way to solve this, let's hear it! ;-) |
Oh! Yep, you're right I hadn't caught that. In that case, I think it would be best to put these changes into |
Only in SparkFun_u-blox_SARA-R5_Arduino_Library.h
@PaulZC Ok, how's this? All changes are now in |
That looks good - thanks! Unless of course you're just about to change UBLOX_AT_ to something else?! Enjoy the holiday, |
Doh! Yes, will update that then merge. Thank you! |
Prepping for merge
FYI - When it comes to code / libraries - things people depend on - backward compatibility is critical. We don't want to break someones code. If it takes a little extra layer code to do this, it's a-okay. Just document the need for this in the code .. And for this macro redefinition - while a devtime hit, runtime costs are 0. For future implementations - we should use a single macro / enum/symbol strategy. |
Add the #define's from SARA_R5_ to UBLOX_AT_
This allows existing SARA_R5 code to compile and run, fixing errors like:
With these changes, I think SparkFun_u-blox_SARA-R5_Arduino_Library.h is no longer required and can be deleted.
We need to have a separate discussion about how we should handle (e.g.) the supported baud rates. We need a way for each derived class to be able to override the supported baud rates. I believe the code is currently defaulting to 115200, which is OK and works on the SARA. But SARA needs to support slower bauds too:
We also need to have a discussion about how to handle this code in
processURCEvent
. This code is specific to the SARA_R5 and so shouldn't be in the UBLOX_AT class. We need a way to allow the SARA_R5 class to 'insert' this. Maybe we need to add a virtual method which does nothing in UBLOX_AT, but which can be overwritten by the SARA_R5 class to allow UUPSDA to be processed?Same for this line in
pruneBacklog
.