Technical information
Programming - Asset Management
50
RMS Enterprise - NetLinx Programmer’s Guide
Asset Registration Functions
The Asset Registration functions in the RmsApi.axi Include File are described in the following table:
Asset Registration Functions
RmsAssetRegister Description: This function is used to register a new asset with the RMS system. This method is the general use asset
registration method. This method should be used for custom implemented NetLinx controlled devices and any asset that is not
AMX hardware.
Arguments:
• DEV device - asset physical device instance
• RmsAsset asset - asset configuration to register
Returns: 1 if asset registration call was successful; 0 if asset registration call was unsuccessful
Syntax:
DEFINE_FUNCTION CHAR RmsAssetRegister(DEV device, RmsAsset asset)
{
STACK_VAR CHAR rmsCommand[RMS_MAX_CMD_LEN];
// ensure RMS is ONLINE, REGISTERED, and ready for ASSET registration
IF(![vdvRMS,RMS_CHANNEL_ASSETS_REGISTER])
{
SEND_STRING 0, '>>>> RMS API ERROR <RmsAssetRegister> :: RMS is not ready to accept asset management
registrations.';
RETURN FALSE;
}
// the asset client key is the DPS string
// for NetLinx-based devices
IF(asset.clientKey == '')
{
asset.clientKey = RmsDevToString(device);
}
// create asset registration send command
rmsCommand = RmsPackCmdHeader('ASSET.REGISTER.DEV');
rmsCommand = RmsPackCmdParam(rmsCommand,RmsDevToString(device));
rmsCommand = RmsPackCmdParam(rmsCommand,asset.name);
rmsCommand = RmsPackCmdParam(rmsCommand,asset.clientKey);
rmsCommand = RmsPackCmdParam(rmsCommand,asset.assetType);
rmsCommand = RmsPackCmdParam(rmsCommand,asset.globalKey);
// add device to registration queue
SEND_COMMAND vdvRMS, rmsCommand;
// now that the asset has been created in the
// asset registration queue, finalize and submit
// the asset
RETURN RmsAssetRegistrationSubmit(asset);
}