* @brief This function will find specified name object from object * container. * * @param name is the specified name of object. * * @param type is the type of object * * @return the found object or RT_NULL if there is no this object * in object container. * * @note this function shall not be invoked in interrupt status. */
| 713 | * @note this function shall not be invoked in interrupt status. |
| 714 | */ |
| 715 | rt_object_t rt_object_find(const char *name, rt_uint8_t type) |
| 716 | { |
| 717 | struct _obj_find_param param = |
| 718 | { |
| 719 | .match_name = name, |
| 720 | .matched_obj = RT_NULL, |
| 721 | }; |
| 722 | |
| 723 | /* parameter check */ |
| 724 | if (name == RT_NULL || rt_object_get_information(type) == RT_NULL) |
| 725 | return RT_NULL; |
| 726 | |
| 727 | /* which is invoke in interrupt status */ |
| 728 | RT_DEBUG_NOT_IN_INTERRUPT; |
| 729 | |
| 730 | rt_object_for_each(type, _match_name, ¶m); |
| 731 | return param.matched_obj; |
| 732 | } |
| 733 | |
| 734 | /** |
| 735 | * @brief This function will return the name of the specified object container |