Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (6)
892 بار بازدید -
3 سال پیش
-
Sixth part, covering the split
Sixth part, covering the split into .h/.cpp files and principle extensibility …
↓↓↓ Complete description, time index and links below ↓↓↓
In the fifth part we implemented a proprietary sentence (U-Blox UBX config message 41) and an Arduino hardware serial talker. Things are getting crowded now in our single sketch file. So it’s time to split the code into several .h and .cpp files.
Splitting the sketch into several files is not that hard. But I want a future NMEA library also to be extensible. The code contains two obstacles to that: enums und unions. I’ll show how I plan to get rid of them using some example code.
►Intro
00:00 Intro – making it a library, extensible and portable
►Renaming classes
01:10 Renamed classes – I tend to rename stuff during development
►Splitting into header and cpp files
04:00 Code v12 – overview, Arduino sketches with multiple files
05:25 nema0183ardunio.h – Arduino specific declarations
07:55 nmea0183arduino.cpp – Arduino specific implementation
08:20 nmea0183core.h – declarations for portable stuff
08:56 nmea0183core.cpp – implementation of portable stuff
09:11 NMEA_0183_v12.ino – not much left here
10:10 Comparison to v11 – no penalties and more manageable
►Extensibility
11:09 Why extensibility – you might want to extend the library
12:14 Hindrances to extensibility – unions and enums have to go
13:24 Extensibility mock-up 1 – looks good, but doesn’t compile
19:35 Extensibility mock-up 2 – using pointers makes it almost work
23:02 Extensibility mock-up 3 – with new and delete it works
24:41 Extensibility mock-up 4 – memory management by the library
37:23 Extensibility mock-up 5 – getting rid of the type variable
►Wrap-up
40:49 Wrap-up – next, proprietary sentences and talkers, bye
Tutorials • Tutorials
Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (1) • Making Sense of NMEA 0183 Sentences –...
Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (2) • Making Sense of NMEA 0183 Sentences –...
Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (3) • Making Sense of NMEA 0183 Sentences –...
Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (4) • Making Sense of NMEA 0183 Sentences –...
Making Sense of NMEA 0183 Sentences – Specs & Arduino/MCU/C++ Code (5) • Making Sense of NMEA 0183 Sentences –...
My code drive.google.com/drive/folders/1fhFwQQyBJROI5B-4tQ…
#nmea0183 #iso61162 #arduino #microcontoller #c++ #tutorials #tutorial #how-to #robertssmorgasbord
3 سال پیش
در تاریخ 1400/12/22 منتشر شده
است.
892
بـار بازدید شده