同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Related Modules:
Description:
Provides functions for obtaining information about the device resource configuration tree.
This structure provides functions for obtaining information about the device resource configuration tree, including the root node, the unit attribute data, and the String attribute data.
Since:
1.0
Version:
1.0
GetRootNode )(void) |
const struct DeviceResourceNode *(* |
GetBool )(const struct DeviceResourceNode *node, const char *attrName) |
Obtains the value of a BOOL attribute of a configuration tree node. |
GetUint8 )(const struct DeviceResourceNode *node, const char *attrName, uint8_t *value, uint8_t def) |
Obtains the value of a Uint8 attribute of a configuration tree node. |
GetUint8ArrayElem )(const struct DeviceResourceNode *node, const char *attrName, uint32_t index, uint8_t *value, uint8_t def) |
Obtains the value of a Unit8 array attribute numbered index of a configuration tree node. |
GetUint8Array )(const struct DeviceResourceNode *node, const char *attrName, uint8_t *value, uint32_t len, uint8_t def) |
Obtains the values of a Uint8 array attribute of a configuration tree node. |
GetUint16 )(const struct DeviceResourceNode *node, const char *attrName, uint16_t *value, uint16_t def) |
Obtains the value of a Uint16 attribute of a configuration tree node. |
GetUint16ArrayElem )(const struct DeviceResourceNode *node, const char *attrName, uint32_t index, uint16_t *value, uint16_t def) |
Obtains the value of a Uint16 array attribute numbered index of a configuration tree node. |
GetUint16Array )(const struct DeviceResourceNode *node, const char *attrName, uint16_t *value, uint32_t len, uint16_t def) |
Obtains the values of a Uint16 array attribute of a configuration tree node. |
GetUint32 )(const struct DeviceResourceNode *node, const char *attrName, uint32_t *value, uint32_t def) |
Obtains the value of a Uint32 attribute of a configuration tree node. |
GetUint32ArrayElem )(const struct DeviceResourceNode *node, const char *attrName, uint32_t index, uint32_t *value, uint32_t def) |
Obtains the value of a Uint32 array attribute numbered index of a configuration tree node. |
GetUint32Array )(const struct DeviceResourceNode *node, const char *attrName, uint32_t *value, uint32_t len, uint32_t def) |
Obtains the values of a Uint32 array attribute of a configuration tree node. |
GetUint64 )(const struct DeviceResourceNode *node, const char *attrName, uint64_t *value, uint64_t def) |
Obtains the value of a Uint64 attribute of a configuration tree node. |
GetUint64ArrayElem )(const struct DeviceResourceNode *node, const char *attrName, uint32_t index, uint64_t *value, uint64_t def) |
Obtains the value of a Uint64 array attribute numbered index of a configuration tree node. |
GetUint64Array )(const struct DeviceResourceNode *node, const char *attrName, uint64_t *value, uint32_t len, uint64_t def) |
Obtains the values of a Uint64 array attribute of a configuration tree node. |
GetString )(const struct DeviceResourceNode *node, const char *attrName, const char **value, const char *def) |
Obtains the value of a String attribute of a configuration tree node. |
GetStringArrayElem )(const struct DeviceResourceNode *node, const char *attrName, uint32_t index, const char **value, const char *def) |
Obtains the value of a String array attribute numbered index of a configuration tree node. |
GetElemNum )(const struct DeviceResourceNode *node, const char *attrName) |
Obtains the number of values for an array attribute of a configuration tree node. |
GetNodeByMatchAttr )(const struct DeviceResourceNode *node, const char *attrValue) |
const struct DeviceResourceNode *(* Obtains a specified child node of the current tree node based on the value of a specific reserved attribute (for example, the reserved attribute of the HCS is match_attr). |
GetChildNode )(const struct DeviceResourceNode *node, const char *nodeName) |
const struct DeviceResourceNode *(* Obtains the child node with a specified node name from a parent node. |
GetNodeByRefAttr )(const struct DeviceResourceNode *node, const char *attrName) |
const struct DeviceResourceNode *(* Obtains the node that is specified by a node-type attribute of a configuration tree node. |
bool(* DeviceResourceIface::GetBool) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName)
Description:
Obtains the value of a BOOL attribute of a configuration tree node.
Parameters:
node | Indicates the pointer to the configuration tree node. |
attrName | Indicates the pointer to the name of the attribute. |
Returns:
Returns the value of the BOOL attribute if the operation is successful; returns false if node and attrName are null pointers.
const struct [DeviceResourceNode](DeviceResourceNode.md)*(* DeviceResourceIface::GetChildNode) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *nodeName)
Description:
Obtains the child node with a specified node name from a parent node.
Parameters:
node | Indicates the pointer to the parent node. |
nodeName | Indicates the pointer to the name of the child node to obtain. |
Returns:
Returns the child nodes if the operation is successful; returns NULL otherwise.
int32_t(* DeviceResourceIface::GetElemNum) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName)
Description:
Obtains the number of values for an array attribute of a configuration tree node.
Parameters:
node | Indicates the pointer to the configuration tree node. |
attrName | Indicates the pointer to the name of the array attribute. |
Returns:
Returns the number of values for an array attribute if the operation is successful; return a negative value otherwise.
const struct [DeviceResourceNode](DeviceResourceNode.md)*(* DeviceResourceIface::GetNodeByMatchAttr) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrValue)
Description:
Obtains a specified child node of the current tree node based on the value of a specific reserved attribute (for example, the reserved attribute of the HCS is match_attr).
There is a specific reserved attribute in the syntax of the device resource configuration source file. If this attribute is set for a tree node, you can obtain the node based on the attribute value. Users can set the attribute value based on the usage of their own nodes, but they must ensure that the attribute values are unique.
Parameters:
node | Indicates the pointer to the node for whom a child node is to be obtained. The node can be the child node's parent node or grandparent node. |
attrValue | Indicates the pointer to the value of the reserved attribute configured for the child node. |
Returns:
Returns the target node if the operation is successful; returns NULL otherwise.
const struct [DeviceResourceNode](DeviceResourceNode.md)*(* DeviceResourceIface::GetNodeByRefAttr) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName)
Description:
Obtains the node that is specified by a node-type attribute of a configuration tree node.
If the attribute value is a configuration tree node, the path of the node is converted to a globally unique hashValue when the device resource source file is compiled (for example, the compilation tool of the HCS source file is hc-gen). For details about the hashValue, see DeviceResourceNode. When you obtain a tree node using the node-type attribute, you obtain the hashValue through the node-type attribute first, and then traverse the tree to obtain the tree node corresponding to the hashValue.
Parameters:
node | Indicates the pointer to the tree node whose attribute is to obtain. |
attrName | Indicates the pointer to the name of attribute whose value is a node path. |
Returns:
Returns the target node if the operation is successful; returns NULL otherwise.
const struct [DeviceResourceNode](DeviceResourceNode.md)*(* DeviceResourceIface::GetRootNode) (void)
Description:
Obtains the root node of the configuration tree.
When the driver framework is started, a configuration tree is created. You can use this function to obtain the root node of the configuration tree.
Returns:
Returns the root node of the configuration tree if the operation is successful; returns NULL otherwise.
int32_t(* DeviceResourceIface::GetString) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, const char **value, const char *def)
Description:
Obtains the value of a String attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetStringArrayElem) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t [index](UTILS.md#ga1d3748ca570dcb09a2fb28e8015107dd), const char **value, const char *def)
Description:
Obtains the value of a String array attribute numbered index of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint16) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint16_t *value, uint16_t def)
Description:
Obtains the value of a Uint16 attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint16Array) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint16_t *value, uint32_t len, uint16_t def)
Description:
Obtains the values of a Uint16 array attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint16ArrayElem) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t [index](UTILS.md#ga1d3748ca570dcb09a2fb28e8015107dd), uint16_t *value, uint16_t def)
Description:
Obtains the value of a Uint16 array attribute numbered index of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint32) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t *value, uint32_t def)
Description:
Obtains the value of a Uint32 attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint32Array) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t *value, uint32_t len, uint32_t def)
Description:
Obtains the values of a Uint32 array attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint32ArrayElem) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t [index](UTILS.md#ga1d3748ca570dcb09a2fb28e8015107dd), uint32_t *value, uint32_t def)
Description:
Obtains the value of a Uint32 array attribute numbered index of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint64) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint64_t *value, uint64_t def)
Description:
Obtains the value of a Uint64 attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint64Array) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint64_t *value, uint32_t len, uint64_t def)
Description:
Obtains the values of a Uint64 array attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint64ArrayElem) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t [index](UTILS.md#ga1d3748ca570dcb09a2fb28e8015107dd), uint64_t *value, uint64_t def)
Description:
Obtains the value of a Uint64 array attribute numbered index of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint8) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint8_t *value, uint8_t def)
Description:
Obtains the value of a Uint8 attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the attribute value is obtained successfully; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint8Array) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint8_t *value, uint32_t len, uint8_t def)
Description:
Obtains the values of a Uint8 array attribute of a configuration tree node.
Parameters:
Returns:
Returns 0 if the operation is successful; returns a negative value otherwise.
int32_t(* DeviceResourceIface::GetUint8ArrayElem) (const struct [DeviceResourceNode](DeviceResourceNode.md) *node, const char *attrName, uint32_t [index](UTILS.md#ga1d3748ca570dcb09a2fb28e8015107dd), uint8_t *value, uint8_t def)
Description:
Obtains the value of a Unit8 array attribute numbered index of a configuration tree node.
Parameters:
Returns:
Returns 0 if the array attribute value is obtained successfully; returns a negative value otherwise.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。