浏览代码

Fix generation of the salt

Bernd Gottschlag 5 年前
父节点
当前提交
b10df03e01
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      weather-sensor/firmware/main.c

+ 3
- 3
weather-sensor/firmware/main.c 查看文件

96
 	Set_Up_Power_Save_Mode();
96
 	Set_Up_Power_Save_Mode();
97
 
97
 
98
 	/* Initialize the salt */
98
 	/* Initialize the salt */
99
-	salt = 0xFFFFFFFFFFFFFFFFull;
100
-	salt &= ~ownId;
99
+	salt = 0xFFFFFFFFFFFFFF00ull;
100
+	salt |= ownId;
101
 
101
 
102
 	/* Delay the change of the operating frequency by the function Enter_Power_Save_Mode for the
102
 	/* Delay the change of the operating frequency by the function Enter_Power_Save_Mode for the
103
 	 * first function pass. If it is changed before the ISP can flash the MCU the clocks of the ISP
103
 	 * first function pass. If it is changed before the ISP can flash the MCU the clocks of the ISP
122
 
122
 
123
 			memset((uint8_t*)&reportPacket, 0, sizeof(reportPacket)); //Reinitialize the buffer with zeros
123
 			memset((uint8_t*)&reportPacket, 0, sizeof(reportPacket)); //Reinitialize the buffer with zeros
124
 
124
 
125
-			salt &= ~(1ull<<55);
125
+			salt &= ~(1ull<<63);
126
 			reportPacket.salt = salt;
126
 			reportPacket.salt = salt;
127
 			reportPacket.payload.values.packetIdentifier.elementCount = 3;
127
 			reportPacket.payload.values.packetIdentifier.elementCount = 3;
128
 			reportPacket.payload.values.packetIdentifier.packetType = PACKET_TYPE_REPORT;
128
 			reportPacket.payload.values.packetIdentifier.packetType = PACKET_TYPE_REPORT;

正在加载...
取消
保存