蓝牙获取MAC地址并转换成字符串形式

void draw_MAC(uint8 *Addr)
{
  Addr[5]=XREG(0X780E);
  Addr[4]=XREG(0X780F);
  Addr[3]=XREG(0X7810);
  Addr[2]=XREG(0X7811);
  Addr[1]=XREG(0X7812);
  Addr[0]=XREG(0X7813);
}


char *bdAddr2Str( uint8 *pAddr )
{
  uint8       i;
  char        hex[] = "0123456789ABCDEF";
  static char str[12];
  char        *pStr = str;




  for ( i = B_ADDR_LEN; i > 0; i-- )
  {
    *pStr++ = hex[*pAddr >> 4];
    *pStr++ = hex[*pAddr++ & 0x0F];
  }


  return str;
}

你可能感兴趣的:(蓝牙获取MAC地址并转换成字符串形式)