Adding comments for added Greentea function

pull/4369/head
Brian Daniels 2017-05-22 19:18:28 -05:00 committed by Martin Kojtal
parent c38b709685
commit f616bf28f6
1 changed files with 9 additions and 3 deletions

View File

@ -60,7 +60,11 @@ static void greentea_notify_completion(const int);
static void greentea_notify_version(); static void greentea_notify_version();
static void greentea_write_string(const char *str); static void greentea_write_string(const char *str);
/** \brief Handle the handshake with the host
* \details This is contains the shared handhshake functionality that is used between
* GREENTEA_SETUP and GREENTEA_SETUP_UUID.
* This function is blocking.
*/
void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) { void _GREENTEA_SETUP_COMMON(const int timeout, const char *host_test_name, char *buffer, size_t size) {
greentea_metrics_setup(); greentea_metrics_setup();
// Key-value protocol handshake function. Waits for {{__sync;...}} message // 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
greentea_parse_kv(_key, buffer, sizeof(_key), size); greentea_parse_kv(_key, buffer, sizeof(_key), size);
greentea_write_string("mbedmbedmbedmbedmbedmbedmbedmbed\r\n"); greentea_write_string("mbedmbedmbedmbedmbedmbedmbedmbed\r\n");
if (strcmp(_key, GREENTEA_TEST_ENV_SYNC) == 0) { if (strcmp(_key, GREENTEA_TEST_ENV_SYNC) == 0) {
// Found correct __sunc message // Found correct __sync message
greentea_send_kv(_key, buffer); greentea_send_kv(_key, buffer);
break; break;
} }
@ -95,11 +99,13 @@ void GREENTEA_SETUP(const int timeout, const char *host_test_name) {
_GREENTEA_SETUP_COMMON(timeout, host_test_name, _value, GREENTEA_UUID_LENGTH); _GREENTEA_SETUP_COMMON(timeout, host_test_name, _value, GREENTEA_UUID_LENGTH);
} }
/** \brief Handshake with host and send setup data (timeout and host test name) /** \brief Handshake with host and send setup data (timeout and host test name). Allows you to preserve sync UUID.
* \details This function will send preamble to master. * \details This function will send preamble to master.
* After host test name is received master will invoke host test script * After host test name is received master will invoke host test script
* and add hos test's callback handlers to main event loop * and add hos test's callback handlers to main event loop
* This function is blocking. * This function is blocking.
* This function differs from GREENTEA_SETUP because it allows you to
* preserve the UUID sent during the sync process.
*/ */
void GREENTEA_SETUP_UUID(const int timeout, const char *host_test_name, char *buffer, size_t size) { void GREENTEA_SETUP_UUID(const int timeout, const char *host_test_name, char *buffer, size_t size) {
_GREENTEA_SETUP_COMMON(timeout, host_test_name, buffer, size); _GREENTEA_SETUP_COMMON(timeout, host_test_name, buffer, size);