NVIDIA DRIVE® Update DU-Link library interface.
Data Structures | |
| struct | DULINK_ACL_ENTRY |
| Access Control List Entry. More... | |
| struct | DULINK_ATTR |
| Attribute of an DU-Link node. More... | |
Macros | |
| #define | DULINK_SUID_LINK (0U) |
| Sub-unit ID for internal DU Link functionality. More... | |
| #define | DULINK_SUID_CB (1U) |
| Sub-unit ID for callback functionality. More... | |
| #define | DULINK_ECODE(err) DU_ECODE(DU_UID_LINK, DULINK_SUID_LINK, (err)) |
| Used to tag DU Link internal error codes. More... | |
| #define | DULINK_CB_ECODE(err) DU_ECODE(DU_UID_LINK, DULINK_SUID_CB, (err)) |
| Used to tag callback specific error codes. More... | |
| #define | DULINK_ERR_GENERIC DULINK_ECODE(1U) |
| DU Link generic error. More... | |
| #define | DULINK_ERR_INVALID_ARGUMENT DULINK_ECODE(2U) |
| DU Link invalid argument error. More... | |
| #define | DULINK_ERR_BUFFER_TOO_SMALL DULINK_ECODE(3U) |
| DU Link buffer too small error. More... | |
| #define | DULINK_ERR_NOT_FOUND DULINK_ECODE(4U) |
| DU Link element or node can not found error. More... | |
| #define | DULINK_ERR_NOT_SUPPORTED DULINK_ECODE(5U) |
| DU Link operation type or messag type not supportedd error. More... | |
| #define | DULINK_ERR_NO_PERMISSION DULINK_ECODE(6U) |
| DU Link no permission error. More... | |
| #define | DULINK_ERR_ALLOC_FAILED DULINK_ECODE(7U) |
| DU Link allocate error. More... | |
| #define | DULINK_ERR_BUSY DULINK_ECODE(8U) |
| DU Link resource busy error. More... | |
| #define | DULINK_ERR_UPLINK_NOT_READY DULINK_ECODE(9U) |
| DU Link uplink not ready error. More... | |
| #define | DULINK_ERR_ROUTING DULINK_ECODE(10U) |
| DU Link router can not routing error. More... | |
| #define | DULINK_ERR_TIMEOUT DULINK_ECODE(11U) |
| DU Link timeout error. More... | |
| #define | DULINK_ERR_TRANSPORT DULINK_ECODE(12U) |
| DU Link transport error. More... | |
| #define | DULINK_ERR_ILLEGALMSG DULINK_ECODE(13U) |
| DU Link illegal message error. More... | |
| #define | DULINK_ERR_ROUTING_RETMSG DULINK_ECODE(14U) |
| DU Link router routing ret message error. More... | |
| #define | DULINK_ERR_NO_DST DULINK_ECODE(15U) |
| DU Link no destination error. More... | |
| #define | DULINK_ERR_NO_MEMORY DULINK_ECODE(16U) |
| DU Link no enough memory error. More... | |
| #define | DULINK_ERR_NO_P2P DULINK_ECODE(17U) |
| DU Link no P2P connection error. More... | |
| #define | DULINK_ERR_NO_CONNECT DULINK_ECODE(18U) |
| DU Link no connection error. More... | |
| #define | DULINK_ERR_ILLEGAL_OP DULINK_ECODE(19U) |
| DU Link illegal operation error. More... | |
| #define | DULINK_ERR_INIT DULINK_ECODE(20U) |
| DU Link initialize error. More... | |
| #define | DULINK_ERR_CLOSE DULINK_ECODE(21U) |
| DU Link close error. More... | |
| #define | DULINK_ERR_NOT_INIT DULINK_ECODE(22U) |
| DU Link not initialized error. More... | |
| #define | DULINK_CB_RCODE DU_RCODE |
| #define | DULINK_CB_OK DU_OK |
| #define | DULINK_CB_ERR_IO DULINK_CB_ECODE(1U) |
| #define | DULINK_CB_ERR_INVALID_ARGUMENT DULINK_CB_ECODE(2U) |
| #define | DULINK_CB_ERR_SYNTAX DULINK_CB_ECODE(3U) |
| #define | DULINK_CB_ERR_UNKNOWN DULINK_CB_ECODE(4U) |
| #define | DULINK_CB_ERR_BUSY_RETRY DULINK_CB_ECODE(5U) |
| #define | DULINK_CB_ERR_NOT_SUPPORTED DULINK_CB_ECODE(6U) |
| #define | DULINK_CB_ERR_NO_NODE DULINK_CB_ECODE(7U) |
| #define | DULINK_IS_CB_ERR(rcode) (DU_ECODE_GET_SUID(rcode) == DULINK_SUID_CB) |
| Used to check if DU_RCODE return is from a DU Link callback. More... | |
| #define | DULINK_GET_CB_ERR(rcode) (DU_ECODE_GET_ERR(rcode)) |
| Get DULINK_CB_RCODE value from a DU_RCODE return value. More... | |
| #define | DULINK_VERSION_STR "2" |
| DU Link version string. More... | |
| #define | DULINK_MAX_PATH (256U) |
| Maximum string length of a DU Link path. More... | |
| #define | DULINK_MAX_NODE_NAME (DULINK_MAX_PATH) |
| Maximum allowed DU-Link node name. More... | |
| #define | DULINK_MAX_CHILDNODE (256U) |
| Maximum allowed child nodes within each DU-Link node. More... | |
| #define | DULINK_MAX_NODES (256U) |
| Maximum number of nodes within DU-Link instance. More... | |
| #define | DULINK_MAX_ACL (16U) |
| Maximum number of ACLs of a single node. More... | |
| #define | DULINK_MAX_NOTIFY_NODES (16U) |
| Maximum allowed number of notify nodes. More... | |
| #define | DULINK_MAX_NODES_TO_NOTIFY (8U) |
| Maximum number of nodes a notify node can signal. More... | |
| #define | DULINK_MAX_NOTIFY_MSG_LEN (1024U) |
| Maximum data length to read or write by notify node. More... | |
| #define | DULINK_MAX_DATA_SIZE (1024U * 1024U) |
| Maximum data buffer size that one DU-Link transaction can handle. More... | |
| #define | DULINK_PERMISSION_NONE (0x00U) |
| #define | DULINK_PERMISSION_READ (0x01U) |
| Represents read and size permission. More... | |
| #define | DULINK_PERMISSION_WRITE (0x02U) |
| Represents write permission. More... | |
| #define | DULINK_PERMISSION_WRITE_MASK (0xFDU) |
| Represents write permission mask. More... | |
| #define | DULINK_CLOSE_ALL (0xFFFFFFFFU) |
| Close all connection. More... | |
| #define | DULINK_CB_READ (0U) |
| Represents READ operation to be run in callback function for dulinkRead() More... | |
| #define | DULINK_CB_WRITE (1U) |
| Represents WRITE operation to be run in callback function for dulinkWrite() More... | |
| #define | DULINK_CB_SIZE (2U) |
| Represents SIZE operation to be run in callback function for dulinkGetSize() More... | |
| #define | DULINK_CB_ATTR (3U) |
| Reserved for internal usage and would not be passed to callback function. More... | |
Typedefs | |
| typedef enum DULINK_NODE_TYPE | DULINK_NODE_TYPE |
| Type of DU Link node. More... | |
| typedef enum DULINK_CONNECTION_TYPE | DULINK_CONNECTION_TYPE |
| Type of DU Link connection. More... | |
| typedef struct DULINK_ACL_ENTRY | DULINK_ACL_ENTRY |
| Access Control List Entry. More... | |
| typedef struct DULINK_ACL_ENTRY * | PDULINK_ACL_ENTRY |
| typedef struct DULINK_ATTR | DULINK_ATTR |
| Attribute of an DU-Link node. More... | |
| typedef struct DULINK_ATTR * | PDULINK_ATTR |
| typedef uint32_t | DULINK_CB_OPERATION |
| Type of Callback operation. More... | |
| typedef DULINK_CB_RCODE(* | DULINK_CB) (const char *pRequestPath, const char *pOriginPath, void *pCtx, uint64_t offset, uint64_t length, void *pBuf, DULINK_CB_OPERATION operation, uint64_t *pRetVal) |
| Callback function registered to handle IO operations of file. More... | |
Enumerations | |
| enum | DULINK_NODE_TYPE { DULINK_NODE_TYPE_ELEMENT = 0, DULINK_NODE_TYPE_DIRECTORY, DULINK_NODE_TYPE_FILE } |
| Type of DU Link node. More... | |
| enum | DULINK_CONNECTION_TYPE { DULINK_CONNECT_UPLINK = 0, DULINK_CONNECT_DOWNLINK, DULINK_CONNECT_P2P } |
| Type of DU Link connection. More... | |
Functions | |
| DU_RCODE | dulinkInit (const char *pName, const char *pParentPath) |
| Initialize the DU Link element. More... | |
| DU_RCODE | dulinkOpen (const char *pRemotePath, DUTR_TR_TYPE trType, DUTR_SEC_TYPE seType, const void *pTrParam, const void *pSeParam, DULINK_CONNECTION_TYPE connType, uint32_t *pConnRefId) |
| Register a connection. More... | |
| DU_RCODE | dulinkClose (uint32_t connRefId) |
| Close DU Link connection. More... | |
| DU_RCODE | dulinkRead (const char *pPath, uint64_t offset, uint64_t length, void *pBuf, uint64_t *pRetLen) |
| Read content from a DU-Link node. More... | |
| DU_RCODE | dulinkWrite (const char *pPath, uint64_t offset, uint64_t length, void *pBuf, uint64_t *pRetLen) |
| Write content to a DU-Link file. More... | |
| DU_RCODE | dulinkGetSize (const char *pPath, uint64_t *pSize) |
| Get size needed for reading content from DU-Link node. More... | |
| DU_RCODE | dulinkGetAttribute (const char *pPath, PDULINK_ATTR pAttribute) |
| Get attribute of a DU-Link node. More... | |
| DU_RCODE | dulinkExportDirectory (const char *pPath, const DULINK_ATTR *pAttribute) |
| Register a directory to DU LINK. More... | |
| DU_RCODE | dulinkExportFile (const char *pPath, const DULINK_ATTR *pAttribute, DULINK_CB callback, void *pCtx) |
| Register a file to DU LINK. More... | |
| DU_RCODE | dulinkUnlinkDirectory (const char *pPath) |
| Unregister a directory from DU LINK. More... | |
| DU_RCODE | dulinkUnlinkFile (const char *pPath) |
| Unregister a file from DU LINK. More... | |
| DU_RCODE | dulinkExportNotifyNode (const char *pNotifyPath) |
| Create a node to notify other DU Link nodes when change has occurred. More... | |
| DU_RCODE | dulinkTriggerNotify (const char *pNotifyPath, void *pBuf, uint64_t bufSize) |
| Trigger notification to all nodes listening to a notify node. More... | |
| #define DULINK_CB_ATTR (3U) |
| #define DULINK_CB_ECODE | ( | err | ) | DU_ECODE(DU_UID_LINK, DULINK_SUID_CB, (err)) |
| #define DULINK_CB_ERR_BUSY_RETRY DULINK_CB_ECODE(5U) |
| #define DULINK_CB_ERR_INVALID_ARGUMENT DULINK_CB_ECODE(2U) |
| #define DULINK_CB_ERR_IO DULINK_CB_ECODE(1U) |
| #define DULINK_CB_ERR_NO_NODE DULINK_CB_ECODE(7U) |
| #define DULINK_CB_ERR_NOT_SUPPORTED DULINK_CB_ECODE(6U) |
| #define DULINK_CB_ERR_SYNTAX DULINK_CB_ECODE(3U) |
| #define DULINK_CB_ERR_UNKNOWN DULINK_CB_ECODE(4U) |
| #define DULINK_CB_READ (0U) |
Represents READ operation to be run in callback function for dulinkRead()
| #define DULINK_CB_SIZE (2U) |
Represents SIZE operation to be run in callback function for dulinkGetSize()
| #define DULINK_CB_WRITE (1U) |
Represents WRITE operation to be run in callback function for dulinkWrite()
| #define DULINK_CLOSE_ALL (0xFFFFFFFFU) |
| #define DULINK_ECODE | ( | err | ) | DU_ECODE(DU_UID_LINK, DULINK_SUID_LINK, (err)) |
| #define DULINK_ERR_ALLOC_FAILED DULINK_ECODE(7U) |
| #define DULINK_ERR_BUFFER_TOO_SMALL DULINK_ECODE(3U) |
| #define DULINK_ERR_BUSY DULINK_ECODE(8U) |
| #define DULINK_ERR_CLOSE DULINK_ECODE(21U) |
| #define DULINK_ERR_GENERIC DULINK_ECODE(1U) |
| #define DULINK_ERR_ILLEGAL_OP DULINK_ECODE(19U) |
| #define DULINK_ERR_ILLEGALMSG DULINK_ECODE(13U) |
| #define DULINK_ERR_INIT DULINK_ECODE(20U) |
| #define DULINK_ERR_INVALID_ARGUMENT DULINK_ECODE(2U) |
| #define DULINK_ERR_NO_CONNECT DULINK_ECODE(18U) |
| #define DULINK_ERR_NO_DST DULINK_ECODE(15U) |
| #define DULINK_ERR_NO_MEMORY DULINK_ECODE(16U) |
| #define DULINK_ERR_NO_P2P DULINK_ECODE(17U) |
| #define DULINK_ERR_NO_PERMISSION DULINK_ECODE(6U) |
| #define DULINK_ERR_NOT_FOUND DULINK_ECODE(4U) |
| #define DULINK_ERR_NOT_INIT DULINK_ECODE(22U) |
| #define DULINK_ERR_NOT_SUPPORTED DULINK_ECODE(5U) |
| #define DULINK_ERR_ROUTING DULINK_ECODE(10U) |
| #define DULINK_ERR_ROUTING_RETMSG DULINK_ECODE(14U) |
| #define DULINK_ERR_TIMEOUT DULINK_ECODE(11U) |
| #define DULINK_ERR_TRANSPORT DULINK_ECODE(12U) |
| #define DULINK_ERR_UPLINK_NOT_READY DULINK_ECODE(9U) |
| #define DULINK_GET_CB_ERR | ( | rcode | ) | (DU_ECODE_GET_ERR(rcode)) |
| #define DULINK_IS_CB_ERR | ( | rcode | ) | (DU_ECODE_GET_SUID(rcode) == DULINK_SUID_CB) |
| #define DULINK_MAX_ACL (16U) |
| #define DULINK_MAX_CHILDNODE (256U) |
| #define DULINK_MAX_DATA_SIZE (1024U * 1024U) |
| #define DULINK_MAX_NODE_NAME (DULINK_MAX_PATH) |
| #define DULINK_MAX_NODES (256U) |
| #define DULINK_MAX_NODES_TO_NOTIFY (8U) |
| #define DULINK_MAX_NOTIFY_MSG_LEN (1024U) |
| #define DULINK_MAX_NOTIFY_NODES (16U) |
| #define DULINK_MAX_PATH (256U) |
| #define DULINK_PERMISSION_READ (0x01U) |
| #define DULINK_PERMISSION_WRITE (0x02U) |
| #define DULINK_PERMISSION_WRITE_MASK (0xFDU) |
| #define DULINK_SUID_CB (1U) |
| #define DULINK_SUID_LINK (0U) |
| typedef struct DULINK_ACL_ENTRY DULINK_ACL_ENTRY |
Access Control List Entry.
DULINK_ACL_ENTRY stores set of permissions controlling access to the node from a single source node.
| typedef struct DULINK_ATTR DULINK_ATTR |
Attribute of an DU-Link node.
DULINK_ATTR stores information about a node, including its type and all of the access permissions allowed by other DU Link elements.
| typedef DULINK_CB_RCODE(* DULINK_CB) (const char *pRequestPath, const char *pOriginPath, void *pCtx, uint64_t offset, uint64_t length, void *pBuf, DULINK_CB_OPERATION operation, uint64_t *pRetVal) |
Callback function registered to handle IO operations of file.
| [in] | pRequestPath(const_char*) | Full path of node being accessed. |
| [in] | pOriginPath(const_char*) | Full path of element originating the request. |
| [in] | pCtx(void*) | Pointer to user application context. This pointer will be set during export file operation and will be passed into the callback by DU Link each time the callback is executed. |
| [in] | offset(uint64_t) | Offset of IO operation. This parameter would not be valid for DULINK_CB_SIZE operation. |
| [in] | length(uint64_t) | Size wanted to read/write. This parameter would not be valid for DULINK_CB_SIZE operation. |
| [in,out] | pBuf | Pointer to buffer provided for read/write operation. This parameter would not be valid for DULINK_CB_SIZE operation. |
| [in] | operation(DULINK_CB_OPERATION) | IO operation, it would be one of:
|
| [out] | pRetVal(uint64_t*) | Return value from callback:
|
| typedef uint32_t DULINK_CB_OPERATION |
| typedef enum DULINK_CONNECTION_TYPE DULINK_CONNECTION_TYPE |
Type of DU Link connection.
| typedef enum DULINK_NODE_TYPE DULINK_NODE_TYPE |
Type of DU Link node.
| typedef struct DULINK_ACL_ENTRY * PDULINK_ACL_ENTRY |
| typedef struct DULINK_ATTR * PDULINK_ATTR |
| enum DULINK_NODE_TYPE |
Type of DU Link node.
| Enumerator | |
|---|---|
| DULINK_NODE_TYPE_ELEMENT | Element type node. There is one element node per instance of DU Link. |
| DULINK_NODE_TYPE_DIRECTORY | Directory node which can store file nodes beneath it. |
| DULINK_NODE_TYPE_FILE | File type node. These are the most common type of node and are associated with a user defined callback function for READ, WRITE, SIZE operations. |
| DU_RCODE dulinkClose | ( | uint32_t | connRefId | ) |
Close DU Link connection.
Calling this function would disconnect a particular connection or all connection established.
language C
interface DU-Link Interface Spec
| [in] | connRefId(uint32_t) | Reference ID returned from dulinkOpen, or DULINK_CLOSE_ALL. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkExportDirectory | ( | const char * | pPath, |
| const DULINK_ATTR * | pAttribute | ||
| ) |
Register a directory to DU LINK.
This function can be called to register a directory. Attribute needs to be provided to set correct access control.
This function would return error if Attribute is incorrect (ex. type is not directory or numACL is 0).
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to registered directory. Path would be relative to current element. |
| [in] | pAttribute(const_PDULINK_ATTR) | Pointer to attribute buffer. Caller can deallocate the buffer after calling this function. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkExportFile | ( | const char * | pPath, |
| const DULINK_ATTR * | pAttribute, | ||
| DULINK_CB | callback, | ||
| void * | pCtx | ||
| ) |
Register a file to DU LINK.
This function can be called to register a file. Attribute needs to be provided to set correct access control.
This function would return error if Attribute is incorrect (ex. type is not file or numACL is 0).
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to registered file. Path would be relative to current element. |
| [in] | pAttribute(const_PDULINK_ATTR) | Pointer to attribute buffer. Caller can deallocate the buffer after calling this function. |
| [in] | callback(DULINK_CB) | Callback function used for IO operation. |
| [in] | pCtx(void*) | Pointer to user application context. This pointer will be passed into the callback each time it is executed. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkExportNotifyNode | ( | const char * | pNotifyPath | ) |
Create a node to notify other DU Link nodes when change has occurred.
This function will create a new DU Link node for notifying other nodes when a change has occurred within the node being monitored. The new DU Link node must be named with .notify extension, with name as <MonitorPath>.notify.
For example, if exporting a notify node to monitor path /myElement/state, the notify node should be named as /myElement/state.notify. Note that the node being monitored must already exist before calling dulinkExportNotifyNode. In this case, /myElement/state must exist before calling this function with /myElement/state.notify.
The new DU Link notify node will be readable and writable by the same set of nodes that have permission to read the monitor node.
A notify node can be written with dulinkWrite to add or remove nodes from the list of nodes to notify when triggerNotify is called. To add a node to the list, "+<NODE_PATH>" should be written to the .notify node. To remove a node from the notify list, "-<NODE_PATH>" should be written.
When a node is added to the notify list, it will immediately be notified of the current value of the node being monitored.
Notice that, the internal buffer used to read from node being monitored has size of DULINK_MAX_NOTIFY_MSG_LEN. Data longer than this may truncated when notifying.
Calling dulinkRead on the .notify node will return a NULL separated list of all nodes currently in the notify list. dulinkGetSize will return the length of this list.
language C
interface DU-Link Interface Spec
| [in] | pNotifyPath(const_char*) | Path of .notify node to export. pNotifyPath should be the path of an already existing local node with addition of ".notify" suffix. For example, if a node called state should get a notify node, pNotifyPath should be "/myElement/state.notify". |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkGetAttribute | ( | const char * | pPath, |
| PDULINK_ATTR | pAttribute | ||
| ) |
Get attribute of a DU-Link node.
This function can be called to obtain attribute of a DU-Link node. The caller would obtain a copy of the attribute.
This call is a blocking call.
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to node wanted to obtain attribute. This can be an absolute path start with "/" or relative path under this element. |
| [out] | pAttribute(PDULINK_ATTR) | Pointer to caller allocated output buffer. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkGetSize | ( | const char * | pPath, |
| uint64_t * | pSize | ||
| ) |
Get size needed for reading content from DU-Link node.
This function would return size of a DU-Link file, or buffer size needed for NULL separated list of sub nodes under particular element/directory.
This call is a blocking call.
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to node wanted to get size. This can be an absolute path start with "/" or relative path under this element. |
| [out] | pSize(uint64_t*) | Size obtained. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkInit | ( | const char * | pName, |
| const char * | pParentPath | ||
| ) |
Initialize the DU Link element.
This function should be called once and only once per element during program execution and would set element name and parent path of DU Link element.
Call any other API before calling this function would result in an error.
language C
interface DU-Link Interface Spec
| [in] | pName(const_char*) | Name of this element. |
| [in] | pParentPath(const_char*) | Parent path of this element. |
pre None
usage
| DU_RCODE dulinkOpen | ( | const char * | pRemotePath, |
| DUTR_TR_TYPE | trType, | ||
| DUTR_SEC_TYPE | seType, | ||
| const void * | pTrParam, | ||
| const void * | pSeParam, | ||
| DULINK_CONNECTION_TYPE | connType, | ||
| uint32_t * | pConnRefId | ||
| ) |
Register a connection.
This function can be called to register a connection to DU Link element, it can be either UPLINK connection, DOWNLINK connection or P2P connection.
Only one UPLINK would be allowed per element. In MVP version only P2P connection is supported.
The connection parameter is same as dutrOpen, however no handle would be returned and the handle would be stored internally in DU-Link.
language C
interface DU-Link Interface Spec
| [in] | pRemotePath(const_char*) | Absolute path of node being connected. Once connection is established, this will be verified by reading the remote node's parent path and name to ensure the connection has been made to the expected node. Verifying remote path will be skipped for P2P connection type. |
| [in] | trType(DUTR_TR_TYPE) | Type of back-end transport protocol used. |
| [in] | seType(DUTR_SEC_TYPE) | Type of security protocol. |
| [in] | pTrParam(const_void*) | Pointer to the argument of selected transport protocol. For instance if trType is DUTR_TR_TYPE_IVC, then it shall point to the structure DUTR_IVC_PARAM. |
| [in] | pSeParam(const_void*) | Pointer to the argument of selected security protocol. For instance if seType is DUTR_SEC_TYPE_TLS, then it shall point to the structure DUTR_SEC_TLS_PARAM. |
| [in] | connType(DULINK_CONNECTION_TYPE) | Type of connection. |
| [out] | pConnRefId(uint32_t*) | Reference ID can be used to close connection. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkRead | ( | const char * | pPath, |
| uint64_t | offset, | ||
| uint64_t | length, | ||
| void * | pBuf, | ||
| uint64_t * | pRetLen | ||
| ) |
Read content from a DU-Link node.
This function can be called to read content of a DU-Link file or obtain a NULL separated list of sub nodes under particular element/directory.
This call is a blocking call. DU Link would do framing and do multiple DU TR transmission if needed.
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to node wanted to read. This can be an absolute path start with "/" or relative path under this element |
| [in] | offset(uint64_t) | Offset of read operation |
| [in] | length(uint64_t) | Size wanted to read. |
| [out] | pBuf(void*) | Pointer to caller allocated buffer provided for data fill in. |
| [out] | pRetLen(uint64_t*) | Size of data actually read. |
pre dulinkInit should already be called
usage
Trigger notification to all nodes listening to a notify node.
This function will trigger an exported notify node to update all listening nodes of the latest state of the monitor node.
When this function is called, the value provided would be forwarded to listeners via dulinkWrite.
This function requires that the notify node passed into pNotifyPath is currently exported under the current local DU Link element.
This function is a blocking call, it would not return until the broadcast is done.
Notice that, the internal buffer used to read from node being monitored has size of DULINK_MAX_NOTIFY_MSG_LEN. Data longer than this may truncated when notifying.
language C
interface DU-Link Interface Spec
| [in] | pNotifyPath(const_char*) | Path of exported notify node to trigger. |
| [in] | pBuf(void*) | Content wants to be broadcasted. |
| [in] | bufSize(uint64_t) | Size of input buffer. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkUnlinkDirectory | ( | const char * | pPath | ) |
Unregister a directory from DU LINK.
Directory must not have child nodes.
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to directory wanted to unregister. Path would be relative to current element. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkUnlinkFile | ( | const char * | pPath | ) |
Unregister a file from DU LINK.
language C
interface DU-Link Interface Spec
| [in] | pPath(const_char*) | Path to file wanted to unregister. Path would be relative to current element. |
pre dulinkInit should already be called
usage
| DU_RCODE dulinkWrite | ( | const char * | pPath, |
| uint64_t | offset, | ||
| uint64_t | length, | ||
| void * | pBuf, | ||
| uint64_t * | pRetLen | ||
| ) |
Write content to a DU-Link file.
This function can be called to write content to a DU-Link file. Calling this function on an element or directory would result in an error.
This call is a blocking call. DU Link would do framing and do multiple DU TR transmission if needed.
language C
interface DU-Link Interface Spec
| [in] | pPath(char*) | Path to file wanted to write. This can be an absolute path start with "/" or relative path under this element. |
| [in] | offset(uint64_t) | Offset of write operation. |
| [in] | length(uint64_t) | Size wanted to write. |
| [in] | pBuf(void*) | Pointer to caller allocated buffer provided for data. |
| [out] | pRetLen(uint64_t*) | Size of data actually written. |
pre dulinkInit should already be called
usage