Skip to content

Replace cssl_lib with serialclass and eliminate cssl_lib #84

Description

@ejpilger

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions