FMSW_GetImage API to validate an FM

This call returns a pointer to a Functionality Module image and a pointer to the size of the image, to assist the verification of FMs in compliance with industry and national standards. This is available once the FM is activated. To check the FM before it is deployed in an operational setting with your important keys and objects, we suggest that you first perform image integrity checks in a closed/offline environment, before deploying to the production environment.

API Specification:


/**
 * Obtain a pointer to the FM's image and its size.
 *
 * @param fmNumber
 *   FM Number.
 *
 * @param image
 *   A pointer to receive the pointer to the FM image.
 *
 * @param imageLength
 *   A pointer to receive the size of the FM image.
 *
 * @return
 *   @li FMSW_OK: The function processed the command OK.
 *   @li FMSW_BAD_FM_NUMBER: The FM number is incorrect.
 */

FMSW_STATUS FMSW_GetImage(
   FMSW_FmNumber_t   fmNumber,
   void              **image,
   uint32_t          *imageLength
);

Sample Code:


{
   void       *pimage;
   uint32_t   imageLength;

   FMSW_STATUS err = FMSW_GetImage(GetFMID(), &pimage, &imageLength);

   if (FMSW_OK != err)
   {
      // error handling
   }
}

 

Usage Notes

Use static IDs for the FMs to ensure that the retrieved image does not change. A dynamically allocated FM ID would not match, and the validation of the image would fail.