Interpreting NIM data
The information that can be retrieved from a NIM is comprehensive, and standards must be consulted with regard to the location and interpretation (see INF-8074i, SFF-8402, SFF-8431, SFF-8436, SFF-8472, SFF-8665, CFP4 HW Spec and CFP MSA MIS).
Reducing the load on the system
Accessing NIM data, especially dynamic data, which are not cached, can put a considerable load on the system and, in addition, it takes time. So avoid accessing NIM data more often than once per second, and only read data that are actually needed.
Putting the access task into a background thread might be a solution to maintain responsiveness in the main thread. Still the readings will interfere with the background reading done by the driver.
Handling return codes
The return codes for the access functions must be observed, and the function call can only be considered accomplished if this is indicated by the corresponding return code.
A number of dedicated NIM error codes exist to indicate, for instance, that the port accessed has no NIM plugged in, or that an attempt has been made to access an address that is not supported by the NIM that is currently plugged in.
Reading the port status can also establish whether a NIM is present or not. However, the return code must still be handled properly since the module might have been unplugged before the attempt to access the NIM data was made.
Handling unplugging of NIMs
Code that handles NIMs must be able to handle the fact that these can be plugged or unplugged at unpredictable times, for instance, while their data are being accessed, which might lead to low-level errors.