示例#1
0
int board_get_wifimac(char *wifimac)
{
	int n,i;
	char temp[32];
#ifdef BOOTSD_INCLUDE
	if (target_is_emmc_boot())
		n = get_emmc_serial(temp);
	else
#endif
#if defined(NAND_BOOT_INCLUDE)
		n = NAND_GetSerialNumber(temp, 32);
#else
		return 0;
#endif
	if (temp[1] == '1') {
		for (i=0; i<12; i++) {
			*wifimac++ = temp[4+i];
			if (i==11) break;
			if (!((i+1)%2)) *wifimac++ = ':';
		}
	} else if(temp[1] == '2') {
		for (i=0; i<12; i++) {
			*wifimac++ = temp[16+i];
			if (i==11) break;
			if (!((i+1)%2)) *wifimac++ = ':';
		}
	}
	*wifimac = '\0';
	return strlen(wifimac);
}
示例#2
0
int board_get_btaddr(char *btaddr)
{
	int n,i;
	char temp[32];
	n = NAND_GetSerialNumber(temp, 32);
	for (i=4; i<16; i++)	// 12 = bluetooth bd address field(12)
		*btaddr++ = temp[i];
	*btaddr = '\0';
	return strlen(btaddr);
}
示例#3
0
int board_get_serialno(char *serialno)
{
	int n,i;
	char temp[32];
	n = NAND_GetSerialNumber(temp, 32);
	for (i=0; i<4; i++)	// 4 = custon field(2) + product number(2)
		*serialno++ = temp[i];
	for (i=16; i<32; i++)	// 16 = time(12) + serial count(4)
		*serialno++ = temp[i];
	*serialno = '\0';
	return strlen(serialno);
}
示例#4
0
/**************************************************************************
*  FUNCTION NAME :
*
*      int	FwdnGetNandSerial(unsigned char *pucSN, unsigned int uiSize);
*
*  DESCRIPTION : Read and Check the Serial Number stored at NAND Flash.
*                        Verification result is reflected to global structure of FWDN_DeviceInformation.
*
*  INPUT:
*			None
*
*  OUTPUT:	int - Return Type
*  			= always 0
*
**************************************************************************/
int	FwdnGetNandSerial(unsigned char *pucSN, unsigned int uiSize)
{
#if defined(TNFTL_V8_INCLUDE)
	return NAND_GetSerialNumber(pucSN, uiSize);
#else
	unsigned char		ucTempData[512];

	/*Get serial number*/
	memset ( ucTempData, 0xFF, 512);

	FWUG_NAND_GetSerialNumberNAND( ucTempData );

	FWDN_FNT_VerifySN( ucTempData, 0 );

	memcpy(pucSN,ucTempData,min(uiSize,32));
	return min(uiSize,32);
#endif
}
示例#5
0
int board_get_btaddr(char *btaddr)
{
	int n,i;
	char temp[32];
#ifdef BOOTSD_INCLUDE
	if (target_is_emmc_boot())
		n = get_emmc_serial(temp);
	else
#endif
#if defined(NAND_BOOT_INCLUDE)
		n = NAND_GetSerialNumber(temp, 32);
#else
		return 0;
#endif
	for (i=4; i<16; i++)	// 12 = bluetooth bd address field(12)
		*btaddr++ = temp[i];
	*btaddr = '\0';
	return strlen(btaddr);
}
示例#6
0
int board_get_serialno(char *serialno)
{
	int n,i;
	char temp[32];
#ifdef BOOTSD_INCLUDE
	if (target_is_emmc_boot())
		n = get_emmc_serial(temp);
	else
#endif
#if defined(NAND_BOOT_INCLUDE)
		n = NAND_GetSerialNumber(temp, 32);
#else
		return 0;
#endif
	for (i=0; i<4; i++)	// 4 = custon field(2) + product number(2)
		*serialno++ = temp[i];
	for (i=16; i<32; i++)	// 16 = time(12) + serial count(4)
		*serialno++ = temp[i];
	*serialno = '\0';
	return strlen(serialno);
}
示例#7
0
int board_get_wifimac(char *wifimac)
{
        int n,i;
        char temp[32];
        n = NAND_GetSerialNumber(temp, 32);
        if (temp[1] == '1') {
                for (i=0; i<12; i++) {
                        *wifimac++ = temp[4+i];
                        if (i==11) break;
                        if (!((i+1)%2)) *wifimac++ = ':';
                }
        } else if(temp[1] == '2') {
                for (i=0; i<12; i++) {
                        *wifimac++ = temp[16+i];
                        if (i==11) break;
                        if (!((i+1)%2)) *wifimac++ = ':';
                }
        }
        *wifimac = '\0';
        return strlen(wifimac);
}