Checking the Security Key Validity for a Board
Setting the OemSafetyKey parameter to a an 8-bytes string instructs the driver that this security key is to be checked.
Subsequently, getting the OemSafetyLock parameter returns a string TRUE if the security key recorded in the board matches the value entered with the parameter OemSafetyKey. Otherwise, the returned string is FALSE.
The targeted board is selected by DriverIndex=1. The security key is MY_NUM18.
The Status variable can be used for error checking.
[C]
//Variables declaration
char Match[6];
MCSTATUS Status;
//Connecting to driver
Status = McOpenDriver(NULL);
//Entering the reference key number
Status = McSetParamStr(MC_BOARD + 1, MC_OemSafetyKey, "MY_NUM18");
//Checking for correspondence
McGetParamStr(MC_BOARD + 1, MC_OemSafetyLock, &Match, 6);
if (Match=="FALSE")
{
//...
//Rejection code
//...
}
//Disconnecting from driver
Status = McCloseDriver();