Getting a tasks name from the Task ID?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting a tasks name from the Task ID?

564 Views
ironsean
Contributor V

Did some searching through the community and the docs, but I haven't seen anything yet.

Is it possible to find the task name using just the Task ID?

More info:
I'm trying to create a simple error logging task to log errors onto an SD card. I had the idea that instead of making MFS available to multiple tasks and dealing with potential concurrent writes, I could instead have a single error logging task, with a lw-message queue to act as input. It's pretty simple to pass an error code and taskID to that logging task, but would like to be able to parse that back into the task name before I write it to the file.

Thanks,

Sean

2 Replies

398 Views
danielchen
NXP TechSupport
NXP TechSupport

HI Sean:

I think you can use the function "_task_get_template_ptr", the input is task id, the output is template, and the task name is an element of the template.


Have a nice day,
Daniel

398 Views
ironsean
Contributor V

Thanks, I'm giving that a try now.

Also, I've noticed there's an undocumented (that I can find) MFS_Error_text() function that takes an error code and returns a text string of the MFS error. Do you happen to know if there is anything else similar, or a more generic function in MQX?

Sean

0 Kudos