/* Serial.c: Retrieves the 64-bit hardware unique serial number. Compiler: BC++ 3.1, Turbo C ++ 1.01(3.01) (free from http://community.borland.com/museum) MSC 6.0, MSVC 1.52. Compile mode: Large Project: serial.c ..\Lib\(8000E.Lib,7188XAL.Lib,7188XBL.Lib,7188XL.Lib or 7188EL.Lib) Hardware: 7188/8000 Detail description: The 64-bit hardware unique serial number is used to protect use's software. Not every controller equips it. You must check the detail specifics of the contorller. You can type command 'Ver' under 7188> or i-8000> prompt to list the number. If the controller doesn't equip a unique number, it shows 5A 5A 5A 5A 5A 5A 5A 5A. [24 May,2005] by Bill [07/Dec/2006] by Liam [July,13,2011] by Nicholas */ #include "..\..\lib\7188e.h" /*---------------------------------------------------------------------------------*/ void main(void) { char cProtectID[8]={0x01,0xF1,0x61,0x52,0x0A,0x00,0x00,0x11}; char cSerialNumber[8]; int bSerialNumOk; int i, iRet; InitLib(); bSerialNumOk=1; //Assume the ID is ok at beginning. iRet=GetSerialNumber(cSerialNumber); if(iRet==NoError) { for(i=0; i<8; i++) { if(cSerialNumber[i]!=cProtectID[i]) { bSerialNumOk=0; break; } } } if(bSerialNumOk) Print("ID Ok!\n\r"); else Print("ID error!\n\r"); }