CmGetBoxes
Description
CmGetBoxes returns all connected CmContainers of the given licensing system.
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmGetBoxes(HCMSysEntry hcmse, CMULONG idPort, CMBOXINFO *pcmBoxInfo, CMUINT cbBoxInfo)
Parameter
hcmse contains the handle opened by CmAccess / CmAccess2 (must be Subsystem Access).
idPort contains one of the following commands:
CM_GB_ALLPORTS: All CmContainers will be scanned.
CM_GB_DONGLE: All CmDongles (CodeMeter hardware) will be scanned. Old naming: CM_GB_USB.
CM_GB_SIM: Simulated boxes will be scanned
CM_GB_ACT: All CmActLicenses will be scanned.
CM_GB_CLOUD: All CmCloudContainer will be scanned.
CM_GB_PORT_MASK: Allows to mask bits for license container to be scanned.
pcmBoxInfo contains an array of
CMBOXINFO structure.
|
CMBOXINFO contains information on a CmContainer. Syntax
Parameter mbMajorVersion contains the major version of the CmContainer. mbMinorVersion contains the minor version of the CmContainer. musBoxMask contains the box mask of the CmContainer. mulSerialNumber contains the serial number of the CmContainer. musBoxKeyId contains the ID of the used BoxKey of the CmContainer. musUserKeyId contains the ID of the used UserKey of the CmContainer. mabBoxPublicKey[CM_PUBLIC_KEY_LEN] contains the public Box Key of the CmContainer. mabSerialPublicKey[CM_PUBLIC_KEY_LEN] contains the public Serial Key of the CmContainer. mulReserve is reserved for future purposes. Notes The length of the mabBoxPublicKey and mabSerialPublicKey is 64 byte long. The used public key are currently 224 bits = 28 bytes long. In Elliptic Curve Cryptography the public key is a 2 dimensional point, so the x-value is stored in the first 28 bytes (0..27) and the y-value is store in byte 32..59.
|
cbBoxInfos contains the number of CMBOXINFO elements stored in pcmBoxInfo.
Return
The number of found CmContainers is returned. If the number is larger than cbBoxInfo, the array in pcmBoxInfo was too small. In this case, only cbBoxInfo elements were stored in pcmBoxInfo. To get the remaining call the function with the correct array length again. If the array is too small, error code CMERROR_BUFFER_OVERFLOW is set. If 0 is returned,then no entry was found and error code CMERROR_BOX_NOT_FOUND is set.
Notes
This function does not really scan all available or desired ports for connected CmDongles because of CodeMeter License Servers Plug&Play mechanism and the implementation of storing all CmContainers and their content in internal lists. The function call checks the internal lists only and returns the matching data.
Syntax
public CmBoxInfo[] CmGetBoxes(HCMSysEntry hcmse, CmGetBoxesOption Port)
|
Parameter
hcmse contains the handle opened by CmAccess / CmAccess2 (must be Subsystem Access).
CmBoxInfo contains an array of the class
CmBoxInfo.
|
CmBoxInfo contains information on a CmContainer. Syntax
Parameter MajorVersion contains the major version of the CmContainer. MinorVersion contains the minor version of the CmContainer. BoxMask contains the box mask of the CmContainer. SerialNumber contains the serial number of the CmContainer. BoxKeyId contains the ID of the used BoxKey of the CmContainer. UserKeyId contains the ID of the used UserKey of the CmContainer. BoxPublicKey contains the public Box Key of the CmContainer. SerialPublicKey contains the public Serial Key of the CmContainer. Notes The length of the BoxPublicKey and SerialPublicKey is 64 byte long. The used public key are currently 224 bits = 28 bytes long. In Elliptic Curve Cryptography the public key is a 2 dimensional point, so the x-value is stored in the first 28 bytes (0..27) and the y-value is store in byte 32..59.
|
CmGetBoxesOption contains the following flags:
AllPorts All CmContainers will be scanned.
Usb All CmDongles (CodeMeter hardware) will be scanned.
Sim Simulated boxes will be scanned.
Act All CmActLicenses will be scanned.
Mask allows to mask bits for license container to be scanned.
Return
The found CmContainers are returned in an array. If 0 an empty array is returned, then no entry was found and error code Errors.BoxNotFound is set.
Notes
This function does not really scan all available or desired ports for connected CmDongles because of CodeMeter License Servers Plug&Play mechanism and the implementation of storing all CmContainers and their content in internal lists. The function call checks the internal lists only and returns the matching data.
Syntax
import cmapi
handle.CmGetBoxes(idPort: int) -> List[cmpai.CMBOXINFO]
Parameter
handle is the handle opened by CmAccess2 (must be Subsystem Access).
idPort contains one of the following commands:
cmapi.CM_GB_ALLPORTS: All CmContainers will be scanned.
cmapi.CM_GB_DONGLE: All CmDongles (CodeMeter hardware) will be scanned. Old naming: CM_GB_USB.
cmapi.CM_GB_SIM: Simulated boxes will be scanned
cmapi.CM_GB_ACT: All CmActLicenses will be scanned.
cmapi.CM_GB_CLOUD: All CmCloudContainer will be scanned.
cmapi.CM_GB_PORT_MASK: Allows to mask bits for license container to be scanned.
Return
The list of found CmContainers is returned. The list can be empty if no entry was found and error code CMERROR_BOX_NOT_FOUND is set.
The list is made of
cmapi.CMBOXINFO classes.
|
CMBOXINFO contains information on a CmContainer. Syntax
Parameter mbMajorVersion contains the major version of the CmContainer. mbMinorVersion contains the minor version of the CmContainer. musBoxMask contains the box mask of the CmContainer. mulSerialNumber contains the serial number of the CmContainer. musBoxKeyId contains the ID of the used BoxKey of the CmContainer. musUserKeyId contains the ID of the used UserKey of the CmContainer. mabBoxPublicKey[cmapi.CM_PUBLIC_KEY_LEN] contains the public Box Key of the CmContainer. mabSerialPublicKey[cmapi.CM_PUBLIC_KEY_LEN] contains the public Serial Key of the CmContainer. mulReserve is reserved for future purposes. Notes The length of the mabBoxPublicKey and mabSerialPublicKey is 64 byte long. The used public key are currently 224 bits = 28 bytes long. In Elliptic Curve Cryptography the public key is a 2 dimensional point, so the x-value is stored in the first 28 bytes (0..27) and the y-value is store in byte 32..59.
|
Notes
This function does not really scan all available or desired ports for connected CmDongles because of CodeMeter License Servers Plug&Play mechanism and the implementation of storing all CmContainers and their content in internal lists. The function call checks the internal lists only and returns the matching data.