我需要读取当前芯片中的MAC地址。
da qin zheng sheng:
Setting MAC address to the Device.
The new MAC address will override the default MAC address and it be saved in the FileSystem.
Requires restarting the device for updating this setting.
_u8 MAC_Address[6]; MAC_Address[0] = 0x8; MAC_Address[1] = 0x0; MAC_Address[2] = 0x28; MAC_Address[3] = 0x22; MAC_Address[4] = 0x69; MAC_Address[5] = 0x31;
sl_NetCfgSet(SL_MAC_ADDRESS_SET,1,SL_MAC_ADDR_LEN,(_u8 *)newMacAddress);
sl_Stop(0); sl_Start(NULL,NULL,NULL);
da qin zheng sheng:
回复 da qin zheng sheng:
#define SL_MAC_ADDR_LEN (6)
#define SL_IPV4_VAL(add_3,add_2,add_1,add_0) ((((_u32)add_3 << 24) & 0xFF000000) | (((_u32)add_2 << 16) & 0xFF0000) | (((_u32)add_1 << 8) & 0xFF00) ((_u32)add_0 & 0xFF) )
#define SL_IPV4_BYTE(val,index) ( (val >> (index*8)) & 0xFF )