cssl_lib (C-style serial API, micro-agent layer) and serialclass (C++ Serial class, kernel layer) cover the same functionality. The APIs map 1-to-1:
| cssl_lib |
serialclass |
cssl_open() |
Serial(name, baud, …) + open_device() |
cssl_close() |
close_device() |
cssl_setup() |
set_params(), change_baud() |
cssl_setflowcontrol() |
set_flowcontrol() |
cssl_settimeout() |
set_timeout() |
cssl_putchar/string/data/slip/nmea() |
put_char/string/data/slip/nmea() |
cssl_getchar/data/slip/nmea/xmodem() |
get_char/data/slip/nmea/xmodem() |
cssl_drain() |
drain() |
cssl_geterror() |
get_error() |
serialclass is also richer, adding set_dtr(), set_rts(), get_cts(), poll_char().
Consumers to migrate (all in device libs):
arduino_lib (micro-agent)
gs232b_lib, kisstnc_lib, kpc9612p_lib, mixwtnc_lib, pic_lib, ts2000_lib (ground-station)
bbFctns — cssl_lib already commented out, no change needed
Benefit: serialclass lives in kernel (Layer 0). After migration, these device libs depend on kernel directly rather than micro-agent. cssl_lib and the CosmosCssl CMake target can be removed entirely.
Approach: For each consumer, replace cssl_t* handle and cssl_* function calls with a Cosmos::Serial member and the equivalent method calls. The refactoring is mechanical.
cssl_lib(C-style serial API, micro-agent layer) andserialclass(C++ Serial class, kernel layer) cover the same functionality. The APIs map 1-to-1:cssl_open()Serial(name, baud, …)+open_device()cssl_close()close_device()cssl_setup()set_params(),change_baud()cssl_setflowcontrol()set_flowcontrol()cssl_settimeout()set_timeout()cssl_putchar/string/data/slip/nmea()put_char/string/data/slip/nmea()cssl_getchar/data/slip/nmea/xmodem()get_char/data/slip/nmea/xmodem()cssl_drain()drain()cssl_geterror()get_error()serialclassis also richer, addingset_dtr(),set_rts(),get_cts(),poll_char().Consumers to migrate (all in device libs):
arduino_lib(micro-agent)gs232b_lib,kisstnc_lib,kpc9612p_lib,mixwtnc_lib,pic_lib,ts2000_lib(ground-station)bbFctns— cssl_lib already commented out, no change neededBenefit:
serialclasslives inkernel(Layer 0). After migration, these device libs depend on kernel directly rather than micro-agent.cssl_liband theCosmosCsslCMake target can be removed entirely.Approach: For each consumer, replace
cssl_t*handle andcssl_*function calls with aCosmos::Serialmember and the equivalent method calls. The refactoring is mechanical.