VLScleanSetPersistenceDevice

Syntax

int VLScleanSetPersistenceDevice (	 	 
VLScpdPersistenceDeviceT	persistenceDevice,
VLScpdIfImpl	 		*deviceIoImpl,
unsigned long	 		*reserved1,
unsigned char	 		*reserved2 );

Argument

Direction

Data Type

Description

persistenceDevice

IN

VLScpdPersistenceDeviceT 

Enable or disable custom persistence device feature.

Allowed values are:

>VLS_CPD_NO_DEVICE (Disabled)

>VLS_CPD_CUSTOM_DEVICE (Use custom persistence device)

deviceIoImp

IN

VLScpdIfImpl

Structure for passing pointers to the implementation of call back functions by the developer

reserved1

 

unsigned long

Reserved for future use.

reserved2

 

unsigned char

Reserved for future use.

Description

This API allows user to clean the persistence data stored using the custom persistence device feature.

Returns

The status code VLS_CPD_SUCCESS is returned if successful. Otherwise, a specific status code is returned indicating the reason for failure. For a list of error codes, see Persistence Cleaning Error Codes.

Code Snippet

main()
		{
		VLScpdIfImpl cpdImpl;
		/* Register the function pointer to callback API*/
		cpdImpl.szStruct           = sizeof(VLScpdIfImpl);		
		cpdImpl.implInitDevice     = &VLScpdInitializeDevice; 
		cpdImpl.implExitDevice     = &VLScpdExitDevice;
		cpdImpl.implCreateObject   = &VLScpdCreateObject;
		cpdImpl.implWriteRecord    = &VLScpdWriteRecord;
		cpdImpl.implReadRecord     = &VLScpdReadRecord;
		cpdImpl.implReadNextRecord = &VLScpdReadNextRecord;
		cpdImpl.implDeleteRecord   = &VLScpdDeleteRecord;

		/* Configure RMS libraries in Custom Persistence Device mode
		/* Use VLS_CPD_NO_DEVICE to discard persistence data*/
		rc = VLScleanSetPersistenceDevice(VLS_CPD_CUSTOM_DEVICE, &cpdImpl, NULL, NULL);


if(rc != LS_SUCCESS) { printf("RMS Error: Failed to configure the custom device, api returned %d \n", (int)rc); return 1; }

Steps to Perform

1.Include the custom persistence device header file lscpdif.h.

2.Define the implementation for Custom Persistence Device interface callback API.

3.Call the VLScleanSetPersistenceDevice API before calling the cleaning API.

4.Build the application.