Add Original SDK

This commit is contained in:
2026-05-06 07:47:36 +02:00
parent 2915e04380
commit 0ed627517a
674 changed files with 89334 additions and 0 deletions

View File

@@ -0,0 +1,273 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Using the DinkeyChange API with MATLAB</title>
<style>
body {
color: black;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
margin: 25px auto;
max-width: 800px;
}
p, ul, ol, table {
margin-top: 0;
margin-bottom: 15px;
}
ul.contents a {
text-decoration: none;
}
h1,h2,h3,h4,h5,h6 {
margin-top: 25px;
margin-bottom: 15px;
}
h2 {
border-top: 1px solid gray;
}
table {
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
}
th, td {
border: 1px solid black;
padding: 0.5em;
text-align: left;
}
.ui_element
{ /* Use for things like program options and menu items */
color: #008000;
font-style: italic;
}
.filepath
{ /* Use for paths and filenames */
font-family: monospace;
font-size: 13px;
font-weight: bold;
}
.manual
{ /* Use when referring to user manual sections/chapters */
font-style: italic;
}
.alert
{
border: 1px solid black;
padding: 15px 15px 15px 58px;
font-weight: bold;
background-repeat: no-repeat;
background-position: 5px 15px;
margin-bottom: 15px;
}
.important
{
background-color: #FFFDD0;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH2wcJCS0n8fQB3QAACsBJREFUaIHtmWmMHMUVx3/Vx/Tc6/Xa61l717sEY/BibA4bAQIiOzGHIoMUiURgwEEEBYkoBESsSAGJBIFIEIQoARwlEBnJQTJBAhMDPggECQewYyPjSPgCG+ODXa/3mJ2e7pnuqnyY6Z6e3dkDDFE+8KSn6umpfv3/v/eq6lU1fC1fyymJ+LIMKRDPQbeCbxvwTaBbQguQrHaxdfhMwX88eB14YwXsO9X3njKBv0DOgh8L+KEByVwyaUzJZhNpy8IyTXQAKfE8D8d1GXZd+goF+0S57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gZPrzEAjEHAm8Si5o9Wo78nNZIHWfx6qg/AiBRkTKjCNf9DOrVgUdAA9UpzboR36sjBII2uB7hhfRclXrVtwvm8BI0WhMYKIPlVECkwL8tfy/yX8BjYmrtt9ODsIAAAAASUVORK5CYII=');
}
.information
{
background-color: #EBF8FF;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAYdEVYdFRpdGxlAERpYWxvZyBJbmZvcm1hdGlvbvUv0PgAAAAUdEVYdEF1dGhvcgBKYWt1YiBTdGVpbmVy5vv3LwAAACF0RVh0U291cmNlAGh0dHA6Ly9qaW1tYWMubXVzaWNoYWxsLmN6aWbjXgAACnJJREFUaIHVmX+MXFd1x7/n3Pvem5md3Z3ZXa+9P+z4Z5YYYtUkqYEAQlEQQgLRlsSkhQKVKjWthBAl/BOpTX+gNiptgxBEbWiRMDiCQCokVCgkEKBNDf4hQGuvHeMf63jt3eyP2ZnZmdl58+49p3/MTFhvHNvr3Q3q1Ry9OzN33vl+7jv33B9Dqor/z4V/0wJWW+x63vxPnjgWLCxgH5MMwfM8LCZh3YWvfmxfea180FqH0IcfO3ynCN1LwHsVeGPKUjUTkVZjkcRroEppEI15wdcswscPPLSnuhp/awbwR5/9Rc6JO2gYb93UxTrYG9JgPtJcNqTEiUaWuRI7KVVi/1KpYSYK3s9VNBbVBw5+8q6f/EYBPvSZo3cT638M9djwTSOdJAIpVupSrNRdsRaLCkBE6EoHpisTcTYTcD6bMuemqnTkXB3i8WSdkz9/6hNvXnzNAf7wnw8/QqBP7d0auW39GX1hohAv1BvCxGAiSkeGujORSbxIebEh4hUKhWGmHQO5IAzZ/O9YWS7PuyoR7jn4qX2/es0APvRPR+9LBfrvb7utQwgq5ydLsVcgm7J8+/YN6V2D+SiVsgQFAYACO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XJgwvhq/a/b/gBLiarkISAxZeAKy+OyrO2VG//AW9A1tYRE8sBq/awbAhK9MX7yA4uwMiHtAnLtme5ckKM3NgAlHVuN3LUPoA7fcthu5/mFw7m8BrcHPfviqbZ3zmL54AY3FmjjB2Gr8rmUIRSoCaANS+yak9uqHa9YaDG7fib6hLWwY96/G75oBiOArL54+heLMNNAYBZJT12kvWJifAwGnV+N37cYA432bd400Qyj/N+Duv7hOe0ZnTx9UcO+q/K7mxwBARExE1nv0G2ubIVR9ClJ96rq/NdYiEfQSUYaIIiIKiGhFmm5qELec2JYxAHNkDF+y9vj7F+YLG3oHphBEEcIoDYXCO4+kvgjvEnjvkcR1FKYmUZqfn3v+GB4D0AHAt0yIyANwAJyqyqvpAFa4lFgm3Cy/vm0vuv90Pz7alcXu+Wr2Xb1d3mbTdTApVAmVegqzZeOzYeUH0wUc/dzX8a0Tp1ECELcEtyHckus1QW4YYJn4pcLbFgFItW37rpH3b9i44cHhwb5UNuVQqxtMTBYa0zOzT589dfJgS3R9ybVtVwi/HsRq5gFaZrzULpw780y6I7PvzLnGnWEYuEaSWNdIXrg0fv77Lfh22+X3WZmIFYbQ8rBZ/kRCNJ9E2LIgk8l0924cuGNudnq0trBQxq97OGlZ3LIGXtn7S8fCVf/4W/Fyunlg8rLgtrXfM67sXbuk3i7SMrek7pdc3bK602uIXNV+oDUu2hB8FQNeGRqtA5YrYHQZhL9e9lkTgFfcrPl02mKXxvfy0oZoi9Rr9fK1yv8BQhlE2oxknwEAAAAASUVORK5CYII=');
}
.alert > p:last-child, .alert > ul:last-child, .alert > ol:last-child
{
/* Cancel double space at bottom of alert caused by above rule */
margin-bottom: 0;
}
.important .filepath, .information .filepath {
/* Make filepaths stand out in sections that are already bold */
font-weight: normal;
}
div.col_wrapper
{
clear: both;
overflow: hidden;
}
div.two_col
{
width: 50%;
float: left;
}
code {
color: gray;
white-space: nowrap;
}
pre {
padding: 15px;
background-color: #EEEEEE;
}
pre > code { /* Block level code snippets */
white-space: pre; /* Override nowrap used for inline code */
color: inherit;
}
code .comment
{
color: green;
}
code .keyword
{
font-weight: bold;
color: blue;
}
code .string
{
color: #A00000;
}
code .constant
{
font-weight: bold;
}
</style>
</head>
<body>
<h1>Using the DinkeyChange API with MATLAB</h1>
<p>
If you are not already familiar with calling shared libraries from MATLAB code,
it is strongly recommended that you read the MATLAB documentation on this topic.
Depending on your version of MATLAB, you may need to install a C compiler and configure MATLAB to use it with the command <code>mex -setup</code>.
Again, refer to the MATLAB documentation for further information.
</p>
<p>
See <span class="manual">Remote Parameter Changing &gt; DinkeyChange &gt; DinkeyChange.dll</span> in the user manual for information on using the DinkeyChange API.
Use the <code>help</code> command to see overviews of how each M-file interface to the DinkeyChange API is used in MATLAB.
Most of the DinkeyChange M-files are simple MATLAB wrappers for the shared library functions.
<span class="filepath">dcgetinfo.m</span> however is quite different to the <code>DCGetInfo()</code> function described in the user manual:
</p>
<pre><code>[retCode, dongleArray] = dcgetinfo(libName, typeMask, modelMask, prodcodeMask)</code></pre>
<p>
The inputs <code>typeMask</code>, <code>modelMask</code> and <code>prodcodeMask</code>
are used in the same way as the inputs of <code>DCGetInfo()</code>, as <span class="filepath">dcsample.m</span> illustrates.
The outputs however are grouped together as <code>dongleArray</code>, a 1-by-N vector of MATLAB structures.
Each structure represents a dongle found by <code>dcgetinfo</code>'s search, and each structure has the following fields:
</p>
<table>
<tr>
<th>Field</th>
<th>Data Type</th>
<th>Description</th>
</tr>
<tr>
<td>type</td>
<td>int32</td>
<td>
The dongle's type as a numeric value. Possible values:
<ul>
<li>1 for Dinkey Pro dongles</li>
<li>2 for Dinkey FD dongles</li>
</ul>
</td>
</tr>
<tr>
<td>type_as_string</td>
<td>char</td>
<td>
The dongle's type as a string. Possible values:
<ul>
<li>"Pro"</li>
<li>"FD"</li>
</ul>
</td>
</tr>
<tr>
<td>model</td>
<td>int32</td>
<td>
The dongle's model as a numeric value. Possible values:
<ul>
<li>1 for Lite dongles</li>
<li>2 for Plus dongles</li>
<li>4 for Net dongles (5 users)</li>
<li>7 for Net dongles (unlimited users)</li>
</ul>
</td>
</tr>
<tr>
<td>model_as_string</td>
<td>char</td>
<td>
The dongle's model as a string. Possible values:
<ul>
<li>"Lite"</li>
<li>"Plus"</li>
<li>"Net (5 users)"</li>
<li>"Net (unlimited users)"</li>
</ul>
</td>
</tr>
<tr>
<td>product_code</td>
<td>char</td>
<td>The dongle's product code</td>
</tr>
<tr>
<td>dongle_number</td>
<td>uint32</td>
<td>The dongle's serial number (dongle number)</td>
</tr>
<tr>
<td>update_number</td>
<td>int32</td>
<td>The dongle's update number</td>
</tr>
</table>
<h2>MATLAB Example Files</h2>
<ul>
<li><span class="filepath">dcgetinfo.m</span> - an M-file that provides a MATLAB interface to the <code>DCGetInfo()</code> API function.</li>
<li><span class="filepath">dcgetdiagnosticinfo.m</span> - a MATLAB interface to the <code>DCGetDiagnosticInfo()</code> API function.</li>
<li><span class="filepath">dcdoupdatecodestring.m</span> - a MATLAB interface to the <code>DCDoUpdateCodeString()</code> API function.</li>
<li><span class="filepath">dcdoupdatecodefromfile.m</span> - a MATLAB interface to the <code>DCDoUpdateCodeFromFile()</code> API function.</li>
<li><span class="filepath">dcrestoredinkeyfdlite.m</span> - a MATLAB interface to the <code>DCRestoreDinkeyFDLite()</code> API function.</li>
<li><span class="filepath">dcgetmachineid.m</span> - a MATLAB interface to the <code>DCGetMachineID()</code> API function.</li>
<li><span class="filepath">dcdownloadtempsoftwarekey.m</span> - a MATLAB interface to the <code>DCDownloadTempSoftwareKey()</code> API function.</li>
<li><span class="filepath">dcdownloaddemosoftwarekey.m</span> - a MATLAB interface to the <code>DCDownloadDemoSoftwareKey()</code> API function.</li>
<li><span class="filepath">dcsample.m</span> - examples of using these M-files.</li>
<li><span class="filepath">dinkeychangewin32proto.p</span> - a prototype P-file that defines the signatures of the API functions for 32-bit MATLAB on Windows.</li>
<li><span class="filepath">dinkeychange32proto.p</span> - a prototype P-file that defines the signatures of the API functions for 32-bit MATLAB on all other supported platforms.</li>
<li><span class="filepath">dinkeychange64proto.p</span> - a prototype P-file that defines the signatures of the API functions for 64-bit MATLAB on all supported platforms.</li>
<li><span class="filepath">DinkeyChange64_thunk_pcwin64.dll</span> - a compatibility layer required by 64-bit MATLAB to use <span class="filepath">DinkeyChange64.dll</span>.</li>
</ul>
<p>
The appropriate prototype P-file and any M-files that you call should be included, <strong>without modification</strong>, in your own project.
If you are using 64-bit MATLAB on Windows, you should also include <span class="filepath">DinkeyChange64_thunk_pcwin64.dll</span>.
If you rename <span class="filepath">DinkeyChange64.dll</span>,
you must change the <em>DinkeyChange64</em> part of the thunking DLL's filename accordingly.
</p>
<p>
Our M-files and P-files are compatible with MATLAB on macOS and Linux.
However, we do not currently provide the thunk files required by 64-bit MATLAB on these platforms.
If you want to use the DinkeyChange API on 64-bit macOS and/or 64-bit Linux,
please contact us with full details of the platform(s) and MATLAB versions that you want to use,
and we can provide compatible thunk files or instruct you on how to produce these files yourself.
</p>
<h2>Supported Versions</h2>
<p>
The MATLAB sample code provided with the Dinkey Pro/FD SDK was written and tested using MATLAB R2013a.
All newer versions should be backwards compatible. The sample code may also work with older versions,
but no guarantees can be made, and support for older versions is likely to be very limited.
</p>
<h2>Try It Yourself</h2>
<p>
<span class="filepath">dcsample.m</span> gives a simple example of calling each of the API functions.
To run <span class="filepath">dcsample.m</span> you will need a copy of the appropriate shared library for your platform
(<span class="filepath">DinkeyChange.dll</span> for 32-bit Windows, <span class="filepath">DinkeyChange64.so</span> for 64-bit Linux etc.).
Place the library in the same folder as the example files and change MATLAB's current directory to this folder.
Browse the examples in <span class="filepath">dcsample.m</span> to see how different features can be used.
</p>
<p>
Uncomment the function calls at the top of <span class="filepath">dcsample.m</span>
to enable the examples of different features, then enter <code>dcsample</code> in the Command Window to run the examples.
</p>
<p>
<span class="filepath">dcsample.m</span> also demonstrates loading and unloading the appropriate shared library for your platform.
</p>
<p>
Parts of the sample code marked with <code>!!!!</code> must be customised with your own functions or values
for some features to work correctly. Not all features are supported by all dongle models.
See the user manual for more information.
</p>
</body>
</html>

