MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_object_find

Function rt_object_find

src/object.c:715–732  ·  view source on GitHub ↗

* @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. */

Source from the content-addressed store, hash-verified

713 * @note this function shall not be invoked in interrupt status.
714 */
715rt_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, &param);
731 return param.matched_obj;
732}
733
734/**
735 * @brief This function will return the name of the specified object container

Callers 6

rt_device_findFunction · 0.85
dlmodule_findFunction · 0.85
camera_sampleFunction · 0.85
rt_thread_findFunction · 0.85
generate_unique_nameFunction · 0.85

Calls 2

rt_object_for_eachFunction · 0.85

Tested by 1