1.将f8wConfig.cfg文件中设置为-DSECURE=1,
2.将ZGlobals.c中的uint8 zgPreConfigKeys = FLASE;修改为uint8 zgPreConfigKeys = TRUE.
3.准备一个key,这个可以在函数nwk_global.c中修改:
CONST uint8 defaultKey[SEC_KEY_LEN] = { #if defined ( APP_TP ) || defined ( APP_TP2 )// Key for ZigBee Conformance Testing0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa #else// Key for In-House Testing0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F #endif };
完成以上3步,以后通信就加密了,但是加密是在网络层的,加密不影响设备入网,只是入网后不能继续通信了
Susan Yang:
更多资料您可以参考
http://www.prochild.com/board/files/tb_3/DN108%20Using%20AES%20Encrytion%20in%20CC111xFx_CC243x%20and%20CC251xFx%20swra172.pdf
以及
http://processors.wiki.ti.com/images/7/7b/10_-_ZigBee_Security.pdf