Skip to content

Commit f616bf2

Browse files
bridadan0xc0170
authored andcommitted
Adding comments for added Greentea function
1 parent c38b709 commit f616bf2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

features/frameworks/greentea-client/source/greentea_test_env.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ static void greentea_notify_completion(const int);
6060
static void greentea_notify_version();
6161
static void greentea_write_string(const char *str);
6262

63-
63+
/** \brief Handle the handshake with the host
64+
* \details This is contains the shared handhshake functionality that is used between
65+
* GREENTEA_SETUP and GREENTEA_SETUP_UUID.
66+
* This function is blocking.
67+
*/
6468
void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) {
6569
greentea_metrics_setup();
6670
// Key-value protocol handshake function. Waits for {{__sync;...}} message
@@ -73,7 +77,7 @@ void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char
7377
greentea_parse_kv(_key, buffer, sizeof(_key), size);
7478
greentea_write_string("mbedmbedmbedmbedmbedmbedmbedmbed\r\n");
7579
if (strcmp(_key, GREENTEA_TEST_ENV_SYNC) == 0) {
76-
// Found correct __sunc message
80+
// Found correct __sync message
7781
greentea_send_kv(_key, buffer);
7882
break;
7983
}
@@ -95,11 +99,13 @@ void GREENTEA_SETUP(const int timeout, const char *host_test_name) {
9599
_GREENTEA_SETUP_COMMON(timeout, host_test_name, _value, GREENTEA_UUID_LENGTH);
96100
}
97101

98-
/** \brief Handshake with host and send setup data (timeout and host test name)
102+
/** \brief Handshake with host and send setup data (timeout and host test name). Allows you to preserve sync UUID.
99103
* \details This function will send preamble to master.
100104
* After host test name is received master will invoke host test script
101105
* and add hos test's callback handlers to main event loop
102106
* This function is blocking.
107+
* This function differs from GREENTEA_SETUP because it allows you to
108+
* preserve the UUID sent during the sync process.
103109
*/
104110
void GREENTEA_SETUP_UUID(const int timeout, const char *host_test_name, char *buffer, size_t size) {
105111
_GREENTEA_SETUP_COMMON(timeout, host_test_name, buffer, size);

0 commit comments

Comments
 (0)