Skip to content
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

✨ (rc): Start BLE + Start Battery Service #508

Merged
merged 2 commits into from
Mar 10, 2022

Conversation

YannLocatelli
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 28, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 137588 (52%) 124556 (47%) 29360 (5%)
os 183784 (11%) 1380888 (88%) 29528 (5%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 88648 (4%)
183784 (8%)
📈
95136 (107%)
18352 (3%)
29528 (5%)
📈
11176 (60%)
bootloader ✔️ 137588 (6%) ø 29360 (5%) ø
certs_emc_ble_bt_lcd_led_motors ✔️ 256744 (12%) ø 35272 (6%) ø
certs_emc_ble_led_motors ✔️ 191600 (9%) ø 30976 (5%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 165248 (7%) ø 28680 (5%) ø
certs_emc_lcd_led_motors ✔️ 91928 (4%) ø 16168 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 194032 (9%) ø 30384 (5%) ø
spike_lk_ble ✔️ 182392 (8%) ø 29304 (5%) ø
spike_lk_bluetooth ✔️ 91192 (4%) ø 17472 (3%) ø
spike_lk_cg_animations ✔️ 149384 (7%) ø 30464 (5%) ø
spike_lk_color_kit ✔️ 88800 (4%) ø 19624 (3%) ø
spike_lk_coreled ✔️ 88556 (4%) ø 19632 (3%) ø
spike_lk_event_queue ✔️ 84664 (4%) ø 18136 (3%) ø
spike_lk_file_reception ✔️ 330236 (15%) ø 33536 (6%) ø
spike_lk_filesystem_kit ✔️ 125964 (6%) ø 20216 (3%) ø
spike_lk_flash_memory ✔️ 87352 (4%) ø 17512 (3%) ø
spike_lk_lcd ✔️ 149792 (7%) ø 30096 (5%) ø
spike_lk_led ✔️ 88808 (4%) ø 19400 (3%) ø
spike_lk_led_kit ✔️ 109636 (5%) ø 20648 (3%) ø
spike_lk_log_kit ✔️ 92000 (4%) ø 18168 (3%) ø
spike_lk_motors ✔️ 86576 (4%) ø 17552 (3%) ø
spike_lk_rfid ✔️ 91008 (4%) ø 17472 (3%) ø
spike_lk_sensors_battery ✔️ 87600 (4%) ø 18584 (3%) ø
spike_lk_sensors_light ✔️ 84584 (4%) ø 17512 (3%) ø
spike_lk_sensors_microphone ✔️ 85336 (4%) ø 17512 (3%) ø
spike_lk_sensors_temperature_humidity ✔️ 90896 (4%) ø 17496 (3%) ø
spike_lk_sensors_touch ✔️ 92248 (4%) ø 17632 (3%) ø
spike_lk_ticker_timeout ✔️ 83224 (3%) ø 17592 (3%) ø
spike_lk_update_process_app_base ✔️ 143764 (6%) ø 21352 (4%) ø
spike_lk_update_process_app_update ✔️ 100968 (4%) ø 18472 (3%) ø
spike_lk_wifi ✔️ 131280 (6%) ø 20832 (3%) ø
spike_mbed_blinky ✔️ 57968 (2%) ø 11400 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 84688 (4%) ø 18448 (3%) ø
spike_stl_cxxsupport ✔️ 84000 (4%) ø 17536 (3%) ø

🗺️ Map files diff output

Click to show diff list
LekaOS (click to expand)
--- build_artifacts/base_ref-build-enable_log_debug-ON/LekaOS-map.txt	2022-03-10 14:50:33.299161272 +0000
+++ build_artifacts/head_ref-build-enable_log_debug-ON/LekaOS-map.txt	2022-03-10 14:50:33.551162428 +0000
@@ -1,19 +1,21 @@
-| Module                  |         .text |       .data |          .bss |
-|-------------------------|---------------|-------------|---------------|
-| [fill]                  |     168(+168) |       8(+8) |       30(+30) |
-| [lib]/CoreBattery.a     |     472(+472) |       0(+0) |         0(+0) |
-| [lib]/CoreTimeout.a     |     204(+204) |       0(+0) |         0(+0) |
-| [lib]/CriticalSection.a |         8(+8) |       0(+0) |         0(+0) |
-| [lib]/HelloWorld.a      |       94(+94) |       0(+0) |         0(+0) |
-| [lib]/c.a               | 26052(+26052) | 2472(+2472) |       58(+58) |
-| [lib]/gcc.a             |   7148(+7148) |       0(+0) |         0(+0) |
-| [lib]/m.a               |     360(+360) |       0(+0) |         0(+0) |
-| [lib]/mbed-os-static.a  | 34406(+34406) |   444(+444) |   8716(+8716) |
-| [lib]/misc              |     188(+188) |       4(+4) |       28(+28) |
-| [lib]/nosys.a           |       32(+32) |       0(+0) |         0(+0) |
-| [lib]/stdc++.a          |   5424(+5424) |       8(+8) |       44(+44) |
-| main.cpp.obj            |   3736(+3736) |       0(+0) |   6252(+6252) |
-| Subtotals               | 78292(+78292) | 2936(+2936) | 15128(+15128) |
-Total Static RAM memory (data + bss): 18064(+18064) bytes
-Total Flash memory (text + data): 81228(+81228) bytes
+| Module                  |           .text |       .data |          .bss |
+|-------------------------|-----------------|-------------|---------------|
+| [fill]                  |       376(+376) |     11(+11) |       74(+74) |
+| [lib]/BLEKit.a          |       914(+914) |       0(+0) |         0(+0) |
+| [lib]/CoreBattery.a     |       472(+472) |       0(+0) |         0(+0) |
+| [lib]/CoreEventQueue.a  |       172(+172) |       0(+0) |         0(+0) |
+| [lib]/CoreTimeout.a     |       204(+204) |       0(+0) |         0(+0) |
+| [lib]/CriticalSection.a |           8(+8) |       0(+0) |         0(+0) |
+| [lib]/HelloWorld.a      |         94(+94) |       0(+0) |         0(+0) |
+| [lib]/c.a               |   26152(+26152) | 2472(+2472) |       58(+58) |
+| [lib]/gcc.a             |     7148(+7148) |       0(+0) |         0(+0) |
+| [lib]/m.a               |       360(+360) |       0(+0) |         0(+0) |
+| [lib]/mbed-os-static.a  | 121118(+121118) |   689(+689) | 19160(+19160) |
+| [lib]/misc              |       188(+188) |       4(+4) |       28(+28) |
+| [lib]/nosys.a           |         32(+32) |       0(+0) |         0(+0) |
+| [lib]/stdc++.a          |     5424(+5424) |       8(+8) |       44(+44) |
+| main.cpp.obj            |     4078(+4078) |       0(+0) |   6692(+6692) |
+| Subtotals               | 166740(+166740) | 3184(+3184) | 26056(+26056) |
+Total Static RAM memory (data + bss): 29240(+29240) bytes
+Total Flash memory (text + data): 169924(+169924) bytes
 
Flash used: 183784 (8%) / total: 2097152
SRAM used: 29528 (5%) / total: 524288

@github-actions
Copy link

github-actions bot commented Feb 28, 2022

File comparision analysis report

🔖 Info

Target Flash Used (%) Flash Available (%) Static RAM (%)
bootloader 137588 (52%) 124556 (47%) 29360 (5%)
os 174340 (11%) 1390332 (88%) 23512 (4%)
Click to show memory sections
| -          |      Hex |     Bytes |  KiB |
|------------|---------:|----------:|-----:|
| Flash      | 0x200000 | 2 097 152 | 2048 |
| SRAM       |  0x80000 |   524 288 |  512 |
| Bootloader |  0x40000 |   262 144 |  256 |
| Header     |   0x1000 |     4 096 |    4 |
| OS         | 0x17E000 | 1 564 672 | 1528 |
| Tail       |   0x1000 |     4 096 |    4 |
| Scratch    |  0x40000 |   262 144 |  256 |

📝 Summary

Click to show summary
  • ✔️ - existing target
  • ✨ - new target
  • ⚰️ - deleted target
  • ✅ - files are the same
  • ❌ - files are different
Target Status .bin .map Total Flash (base/head) Total Flash Δ Static RAM (base/head) Static RAM Δ
LekaOS ✔️ 74772 (3%)
174340 (8%)
📈
99568 (133%)
12328 (2%)
23512 (4%)
📈
11184 (90%)
bootloader ✔️ 137588 (6%) ø 29360 (5%) ø
certs_emc_ble_bt_lcd_led_motors ✔️ 249184 (11%) ø 29240 (5%) ø
certs_emc_ble_led_motors ✔️ 174568 (8%) ø 24952 (4%) ø
certs_emc_bt_lcd_qspi_rfid_touch_wifi ✔️ 148840 (7%) ø 22528 (4%) ø
certs_emc_lcd_led_motors ✔️ 91928 (4%) ø 16168 (3%) ø
hardware_motors_test_reduction_and_wheels ✔️ 177960 (8%) ø 24360 (4%) ø
spike_lk_ble ✔️ 173124 (8%) ø 23352 (4%) ø
spike_lk_bluetooth ✔️ 73256 (3%) ø 11448 (2%) ø
spike_lk_cg_animations ✔️ 141112 (6%) ø 24464 (4%) ø
spike_lk_color_kit ✔️ 65584 (3%) ø 13624 (2%) ø
spike_lk_coreled ✔️ 76164 (3%) ø 13688 (2%) ø
spike_lk_event_queue ✔️ 74736 (3%) ø 12072 (2%) ø
spike_lk_file_reception ✔️ 325528 (15%) ø 27576 (5%) ø
spike_lk_filesystem_kit ✔️ 102100 (4%) ø 14048 (2%) ø
spike_lk_flash_memory ✔️ 63880 (3%) ø 11448 (2%) ø
spike_lk_lcd ✔️ 136976 (6%) ø 24024 (4%) ø
spike_lk_led ✔️ 65744 (3%) ø 13392 (2%) ø
spike_lk_led_kit ✔️ 100428 (4%) ø 14640 (2%) ø
spike_lk_log_kit ✔️ 68528 (3%) ø 11912 (2%) ø
spike_lk_motors ✔️ 62528 (2%) ø 11488 (2%) ø
spike_lk_rfid ✔️ 73072 (3%) ø 11448 (2%) ø
spike_lk_sensors_battery ✔️ 78196 (3%) ø 12568 (2%) ø
spike_lk_sensors_light ✔️ 60056 (2%) ø 11440 (2%) ø
spike_lk_sensors_microphone ✔️ 72496 (3%) ø 11504 (2%) ø
spike_lk_sensors_temperature_humidity ✔️ 66968 (3%) ø 11424 (2%) ø
spike_lk_sensors_touch ✔️ 68600 (3%) ø 11432 (2%) ø
spike_lk_ticker_timeout ✔️ 69052 (3%) ø 11632 (2%) ø
spike_lk_update_process_app_base ✔️ 121348 (5%) ø 15288 (2%) ø
spike_lk_update_process_app_update ✔️ 77632 (3%) ø 12352 (2%) ø
spike_lk_wifi ✔️ 116392 (5%) ø 14808 (2%) ø
spike_mbed_blinky ✔️ 57968 (2%) ø 11400 (2%) ø
spike_mbed_watchdog_ticker_vs_thread ✔️ 63208 (3%) ø 12448 (2%) ø
spike_stl_cxxsupport ✔️ 58456 (2%) ø 11400 (2%) ø

🗺️ Map files diff output

Click to show diff list
LekaOS (click to expand)
--- build_artifacts/base_ref-build-enable_log_debug-OFF/LekaOS-map.txt	2022-03-10 14:50:33.290722657 +0000
+++ build_artifacts/head_ref-build-enable_log_debug-OFF/LekaOS-map.txt	2022-03-10 14:50:33.538724942 +0000
@@ -1,17 +1,19 @@
-| Module                 |         .text |       .data |        .bss |
-|------------------------|---------------|-------------|-------------|
-| [fill]                 |     132(+132) |       8(+8) |     30(+30) |
-| [lib]/CoreBattery.a    |     472(+472) |       0(+0) |       0(+0) |
-| [lib]/CoreTimeout.a    |     204(+204) |       0(+0) |       0(+0) |
-| [lib]/HelloWorld.a     |       94(+94) |       0(+0) |       0(+0) |
-| [lib]/c.a              | 26028(+26028) | 2472(+2472) |     58(+58) |
-| [lib]/gcc.a            |   6924(+6924) |       0(+0) |       0(+0) |
-| [lib]/mbed-os-static.a | 26716(+26716) |   444(+444) | 8668(+8668) |
-| [lib]/misc             |     188(+188) |       4(+4) |     28(+28) |
-| [lib]/nosys.a          |       32(+32) |       0(+0) |       0(+0) |
-| [lib]/stdc++.a         |   4116(+4116) |       8(+8) |     28(+28) |
-| main.cpp.obj           |   1434(+1434) |       0(+0) |   292(+292) |
-| Subtotals              | 66340(+66340) | 2936(+2936) | 9104(+9104) |
-Total Static RAM memory (data + bss): 12040(+12040) bytes
-Total Flash memory (text + data): 69276(+69276) bytes
+| Module                 |           .text |       .data |          .bss |
+|------------------------|-----------------|-------------|---------------|
+| [fill]                 |       370(+370) |     11(+11) |       70(+70) |
+| [lib]/BLEKit.a         |       914(+914) |       0(+0) |         0(+0) |
+| [lib]/CoreBattery.a    |       472(+472) |       0(+0) |         0(+0) |
+| [lib]/CoreEventQueue.a |       204(+204) |       0(+0) |         0(+0) |
+| [lib]/CoreTimeout.a    |       204(+204) |       0(+0) |         0(+0) |
+| [lib]/HelloWorld.a     |         94(+94) |       0(+0) |         0(+0) |
+| [lib]/c.a              |   26128(+26128) | 2472(+2472) |       58(+58) |
+| [lib]/gcc.a            |     7084(+7084) |       0(+0) |         0(+0) |
+| [lib]/mbed-os-static.a | 117594(+117594) |   689(+689) | 19124(+19124) |
+| [lib]/misc             |       188(+188) |       4(+4) |       28(+28) |
+| [lib]/nosys.a          |         32(+32) |       0(+0) |         0(+0) |
+| [lib]/stdc++.a         |     4116(+4116) |       8(+8) |       28(+28) |
+| main.cpp.obj           |     1772(+1772) |       0(+0) |     732(+732) |
+| Subtotals              | 159172(+159172) | 3184(+3184) | 20040(+20040) |
+Total Static RAM memory (data + bss): 23224(+23224) bytes
+Total Flash memory (text + data): 162356(+162356) bytes
 
Flash used: 174340 (8%) / total: 2097152
SRAM used: 23512 (4%) / total: 524288

@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch from bc8280c to da4d16d Compare February 28, 2022 22:35
@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #508 (3bd95f0) into develop (e5b8e96) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 3bd95f0 differs from pull request most recent head f6b5006. Consider uploading reports for the commit f6b5006 to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##           develop      #508   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          101        96    -5     
  Lines         1566      1475   -91     
=========================================
- Hits          1566      1475   -91     
Impacted Files Coverage Δ
libs/RobotKit/include/RobotController.h 100.00% <100.00%> (ø)
libs/FileSystemKit/source/File.cpp 100.00% <0.00%> (ø)
libs/FileSystemKit/include/FileSystemKit.h 100.00% <0.00%> (ø)
drivers/CoreEventQueue/include/CoreEventQueue.h 100.00% <0.00%> (ø)
libs/WebKit/include/WebKit.h
include/interface/drivers/Network.h
libs/WebKit/source/WebKit.cpp
libs/BatteryKit/source/BatteryKit.cpp
libs/BatteryKit/include/BatteryKit.h

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5b8e96...f6b5006. Read the comment docs.

@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch from da4d16d to d4b8347 Compare March 1, 2022 09:59
@YannLocatelli YannLocatelli marked this pull request as ready for review March 1, 2022 10:12
@YannLocatelli YannLocatelli reopened this Mar 1, 2022
@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch 3 times, most recently from 9cfef5d to 347b790 Compare March 5, 2022 21:20
Copy link
Member

@ladislas ladislas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 juste une petite question sur les init functions qui me font toujours un peu peur --> le constructeur devrait pouvoir faire tout ce qu'elles font, sans avoir à les appeler.

@@ -27,11 +29,12 @@ class RobotController : public interface::RobotController

void raise(auto event) { state_machine.process_event(event); };

void initializeComponents() { _ble.init(); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce qu'on peut pas le faire dans le constructeur? plutôt que d'appeler une fonction qu'on peut oublier d'appeler ? ou alors le ctor appelle la fonction privée initializeComponents.

je me pose la même question pour registerEvents

Copy link
Member Author

@YannLocatelli YannLocatelli Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a déjà eu dans le passé des cas où le constructeur qui devait appeler des méthodes privées ne le faisait pas à l'exécution. On peut reprendre le pari d'essayer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a déjà eu dans le passé des cas où le constructeur qui devait appeler des méthodes privées ne le faisait pas à l'exécution

on se souvient desquels et de pourquoi ça marchait pas?

ça serait intéressant de comprendre pourquoi, s'il fallait modifier un truc de notre côté ou si c'est "comme ça".

si pas le choix, on vivra avec. mais si c'est possible, ça rend l'interface et l'utilisation beaucoup plus simple et propre.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je vais essayer de reproduire le phénomène

On avait pris le parti d'être explicite et d'appeler les méthodes qui fallait plutôt qu'implicite comme pourrait l'être un nom de méthode générique init();

Il peut y avoir une réponse du côté de most vexing parse [Source 1] [Source 2]

Copy link
Member Author

@YannLocatelli YannLocatelli Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Après, c'est aussi pour les tests: c'est plus simple de focaliser sur ce qu'on attend de chaque fonctions au lieu d'avoir tous les appels et de devoir faire un EXPECT_CALL pour les unexpected calls

On peut les garder sous forme de fonctions, mais ça peut prêter à confusion d'avoir des fonctions publique qu'on appelle pas dans l'exécution du programme et uniquement en test

Edit. En fait c'est aussi le cas pour toutes les autres méthodes de RobotController, des méthodes qui ne sont appelées que par les tests et pas dans le main.cpp. Donc ça ne gênera pas d'avoir des méthodes publiques non appelé dans main.cpp

Copy link
Member Author

@YannLocatelli YannLocatelli Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aussi, il semblerait que les tests soient aussi cassés

Même si les EXPECT_CALL sont définis, ils ne sont pas bien pris en compte à l'exécution des tests et on se retrouve avec 2 types d'erreurs: d'un côté il y a des uninterresting calls et de l'autre des EXPECTED_CALL qui ne sont pas appelés.

Je vais voir s'il y a quelque chose à faire, dans ce cas je supprimerai ce commentaire

Edit. J'ai une solution, mais elle n'est pas très "propre" puisqu'elle impose 2 lignes supplémentaires dans chaque test.

@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch from 3bd95f0 to dfb719d Compare March 10, 2022 08:24
@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch from dfb719d to 2a44e1a Compare March 10, 2022 14:37
@YannLocatelli YannLocatelli force-pushed the yann/feature/robot-controller/start-ble branch from 2a44e1a to f6b5006 Compare March 10, 2022 14:43
@sonarcloud
Copy link

sonarcloud bot commented Mar 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@ladislas ladislas merged commit 2685f5f into develop Mar 10, 2022
@ladislas ladislas deleted the yann/feature/robot-controller/start-ble branch March 10, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants