setDongleHID
First introduced in version: 3.00.6.5
Syntax
setDongleHID(hid)
Details
Dynamically switches the hardware dongle used by the current node while the node is running. It is mainly used to switch to a backup dongle when the original dongle fails or is under maintenance, without restarting the node.
This function can be called only by administrators on Linux in ordinary dongle
authorization mode, licenseFromDongle=true and License Server not
enabled. It is not supported in License Server mode or local license file
authorization mode.
The following rules must be met when calling this function:
-
License consistency: The license content in the target dongle must be exactly the same as the license already loaded by the current node. Even if the quotas are the same, switching is rejected if the license text is different.
-
Fault tolerance:
-
If the switch fails, the node continues to use the original dongle and its operation is not affected.
-
If the original dongle has been removed, after a backup dongle written with the same license is inserted, this function can still be called to complete the switch.
-
If the specified hid is exactly the dongle currently being used by the node, the function call succeeds and continues using it.
-
-
Effective scope: The switch takes effect only temporarily while the current node is online and does not modify the configuration file. After the node restarts, the dongleHID configuration parameter in the configuration file still takes precedence. To make it effective in the long term, update the configuration file accordingly.
Parameters
hid A STRING scalar specifying the hardware serial number, HID, of the target dongle. The value is a 16-digit hexadecimal string and is case-insensitive.
Returns
None. A successful call returns no value. If the switch fails, an exception is thrown.
Examples
// When the original dongle fails, insert a backup dongle written with the same license and complete the switch at runtime
setDongleHID("1BDF3C2BDE054009")
Related function: getDongleInfo
