#include <stdio.h>
#include "i8094_dll.h"

int main( void )
{
   int i;
   short nRet;
   short module_num;
   BYTE avail_module[8], bSlot_num;
   WORD wModuleID;

   nRet = i8094_scan( &module_num, avail_module  ); 
   if( nRet == SUCCESS_NO_ERROR )
   {
        printf(" There is/are %d i-8094/F modules available on LinPAC\n", module_num ); 
	      printf(" Available-Module = { ");
        for( i=0; i<8; i++ )
        {
	    if( i == 7 ) //final element 
	    	printf("%d }\n", avail_module[i] );
	    else
	    	printf("%d, ", avail_module[i] );
        }
	
        for( i=0; i<module_num; i++ )
        {
	    nRet = i8094_get_cardinfo( i, &bSlot_num, &wModuleID );
            if( nRet == SUCCESS_NO_ERROR )
	    {
      switch( wModuleID )
		  {
		    case 0x45:
	        	printf(" I-8094 on Slot#%d\n", bSlot_num +1 );
		  	break;
		    case 0x53:
	        	printf(" I-8094F on Slot#%d\n", bSlot_num +1 );
		  	break;
		    default:
	        	printf(" Unknown device [0x%02X] on Slot#%d\n", wModuleID, bSlot_num );

		  }

	    }
        }
   }
   else
	printf (" i8094_scan() return %d !\n", nRet ); 

   return 0;

}

