Skip to content

Commit f4f6b41

Browse files
Merge pull request #808 from yqz562/main
FAQ update
2 parents 4a40918 + 1c2601c commit f4f6b41

File tree

1 file changed

+70
-67
lines changed

1 file changed

+70
-67
lines changed

faq/general/offline-registration-license.md

Lines changed: 70 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,43 @@ You can follow the steps below to manually register the device and get the licen
2626

2727
4. Unzip the file and run the GenerateUUID tool on the device to be registered and get the UUID.<br>
2828

29-
For Windows:<br>
30-
-Open Command Prompt (cmd.exe)<br>
31-
-Change the working directory to the one where GenerateUUID.exe is<br>
32-
-Run the command `GenerateUUID.exe`<br>
33-
The returned string, e.g. 8ECCA3B6-66F9-4fd6-B6B6-308C874140C6, is the machine ID.<br>
34-
![uuid](./assets/uuid.jpg)<br>
35-
36-
37-
For Linux:<br>
38-
-Open Terminal<br>
39-
-Change the working directory to the one where GenerateUUID.exe is<br>
40-
-Run the command ` sudo chmod 777 GenerateUUID`<br>
41-
-After inputting the password, run `./GenerateUUID`<br>
42-
43-
You will see the generated UUID like this (the ID should be different)<br>
44-
SoftbindUUID:230e089a-7dc3-4caa-9c77-f7cc6d567f9b<br>
45-
"230e089a-7dc3-4caa-9c77-f7cc6d567f9b" is the generated UUID. You can now use it to register the device and get an Authorization String for it.<br>
46-
47-
> Note: If your device is an arm based architecture, please use get device uuid API to generate the uuid:
48-
> ```python
49-
> # sample code in python
50-
> print(BarcodeReader.get_device_uuid(1))
51-
> ```
52-
53-
> Note: If you want multiple users in operating system to use the license, you will need to move the .Dynamsoft folder to a path where all the users can access. Let us say `/Home/shared/.Dynamsoft`.
54-
> For all the programs in the devices, you will need to set the license cache path to `/Home/shared` before initialize the license
55-
> ```python
56-
> # set license cache path before initialize the license
57-
> BarcodeReader.set_license_cache_path("/Home/shared")
58-
> ```
29+
## For Windows:
30+
31+
1. Open Command Prompt (cmd.exe)
32+
2. Change the working directory to the one where `GenerateUUID.exe` is located
33+
3. Run the command: `GenerateUUID.exe`
34+
35+
The returned string, e.g. `8ECCA3B6-66F9-4fd6-B6B6-308C874140C6`, is the machine ID.
36+
37+
![uuid](./assets/uuid.jpg)
38+
39+
## For Linux:
40+
41+
1. Open Terminal
42+
2. Change the working directory to the one where `GenerateUUID` is located
43+
3. Run the command: `sudo chmod 777 GenerateUUID`
44+
4. After inputting the password, run: `./GenerateUUID`
45+
46+
You will see the generated UUID like this (the ID should be different):
47+
48+
```
49+
SoftbindUUID: 230e089a-7dc3-4caa-9c77-f7cc6d567f9b
50+
```
51+
52+
`230e089a-7dc3-4caa-9c77-f7cc6d567f9b` is the generated UUID. You can now use it to register the device and get an Authorization String for it.
53+
54+
> Note: If your device is an ARM-based architecture, please use get device uuid API to generate the uuid:
55+
> ```python
56+
> # sample code in python
57+
> print(BarcodeReader.get_device_uuid(1))
58+
> ```
59+
60+
> Note: If you want multiple users in operating system to use the license, you will need to move the Dynamsoft folder to a path where all the users can access. Let us say `/Home/shared/.Dynamsoft`.
61+
> For all the programs in the devices, you will need to set the license cache path to `/Home/shared` before initializing the license
62+
> ```python
63+
> # set license cache path before initialize the license
64+
> BarcodeReader.set_license_cache_path("/Home/shared")
65+
> ```
5966
6067
6168
5. Input the generated UUID and device name and click Submit.
@@ -79,54 +86,50 @@ Code snippet in C:
7986
```
8087
Code snippet in C++
8188
```C++
82-
char errorBuf[512];
83-
dynamsoft::dbr::CBarcodeReader::InitLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL …", errorBuf, 512);
84-
CBarcodeReader* reader = new CBarcodeReader();
89+
errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", szErrorMsg, 256);
90+
if (errorCode != ErrorCode::EC_OK && errorCode != ErrorCode::EC_LICENSE_CACHE_USED)
91+
{
92+
cout << "License initialization failed: ErrorCode: " << errorCode << ", ErrorString: " << szErrorMsg << endl;
93+
}
94+
else
95+
{
96+
// other codes...
97+
}
8598
// add further process
8699
```
87100
Code snippet in C#:
88101
```C#
89-
string errorMsg;
90-
BarcodeReader.InitLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", out errorMsg);
91-
BarcodeReader reader = new BarcodeReader();
92-
// add further process
102+
errorCode = LicenseManager.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
103+
if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
104+
{
105+
Console.WriteLine("License initialization error: " + errorMsg);
106+
}
107+
else
108+
{
109+
CaptureVisionRouter cvr = new CaptureVisionRouter();
110+
// add code for further process
111+
}
93112
```
94113
Code snippet in Java:
95114
```Java
96-
BarcodeReader.initLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…");
97-
BarcodeReader reader = new BarcodeReader();
98-
// add further process
115+
LicenseError licenseError = LicenseManager.initLicense("YOUR-LICENSE-KEY");
116+
if (licenseError.getErrorCode() != EnumErrorCode.EC_OK &&
117+
licenseError.getErrorCode() != EnumErrorCode.EC_LICENSE_CACHE_USED) {
118+
System.out.println("License initialization error: " + licenseError.getErrorString());
119+
} else {
120+
CaptureVisionRouter cvrInstance = new CaptureVisionRouter();
121+
// add code for further process
122+
}
99123
```
100124
Code snippet in Python:
101125
```Python
102-
error = BarcodeReader.init_license("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…")
103-
dbr = BarcodeReader()
104-
```
105-
Code snippet in Android SDK:
106-
```java
107-
BarcodeReader.initLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", new DBRLicenseVerificationListener() {
108-
@Override
109-
public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) {
110-
// Add your code for license verification.
111-
}
112-
});
113-
```
114-
Code snippet in Objective-C:
115-
```Objective-C
116-
[DynamsoftBarcodeReader initLicense:@" DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…" verificationDelegate:self];
117-
- (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error
118-
{
119-
// Add your code for license verification.
120-
}
121-
```
122-
Code snippet in Swift:
123-
```Swift
124-
DynamsoftBarcodeReader.initLicense("DLC2+4LgkxoZik5yCuJxMDneqJPVQZJROL…", verificationDelegate: self)
125-
func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?)
126-
{
127-
// Add your code for license verification.
128-
}
126+
error_code, error_msg = LicenseManager.init_license("YOUR-LICENSE-KEY")
127+
if error_code != EnumErrorCode.EC_OK.value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED.value:
128+
print("License initialization error: " + error_msg)
129+
else:
130+
cvr_instance = CaptureVisionRouter()
129131
```
130132

131133

132134

135+

0 commit comments

Comments
 (0)