contentLister/src/gethwid.c File Reference

#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include "tffs.h"

Go to the source code of this file.

Defines

#define TFFSDEVICE   "/dev/tffsa"

Functions

int get_hw_id (char *Buffer)


Define Documentation

#define TFFSDEVICE   "/dev/tffsa"

Definition at line 36 of file gethwid.c.


Function Documentation

int get_hw_id ( char *  Buffer  ) 

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

Definition at line 54 of file gethwid.c.

00055 {
00056     flIOctlRecord         ioctlRecord;
00057     flUniqueIdOutput      ID;
00058     int                   i;
00059     int                   docHandle;
00060 
00061     docHandle = open(TFFSDEVICE, O_RDWR);
00062     if(docHandle==-1) 
00063     {
00064         return -1;
00065     }
00066     
00067     ioctlRecord.inputRecord = NULL;
00068     ioctlRecord.outputRecord = &ID;
00069     memset(ID.id, 0x00, 16);
00070     
00071     i = ioctl(docHandle, FL_IOCTL_UNIQUE_ID, &ioctlRecord);
00072     if(i != 0)
00073     {
00074         return -2;
00075     }
00076     memcpy(Buffer, ID.id, 16);
00077     return i;
00078 }


Generated on Sun Dec 14 17:13:27 2008 by  doxygen 1.5.6