View File

@@ -0,0 +1,17 @@
function [retCode, confirmationCode, extErr] = dcdoupdatecodefromfile(libName, filename)
%DCDOUPDATECODEFROMFILE Update a dongle attached to this computer using a
%strongly encrypted update code.
% [RETCODE,CONFIRMATIONCODE,EXTERR] =
% DCDOUPDATECODEFROMFILE(LIBNAME,FILENAME) calls the API via the external
% library LIBNAME. FILENAME is a file containing the update code to be
% applied. RETCODE is the return code of the API call. If the update
% succeeded, CONFIRMATIONCODE contains the update's confirmation code. If
% the update failed, EXTERR contains an additional error code that
% provides more information.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
confirmationCode = int32(0);
extErr = int32(0);
[retCode, filename, confirmationCode, extErr] = calllib(libName, 'DCDoUpdateCodeFromFile', filename, confirmationCode, extErr);
end

View File

@@ -0,0 +1,17 @@
function [retCode, confirmationCode, extErr] = dcdoupdatecodestring(libName, updateCode)
%%DCDOUPDATECODESTRING Update a dongle attached to this computer using a
%short update code.
% [RETCODE,CONFIRMATIONCODE,EXTERR] =
% DCDOUPDATECODESTRING(LIBNAME,UPDATECODE) calls the API via the external
% library LIBNAME. UPDATECODE is the short update code to be applied.
% RETCODE is the return code of the API call. If the update succeeded,
% CONFIRMATIONCODE contains the update's confirmation code. If the update
% failed, EXTERR contains an additional error code that provides more
% information.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
confirmationCode = int32(0);
extErr = int32(0);
[retCode, updateCode, confirmationCode, extErr] = calllib(libName, 'DCDoUpdateCodeString', updateCode, confirmationCode, extErr);
end

