原创 【原创】ZigBee学习之32—— zmain_dev_info()

2010-2-12 17:30 2686 4 4 分类: MCU/ 嵌入式

  //显示器件的信息,需要LCD的支持,主要使显示了器件的IEEE地址<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


  zmain_dev_info();


static ZSEG void zmain_dev_info ( void )


{


#ifdef LCD_SUPPORTED


  uint8 i;


  uint8 ch;


  uint8 *xad;


  unsigned char lcd_buf[18];


 


  //显示扩展地址


  xad = (uint8*)&aExtendedAddress + Z_EXTADDR_LEN - 1;


  for ( i = 0; i < Z_EXTADDR_LEN*2; xad-- ) {


    ch = (*xad >> 4) & 0x<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />0F;


    lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');


    ch = *xad & 0x0F;


    lcd_buf[i++] = ch + (( ch < 10 ) ? '0' : '7');


  }


  lcd_buf[Z_EXTADDR_LEN*2] = '\0';


  HalLcdWriteString( "IEEE Address:", HAL_LCD_LINE_1 );


  HalLcdWriteString( (char*)lcd_buf, HAL_LCD_LINE_2 );


#endif // LCD


}

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /3 下一条