/*---------------------------------------------------------------------------*/ void uz2400_set_pan_addr(unsigned pan, unsigned addr, const cyg_uint8 *ieee_addr) { cyg_uint16 f = 0; GET_LOCK(); /* UzSetPanId(pan); */ uz_set_panId(pan); /* UzSetNwkAddr(addr); */ uz_set_nwk_addr(addr); if(ieee_addr != NULL) { cyg_uint8 addr[8]; /* LSB first, MSB last for 802.15.4 addresses in UZ2400 */ for (f = 0; f < 8; f++) { addr[7-f] = ieee_addr[f]; } /* UzSetMacAddress(addr); */ uz_set_mac_address(addr); } RELEASE_LOCK(); }
/*---------------------------------------------------------------------------*/ void uz2400_set_pan_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr) { uz_set_panId(pan); uz_set_nwk_addr(addr); uz_set_mac_address(ieee_addr); }
void rf_init(unsigned short panid,unsigned short nwkaddr,unsigned char channel){ uz_init(); uz_set_tx_power(0); uz_enable_ext_wakeup(); uz_set_channel(channel); uz_set_panId(panid); uz_set_nwk_addr(nwkaddr); init_package(panid,nwkaddr); set_tx_dst_panid(0xffff); set_tx_dst_nwk_addr(0xffff); uz_rx_normal_mode(); }