Reads the on-board OEM data for a given board.
AG
CG
DWORD adiGetEEPromData ( CTAHD ctahd, unsigned board, unsigned size, ADI_EEPROM_DATA *eepromdata)
|
Argument |
Description |
|
ctahd |
Context handle returned by ctaCreateContext or ctaAttachContext. |
|
board |
Board number as specified in the board keyword file. |
|
size |
Size of the caller's structure (the returned size is enclosed in the eepromdata structure). |
|
eepromdata |
Pointer to the returned structure, as shown: typedef struct |
|
Return value |
Description |
|
SUCCESS |
|
|
CTAERR_BAD_ARGUMENT |
NULL pointer was passed for eepromdata. |
|
CTAERR_BAD_SIZE |
size is smaller than the size of DWORD. |
|
CTAERR_INVALID_BOARD |
Invalid board was specified. |
|
CTAERR_INVALID_CTAHD |
Context handle is invalid. |
|
CTAERR_SVR_COMM |
Server communication error. |
Use adiGetEEPromData to return OEM information stored on a PROM on the specified board.
The ctahd argument is used to access the context on which the ADI service was opened. The ADI service can be opened in driver-only mode if desired. In this case, no actual board resources are reserved. Set the board field in the MVIP_ADDR structure passed to ctaOpenServices to ADI_AG_DRIVER_ONLY. This function also works with a context that has the ADI service opened on actual MVIP streams and timeslots.
/* Display first 16-bit value in EEProm */
void showeeprom (unsigned drvid)
{
ADI_EEPROM_DATA eeprom;
adiGetEEPromData( drvid, 0, sizeof eeprom, &eeprom);
printf("data[0] = %x\n", eeprom.data[0]);
}