From b61031a2343dfdd179748a3873bf31a1961fe230 Mon Sep 17 00:00:00 2001 From: PatrickDekker98 Date: Tue, 28 May 2019 13:54:47 +0200 Subject: [PATCH 1/5] added a frame for a rtttl string --- code/headers/frame_types.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/headers/frame_types.hpp b/code/headers/frame_types.hpp index 3f2387b..63a30ea 100644 --- a/code/headers/frame_types.hpp +++ b/code/headers/frame_types.hpp @@ -35,6 +35,7 @@ namespace r2d2 { COMMAND_ID, TEMPERATURE, GAS, + RTTTL_STRING, // Don't touch EXTERNAL, @@ -545,6 +546,17 @@ namespace r2d2 { // For example: 0 is LPG, 1 is Co, 2 is smoke. uint8_t gas_id; }; + + /* + * This is a frame that will be send to the sound module. + * It contains a simple rtttl string + * this was not my idea either + */ + R2D2_PACK_STRUCT + struct frame_rtttl_string_s { + //the rtttl string to be send + char rtttl_string[248]; + }; R2D2_INTERNAL_FRAME_HELPER(frame_button_state_s, BUTTON_STATE) R2D2_INTERNAL_FRAME_HELPER(frame_activity_led_state_s, ACTIVITY_LED_STATE) @@ -610,4 +622,6 @@ namespace r2d2 { ) R2D2_INTERNAL_FRAME_HELPER(frame_temperature_s, TEMPERATURE) + + R2D2_INTERNAL_FRAME_HELPER(frame_rtttl_string_s, RTTTL_STRING) } From 419377b1193655fd9103953c69c7fd2169d21cb7 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 29 May 2019 08:39:26 +0200 Subject: [PATCH 2/5] changes requested in pr --- code/headers/frame_types.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/headers/frame_types.hpp b/code/headers/frame_types.hpp index 05ac860..98067f3 100644 --- a/code/headers/frame_types.hpp +++ b/code/headers/frame_types.hpp @@ -551,13 +551,13 @@ namespace r2d2 { }; /* - * This is a frame that will be send to the sound module. - * It contains a simple rtttl string + * @brief This is a frame that will be send to the sound module. + * @details It contains a simple rtttl string * this was not my idea either */ R2D2_PACK_STRUCT struct frame_rtttl_string_s { - //the rtttl string to be send + // the rtttl string to be send char rtttl_string[248]; }; /* From 4de85d6c2d3971523637f3015fe160b51c9211dd Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 29 May 2019 16:24:20 +0200 Subject: [PATCH 3/5] added string optimisation for the rtttl-frame --- code/headers/frame_types.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/headers/frame_types.hpp b/code/headers/frame_types.hpp index 98067f3..c140da8 100644 --- a/code/headers/frame_types.hpp +++ b/code/headers/frame_types.hpp @@ -670,7 +670,11 @@ namespace r2d2 { R2D2_INTERNAL_FRAME_HELPER(frame_temperature_s, TEMPERATURE) - R2D2_INTERNAL_FRAME_HELPER(frame_rtttl_string_s, RTTTL_STRING) + R2D2_INTERNAL_FRAME_HELPER( + frame_rtttl_string_s, + RTTTL_STRING, + R2D2_OPTIMISE_STRING(frame_rtttl_string_s, rtttl_string) + ) R2D2_INTERNAL_FRAME_HELPER( frame_request_map_obstacles_s, From 41c23a9c441018de01beb3cb3e6ec878a5cd35e9 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 3 Jun 2019 11:12:38 +0200 Subject: [PATCH 4/5] changes requested for pr --- code/headers/frame_types.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/headers/frame_types.hpp b/code/headers/frame_types.hpp index c140da8..cb2e420 100644 --- a/code/headers/frame_types.hpp +++ b/code/headers/frame_types.hpp @@ -553,13 +553,13 @@ namespace r2d2 { /* * @brief This is a frame that will be send to the sound module. * @details It contains a simple rtttl string - * this was not my idea either */ R2D2_PACK_STRUCT struct frame_rtttl_string_s { // the rtttl string to be send char rtttl_string[248]; }; + /* * This frame will be sent from the navigation module. * Refer to the wiki for more information: @@ -671,10 +671,10 @@ namespace r2d2 { R2D2_INTERNAL_FRAME_HELPER(frame_temperature_s, TEMPERATURE) R2D2_INTERNAL_FRAME_HELPER( - frame_rtttl_string_s, - RTTTL_STRING, - R2D2_OPTIMISE_STRING(frame_rtttl_string_s, rtttl_string) - ) + frame_rtttl_string_s, + RTTTL_STRING, + R2D2_OPTIMISE_STRING(frame_rtttl_string_s, rtttl_string) + ) R2D2_INTERNAL_FRAME_HELPER( frame_request_map_obstacles_s, From 698580f4d3c3b3d53bddab3da102066b786d3009 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 4 Jun 2019 12:36:58 +0200 Subject: [PATCH 5/5] removed doxygen @brief and @detail, added wiki link --- code/headers/frame_types.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/headers/frame_types.hpp b/code/headers/frame_types.hpp index c6e379b..a352be2 100644 --- a/code/headers/frame_types.hpp +++ b/code/headers/frame_types.hpp @@ -629,8 +629,9 @@ namespace r2d2 { }; /* - * @brief This is a frame that will be send to the sound module. - * @details It contains a simple rtttl string + * This is a frame that will be send to the sound module. + * It contains a simple rtttl string + * wiki page: https://github.com/R2D2-2019/R2D2-2019/wiki/Sound-playback */ R2D2_PACK_STRUCT struct frame_rtttl_string_s {