View File

@@ -0,0 +1,15 @@
function [retCode, extErr] = dcdownloaddemosoftwarekey(libName, machineId, productCode, model)
%DCDOWNLOADDEMOSOFTWAREKEY Download and install a demo software key.
% [RETCODE,EXTERR] = DCDOWNLOADDEMOSOFTWAREKEY(LIBNAME,MACHINEID,PRODUCTCODE,MODEL)
% calls the API via the external library LIBNAME. MACHINEID is the machine
% ID of this computer (you can obtain this by calling the API function
% DCGETMACHINEID). PRODUCTCODE and MODEL specify the product code and dongle
% model of the demo software key to be installed. RETCODE is the return code
% of the API call. If the update failed, EXTERR contains an additional error
% code that provides more information.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
extErr = int32(0);
[retCode, productCode, extErr] = calllib(libName, 'DCDownloadDemoSoftwareKey', machineId, productCode, model, extErr);
end

View File

@@ -0,0 +1,14 @@
function [retCode, extErr] = dcdownloadtempsoftwarekey(libName, machineId)
%DCDOWNLOADTEMPSOFTWAREKEY Download and install a temporary software key.
% [RETCODE,EXTERR] = DCDOWNLOADTEMPSOFTWAREKEY(LIBNAME,MACHINEID) calls the
% API via the external library LIBNAME. MACHINEID is the machine ID of
% this computer (you can obtain this by calling the API function
% DCGETMACHINEID). RETCODE is the return code of the API call. If the
% update failed, EXTERR contains an additional error code that provides
% more information.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
extErr = int32(0);
[retCode, extErr] = calllib(libName, 'DCDownloadTempSoftwareKey', machineId, extErr);
end

