Bird
0
0

How should you correctly invoke vTaskList() to store the task status information in a character array named taskInfo?

easy📝 Syntax Q3 of 15
FreeRTOS - Debugging and Monitoring
How should you correctly invoke vTaskList() to store the task status information in a character array named taskInfo?
AvTaskList(taskInfo);
BvTaskList(&taskInfo);
CvTaskList();
DvTaskList(&taskInfo[0], sizeof(taskInfo));
Step-by-Step Solution
Solution:
  1. Step 1: Check function prototype

    vTaskList() takes a single parameter: a pointer to a character buffer.
  2. Step 2: Passing the buffer

    Passing taskInfo (an array) decays to a pointer to its first element, which is correct.
  3. Step 3: Incorrect options

    Passing &taskInfo is a pointer to the array, not a char pointer. Calling without parameters is invalid. Passing size is not supported by vTaskList().
  4. Final Answer:

    vTaskList(taskInfo); -> Option A
  5. Quick Check:

    Remember, arrays decay to pointers when passed to functions [OK]
Quick Trick: Pass buffer name directly to vTaskList() [OK]
Common Mistakes:
  • Passing address of array instead of array name
  • Calling vTaskList without parameters
  • Trying to pass buffer size to vTaskList

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes