lf-lang / reactor-uc

A lightweight reactor runtime targeted at resource-constrained embedded systems
BSD 2-Clause "Simplified" License
3 stars 1 forks source link

Improve NetworkChannel Interface #116

Closed LasseRosenow closed 2 weeks ago

LasseRosenow commented 2 weeks ago

This PR adds the following new functions:

And the following new field:

Furthermore I improved the documentation of the network_channel.h file.

github-actions[bot] commented 2 weeks ago

Memory usage after merging this PR will be:

Memory Report ## action_microstep_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 54630 | 54630 | 0.00 | | data | 752 | 752 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 55862 | 55862 | 0.00 | ## action_overwrite_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 54316 | 54316 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 55540 | 55540 | 0.00 | ## action_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 54433 | 54433 | 0.00 | | data | 752 | 752 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 55665 | 55665 | 0.00 | ## delayed_conn_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 54866 | 54866 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 56090 | 56090 | 0.00 | ## event_payload_pool_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 18297 | 18297 | 0.00 | | data | 624 | 624 | 0.00 | | bss | 320 | 320 | 0.00 | | total | 19241 | 19241 | 0.00 | ## event_queue_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 27329 | 27329 | 0.00 | | data | 728 | 728 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 28537 | 28537 | 0.00 | ## multiple_startup_shutdown_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 53473 | 53473 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 11360 | 11360 | 0.00 | | total | 65577 | 65577 | 0.00 | ## nanopb_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 42884 | 42884 | 0.00 | | data | 904 | 904 | 0.00 | | bss | 320 | 320 | 0.00 | | total | 44108 | 44108 | 0.00 | ## physical_action_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 55594 | 55594 | 0.00 | | data | 769 | 769 | 0.00 | | bss | 10240 | 10240 | 0.00 | | total | 66603 | 66603 | 0.00 | ## port_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 54741 | 54741 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 55965 | 55965 | 0.00 | ## reaction_queue_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 27041 | 27041 | 0.00 | | data | 728 | 728 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 28249 | 28249 | 0.00 | ## request_shutdown_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 55192 | 55192 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 480 | 480 | 0.00 | | total | 56416 | 56416 | 0.00 | ## shutdown_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 52016 | 52016 | 0.00 | | data | 752 | 752 | 0.00 | | bss | 10912 | 10912 | 0.00 | | total | 63680 | 63680 | 0.00 | ## startup_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 51347 | 51347 | 0.00 | | data | 752 | 752 | 0.00 | | bss | 10688 | 10688 | 0.00 | | total | 62787 | 62787 | 0.00 | ## tcp_channel_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 58041 | 58043 | 0.00 | | data | 1176 | 1176 | 0.00 | | bss | 11072 | 11136 | 0.58 | | total | 70289 | 70355 | 0.09 | ## timer_test_c | | from | to | increase (%) | | -- | ---- | ------ | ------------ | | text | 51248 | 51248 | 0.00 | | data | 744 | 744 | 0.00 | | bss | 10720 | 10720 | 0.00 | | total | 62712 | 62712 | 0.00 |
github-actions[bot] commented 2 weeks ago

Coverage after merging network-channel-improvements into main will be

72.58%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   action.c92.59%83.33%100%94.92%24, 37, 43–46
   builtin_triggers.c90.24%70%100%96.43%14, 18, 37, 40
   connection.c80.69%53.85%100%89.69%10, 101, 107, 11, 120–121, 133–134, 14, 14, 140, 142, 17–18, 18, 18–19, 21, 23–24, 29, 44, 47, 52, 57–59, 94
   environment.c88.46%83.33%83.33%90.74%28, 35–36, 76–78, 9
   event.c94.44%90%100%95.65%10, 4
   federated.c0%0%0%0%100–102, 102, 102–103, 103, 103–105, 107, 11, 110–111, 113–117, 119, 12, 120–124, 126, 126, 126–129, 131, 131, 131–133, 133, 133–134, 138–139, 139, 139, 14, 142–143, 147–149, 15, 151, 151, 151, 153–157, 16, 160, 160, 160–163, 166–167, 167, 167–168, 17, 170–171, 174–175, 180–181, 181, 181–182, 184, 186, 186, 186–189, 189, 189, 189, 189, 19, 19, 19, 190–199, 20, 20, 20, 200–201, 205, 208, 208, 208–210, 214, 217–218, 218, 218, 218–219, 22, 22, 22, 220–226, 228, 23, 230, 234–239, 24, 24, 24, 240–241, 245–246, 248–249, 25, 251–254, 256, 256, 256–258, 26, 260, 30–31, 35–42, 42, 42–43, 43, 43–44, 44, 44, 47–48, 50–53, 55, 55, 55–58, 60, 62, 64, 64, 64–65, 67–68, 68, 68–69, 71–72, 74, 78–79, 81–83, 86, 88–93, 95–97
   logging.c73.21%60%100%75%24, 24–27, 37–39, 46, 46–49, 59–60
   port.c90.91%58.33%100%100%10, 15, 19, 24–25
   queues.c91.12%82.14%100%95.05%107, 112, 118, 21–23, 46–47, 59–60, 83–87
   reaction.c90.41%75%100%97.78%18, 20, 24, 43–44, 54, 56
   reactor.c81.43%60%100%89.13%20–21, 21, 21–22, 38, 43–44, 44, 44–45, 60–61
   scheduler.c81.79%67.05%94.12%87.02%102, 104, 104, 111, 125, 174, 177, 177, 177–180, 182–183, 183, 183–184, 204, 224–225, 231–233, 27, 277–278, 282, 286–287, 305, 31, 52–54, 54, 54–56, 56, 56, 58, 58, 58–59, 61–62, 62, 62–63, 69–72, 80–81, 85
   serialization.c50%50%50%50%16–17, 26–27, 33–35, 38–40
   tag.c40.19%31.48%60%47.92%14, 14–15, 17, 17–18, 23–24, 24, 24, 24, 24–25, 27, 27, 27, 27, 27–28, 30, 30, 30–31, 33–34, 34, 34–35, 37, 37, 37, 37, 37–38, 40, 40, 40, 40, 40–41, 43, 53–54, 63, 63–64, 83–85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85–87, 89
   timer.c94.59%66.67%100%100%14, 25
   trigger.c100%100%100%100%
src/platform/posix
   posix.c79.41%55.56%85.71%84.29%100, 16, 18, 20–21, 34–36, 38–40, 48–49, 62, 67, 79, 82, 88, 94
   tcp_ip_channel.c61.82%50%85.71%65.94%103, 105, 105, 105–107, 109–110, 110, 110–111, 111, 111–112, 114–115, 117, 117, 117, 119–120, 122–123, 127, 129–130, 130, 130–131, 133, 133, 133–134, 136, 144, 151, 156–157, 162–165, 170–171, 171, 171–174, 174, 174–177, 179–182, 184, 184, 184–186, 188–191, 194, 222–224, 231, 236–238, 246, 246–248, 25–26, 26, 26–27, 274–275, 275, 275–276, 28, 281–282, 299–300, 304–305, 316, 319, 32, 324, 33–34, 343–344, 347–348, 354–355, 368, 37, 370, 374–375, 38, 389, 39, 390, 394–395, 399–400, 60–61, 66–67, 71–72, 92, 92, 92, 96–97