View File

@@ -0,0 +1,13 @@
function retCode = dcgetdiagnosticinfo(libName, filename)
%DCGETDIAGNOSTICINFO Call the DinkeyChange API to write diagnostic
%information to a file.
% RETCODE = DCGETDIAGNOSTICINFO(LIBNAME,FILENAME) calls the API via the
% external library LIBNAME, writing diagnostic information to the file
% specified in FILENAME. FILENAME can be an absolute or relative path. If
% FILENAME does not end in '.dlpf', it will be appended automatically.
% RETCODE is the return code of the API call.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
retCode = calllib(libName, 'DCGetDiagnosticInfo', filename);
end

View File

@@ -0,0 +1,72 @@
function [retCode, dongleArray] = dcgetinfo(libName, typeMask, modelMask, prodcodeMask)
%DCGETINFO Get information about Dinkey Pro/FD dongles attached to this
%computer.
% [RETCODE,DONGLEARRAY] =
% DCGETINFO(LIBNAME,TYPEMASK,MODELMASK,PRODCODEMASK) calls the API via
% the external library LIBNAME. TYPEMASK, MODELMASK and PRODCODEMASK can
% be used to restrict the search to dongles with specific
% characteristics. DONGLEARRAY is a vector of structures; each structure
% contains information about a dongle attached to this computer. RETCODE
% is the return code of the API call.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
MAX_USB_DEVICES = 128;
MAX_PRODCODE_LEN = 9;
dongleArray = [];
numberFound = int32(0);
typeArray = zeros(1, MAX_USB_DEVICES, 'int32');
modelArray = zeros(1, MAX_USB_DEVICES, 'int32');
productCodeArray = zeros(1, MAX_USB_DEVICES * MAX_PRODCODE_LEN, 'uint8');
dongleNumberArray = zeros(1, MAX_USB_DEVICES, 'uint32');
updateNumberArray = zeros(1, MAX_USB_DEVICES, 'int32');
[retCode, prodcodeMask, numberFound, typeArray, modelArray, productCodeArray, dongleNumberArray, updateNumberArray] = ...
calllib(libName, 'DCGetInfo', typeMask, modelMask, prodcodeMask, MAX_USB_DEVICES, numberFound, typeArray, modelArray, productCodeArray, dongleNumberArray, updateNumberArray);
for (i = 1:numberFound)
productCode = productCodeArray(((i-1)*MAX_PRODCODE_LEN)+1 : i*MAX_PRODCODE_LEN); % Get product codes out of array of bytes, 9 bytes at a time
productCode = deblank(char(productCode)); % Convert to string and remove any trailing NULLs
newDongle = createdonglestructure(typeArray(i), modelArray(i), productCode, dongleNumberArray(i), updateNumberArray(i));
dongleArray = [dongleArray newDongle];
end
end
function dongle = createdonglestructure(type, model, productCode, dongleNumber, updateNumber)
% Create a structure representing a dongle detected by dcgetinfo()
dongle.type = type;
switch type
case 1
dongle.type_as_string = 'Pro';
case 2
dongle.type_as_string = 'FD';
otherwise
dongle.type_as_string = ''; % Should never happen!
end
dongle.model = model;
switch model
case 1
dongle.model_as_string = 'Lite';
case 2
dongle.model_as_string = 'Plus';
case 3
dongle.model_as_string = 'Net (1 user)';
case 4
dongle.model_as_string = 'Net (5 users)';
case 5
dongle.model_as_string = 'Net (10 users)';
case 6
dongle.model_as_string = 'Net (50 users)';
case 7
dongle.model_as_string = 'Net (unlimited users)';
otherwise
dongle.model_as_string = ''; % Should never happen!
end
dongle.product_code = char(productCode);
dongle.dongle_number = uint32(dongleNumber);
dongle.update_number = int32(updateNumber);
end

