return MEM_ERR;
}
To set the current folder, you just need the name of the folder:
CP_CHAR folderName[] = "FOLDER1";
UCHAR *pucManagementTopAddress;
UCHAR ucFolderNumber;
if(BMCSSetCurrentFolder(folderName,pucManagementTopAddress,
&ucFolderNumber) != 0)
{
return MEM_ERR;
}
Searching for a Folder
Unlike with variables, there is only one function that is used to search for a folder. It is
declared as:
int BMCSSearchFolder(CP_CHAR *pcpcFolderName, UCHAR **ppManTopAdr,
UCHAR *pucFolderNumber)
To search, you just need to pass the name of the folder that you are looking for:
// To search "FOLDER1".
CP_CHAR pcpcFolderName[] = "FOLDER1";
UCHAR *pucManagementTopAddress;
UCHAR ucFolderNumber;
if(BMCSSearchFolder(pcpcFolderName, &pucManagementTopAddress,
&ucFolderNumber) != 0)
{
return MEM_ERR;
}
Reading/Writing to MCS using the CPFile Class
Most of the time when you save something in MCS you want to save more than a single
variable. For example, in the AddressBook example that comes with the SDK, all of a
user’s contacts must be saved out to and read in from a single file. To accomplish this,
we use the CPFile classes.
The CPFile class hierarchy looks like this:
117