Write Access

The following functions allow to modify items in the tree:

nxLibSetNull

void nxLibSetNull(int32_t *result, const char *itemPath)

Sets an item to the value Null.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set to the value Null. When specifying a subtree, the entire subtree will be replaced by a single Null value.

nxLibSetJson

void nxLibSetJson(int32_t *result, const char *itemPath, const char *value, int32_t onlyWriteableNodes)

Sets an item to the given JSON value. The value might itself be an entire tree structure which will be placed under the specified node.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set to the value Null. When specifying a subtree, the entire subtree will be replaced by a single Null value.

  • value – The JSON string representing the value or subtree to write.

  • onlyWriteableNodes – Specifies whether the function should try to write each single node into the existing tree structure instead of replacing the entire subtree. When specifying true here the function will not complain if certain nodes could not be written due to access restrictions. This can be used to restore the state of the library or the Parameters node of a camera if the tree state has previously been captured via nxLibGetJson(). When this parameter is set to false, all items of the entire subtree must not be access restricted in order for the function call to succeed! If this parameter is set and the given JSON value does not match the current structure of the node, the function will return the error code NxLibItemTypeNotCompatible. This indicates, that there was not a single node with the same structure as in the JSON string and the function could never modify any value. In this case you probably tried to apply the JSON value to the wrong path.

nxLibSetInt

void nxLibSetInt(int32_t *result, const char *itemPath, int32_t value)

Sets an item to the specified integer value. The resulting item will be of type Number.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

  • value – The value to set.

nxLibSetDouble

void nxLibSetDouble(int32_t *result, const char *itemPath, double value)

Sets an item to the specified floating point value. The resulting item will be of type Number.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

  • value – The value to set.

nxLibSetBool

void nxLibSetBool(int32_t *result, const char *itemPath, int32_t value)

Sets an item to the specified boolean value. The resulting item will be of type Boolean.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

  • value – The value to set.

nxLibSetString

void nxLibSetString(int32_t *result, const char *itemPath, const char *value)

Sets an item to the specified string. The resulting item will be of type String.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

  • value – The value to set.

nxLibErase

void nxLibErase(int32_t *result, const char *itemPath)

Erase an item or subtree

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item or subtree to erase.

nxLibSetBinary

void nxLibSetBinary(int32_t *result, const char *itemPath, void const *buffer, int32_t bufferSize)

Sets data of a Binary item. The data format must be identical to the current format of the binary node. The current format can be queried using nxLibGetBinaryInfo(). The time stamp of the node will be set to the current UTC time.

Parameters
  • result – The error code of the operation.

  • itemPath – The path of the item to set. When specifying a subtree, the entire subtree will be replaced by the specified value.

  • buffer – Pointer to the buffer

  • bufferSize – Actual size of the buffer.