View File

@@ -0,0 +1,14 @@
function [retCode, machineId, extErr] = dcgetmachineid(libName)
%DCGETMACHINEID Get the machine ID for this computer
% [RETCODE,MACHINEID,EXTERR] = DCGETMACHINEID(LIBNAME) calls the API via
% the external library LIBNAME. RETCODE is the return code of the API
% call. If the update succeeded, MACHINEID is the machine ID of the
% computer. If this call failed, EXTERR contains an additional error code
% that provides more information.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
machineId = uint32(0);
extErr = int32(0);
[retCode, machineId, extErr] = calllib(libName, 'DCGetMachineID', machineId, extErr);
end

View File

@@ -0,0 +1,10 @@
function retCode = dcrestorefdlite(libName)
%DCRESTOREFDLITE Restore the required hidden file on all Dinkey FD Lite
%dongles attached to this computer.
% RETCODE = DCRESTOREFDLITE(LIBNAME) calls the API via the external
% library LIBNAME. RETCODE is the return code of the API call.
% Copyright Microcosm Ltd. DO NOT MODIFY THIS FILE.
retCode = calllib(libName, 'DCRestoreDinkeyFDLite');
end

View File

@@ -0,0 +1,249 @@
function dcsample
%DCSAMPLE Example use of the DinkeyChange API in MATLAB.
% Copyright Microcosm Ltd.
% Load the correct library for this platform
switch computer()
case 'PCWIN64' % 64-bit Windows
loadlibrary('DinkeyChange64.dll', @dinkeychange64proto, 'alias', 'dinkeychange');
case 'PCWIN' % 32-bit Windows
loadlibrary('DinkeyChange.dll', @dinkeychangewin32proto, 'alias', 'dinkeychange');
case 'GLNXA64' % 64-bit Linux
loadlibrary('DinkeyChange64.so', @dinkeychange64proto, 'alias', 'dinkeychange');
case 'GLNX86' % 32-bit Linux
loadlibrary('DinkeyChange.so', @dinkeychange32proto, 'alias', 'dinkeychange');
case 'MACI64' % 64-bit Mac OS X
loadlibrary('DinkeyChange64.dylib', @dinkeychange64proto, 'alias', 'dinkeychange');
case 'MAC' % 32-bit Mac OS X
loadlibrary('DinkeyChange32.dylib', @dinkeychange32proto, 'alias', 'dinkeychange');
otherwise
disp('Error! Platform not supported!');
return
end
% Each of the functions below demonstrates different API functionality.
% Uncomment the appropriate functions to execute the examples.
% See the comments in each function for more details about the features
% that they demonstrate.
getdongleinfo('dinkeychange');
%writediagnosticfile('dinkeychange');
%applyshortupdatecode('dinkeychange');
%applystronglyencryptedupdatecode('dinkeychange');
%restorefdlite('dinkeychange');
%getmachineid('dinkeychange');
%downloadtempsoftwarekey('dinkeychange');
%downloaddemosoftwarekey('dinkeychange');
unloadlibrary('dinkeychange');
end
function getdongleinfo(libName)
% Display information about the dongles attached to this computer
% Possible values for dcgetinfo's typeMask parameter
TYPE_MASK_PRO = 1;
TYPE_MASK_FD = 2;
TYPE_MASK_ALL = bitor(TYPE_MASK_PRO, TYPE_MASK_FD);
% Possible values for dcgetinfo's modelMask parameter
MODEL_MASK_LITE = 1;
MODEL_MASK_PLUS = 2;
MODEL_MASK_NET = 4;
MODEL_MASK_ALL = bitor(bitor(MODEL_MASK_LITE, MODEL_MASK_PLUS), MODEL_MASK_NET);
MODEL_MASK_DEFAULT = bitor(MODEL_MASK_PLUS, MODEL_MASK_NET);
% Call the DinkeyChange API
[retCode, dongleArray] = dcgetinfo(libName, TYPE_MASK_ALL, MODEL_MASK_ALL, '');
% Check the return value
if (retCode ~= 0)
displayerror(retCode, 0);
return
end
for (i = 1:length(dongleArray))
disp(sprintf('%3d) Dinkey %s %s', i, dongleArray(i).type_as_string, dongleArray(i).model_as_string));
disp(sprintf(' Product code : %s', dongleArray(i).product_code));
disp(sprintf(' Dongle number: %u', dongleArray(i).dongle_number));
disp(sprintf(' Update number: %u', dongleArray(i).update_number));
disp(sprintf('\n'));
end
end
function writediagnosticfile(libName)
% Write diagnostic information about the dongles attached to this computer
% to an encrypted file.
filename = '!!!! REPLACE THIS WITH THE NAME OF THE FILE TO WRITE TO';
% Call the DinkeyChange API
retCode = dcgetdiagnosticinfo(libName, filename);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, 0);
return
end
disp(['Successfully wrote diagnostic information to ' filename]);
end
function applyshortupdatecode(libName)
% Update a dongle attached to this computer using a short update code
% Call the DinkeyChange API
[retCode, confirmationCode, extErr] = dcdoupdatecodestring(libName, '!!!! REPLACE THIS WITH A VALID UPDATE CODE STRING');
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
disp('Successfully updated dongle');
disp(['Confirmation code: ' sprintf('%X', confirmationCode)]);
end
function applystronglyencryptedupdatecode(libName)
% Update a dongle attached to this computer using a strongly encrypted
% update code file
% Call the DinkeyChange API
[retCode, confirmationCode, extErr] = dcdoupdatecodefromfile(libName, '!!!! REPLACE THIS WITH A VALID UPDATE CODE FILENAME');
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
disp('Successfully updated dongle');
disp(['Confirmation code: ' sprintf('%X', confirmationCode)]);
end
function restorefdlite(libName)
% Restore the required hidden file on a Dinkey FD Lite dongle.
% Call the DinkeyChange API
retCode = dcrestorefdlite(libName);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, 0);
return
end
disp('Successfully restored FD Lite dongle');
end
function getmachineid(libName)
% Display this computer's machine ID
% Call the DinkeyChange API
[retCode, machineId, extErr] = dcgetmachineid(libName);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
disp(['The machine ID for this computer is: ' sprintf('%X', machineId)]);
end
function downloadtempsoftwarekey(libName)
% Download and install a temporary software key on this computer
% First call the DinkeyChange API to get the machine ID
[retCode, machineId, extErr] = dcgetmachineid(libName);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
% Then call the API again to install the software key
[retCode, extErr] = dcdownloadtempsoftwarekey(libName, machineId);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
disp('The temporary software key has been succesfully installed.');
end
function downloaddemosoftwarekey(libName)
% Download and install a demo software key on this computer
% Possible values for dcdownloaddemosoftwarekey's model parameter
SWKEY_MODEL_DEFAULT = -1;
SWKEY_MODEL_PRO_LITE = 0;
SWKEY_MODEL_PRO_PLUS = 1;
SWKEY_MODEL_PRO_NET = 2;
SWKEY_MODEL_FD_LITE = 3;
SWKEY_MODEL_FD_PLUS = 4;
SWKEY_MODEL_FD_NET = 5;
% First call the DinkeyChange API to get the machine ID
[retCode, machineId, extErr] = dcgetmachineid(libName);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
% Then call the API again to install the software key
[retCode, extErr] = dcdownloaddemosoftwarekey(libName, machineId, '!!!! REPLACE THIS WITH THE PRODUCT CODE OF THE KEY', SWKEY_MODEL_DEFAULT);
% Check the return value
if (retCode ~= 0)
displayerror(retCode, extErr);
return
end
disp('The demo software key has been succesfully installed.');
end
% An example of error reporting
% Displays descriptions for some common error codes
function displayerror(retCode, extErr)
switch retCode
case 401
disp('Error! No dongles detected that meet the search criteria.');
case 409
disp('Error! The dongle detected has not been programmed by DinkeyAdd.');
case 754
disp('Error! The specified output file could not be written to.');
case 758
disp('Error! Cannot open the file specified.');
case 759
disp('Error! The file specified is not a valid update code file.');
case 762
disp('Error! The update code contains invalid characters.');
case 763
disp('Error! Invalid update code.');
case 764
disp('Error! The update code was entered incorrectly, or the update code file is corrupt.');
case 765
disp('Error! The update code does not match any dongle attached to your computer.');
case 766
disp('Error! The update number for this update code is too high. If you have more than one update code, ensure that you apply them in the correct order.');
case 767
disp('Error! You have already entered this update code.');
case 1905
disp('Error! There is no temporary software key available for download.');
case 1907
disp('Error! The temporary software key has expired. Cannot download it.');
case 1910
disp('Error! The temporary software key has already been downloaded.');
otherwise
str = sprintf('An error occurred checking the dongle. Error: %d, Extended Error: %d', retCode, extErr);
disp(str);
end
end