bugfix progversion handling in configmanager
This commit is contained in:
		
							parent
							
								
									a7bc2be9b7
								
							
						
					
					
						commit
						d8210d3ec3
					
				@ -55,12 +55,12 @@ enum snifftype_t { MAC_SNIFF_WIFI, MAC_SNIFF_BLE, MAC_SNIFF_BLE_ENS };
 | 
				
			|||||||
// using packed to avoid compiler padding, because struct will be memcpy'd to
 | 
					// using packed to avoid compiler padding, because struct will be memcpy'd to
 | 
				
			||||||
// byte array
 | 
					// byte array
 | 
				
			||||||
typedef struct __attribute__((packed)) {
 | 
					typedef struct __attribute__((packed)) {
 | 
				
			||||||
  char version[10];    // Firmware version
 | 
					  char version[10] = ""; // Firmware version
 | 
				
			||||||
  uint8_t loradr;      // 0-15, lora datarate
 | 
					  uint8_t loradr;        // 0-15, lora datarate
 | 
				
			||||||
  uint8_t txpower;     // 2-15, lora tx power
 | 
					  uint8_t txpower;       // 2-15, lora tx power
 | 
				
			||||||
  uint8_t adrmode;     // 0=disabled, 1=enabled
 | 
					  uint8_t adrmode;       // 0=disabled, 1=enabled
 | 
				
			||||||
  uint8_t screensaver; // 0=disabled, 1=enabled
 | 
					  uint8_t screensaver;   // 0=disabled, 1=enabled
 | 
				
			||||||
  uint8_t screenon;    // 0=disabled, 1=enabled
 | 
					  uint8_t screenon;      // 0=disabled, 1=enabled
 | 
				
			||||||
  uint8_t countermode; // 0=cyclic unconfirmed, 1=cumulative, 2=cyclic confirmed
 | 
					  uint8_t countermode; // 0=cyclic unconfirmed, 1=cumulative, 2=cyclic confirmed
 | 
				
			||||||
  int16_t rssilimit;   // threshold for rssilimiter, negative value!
 | 
					  int16_t rssilimit;   // threshold for rssilimiter, negative value!
 | 
				
			||||||
  uint8_t sendcycle;   // payload send cycle [seconds/2]
 | 
					  uint8_t sendcycle;   // payload send cycle [seconds/2]
 | 
				
			||||||
 | 
				
			|||||||
@ -32,7 +32,9 @@ static uint8_t buffer[cfgLen + cfgLen2];
 | 
				
			|||||||
// 3. magicByte [cfgLen2 bytes, containing a fixed identifier]
 | 
					// 3. magicByte [cfgLen2 bytes, containing a fixed identifier]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void defaultConfig(configData_t *myconfig) {
 | 
					static void defaultConfig(configData_t *myconfig) {
 | 
				
			||||||
  memcpy(myconfig->version, &PROGVERSION, 10); // Firmware version
 | 
					
 | 
				
			||||||
 | 
					  strncpy(myconfig->version, PROGVERSION,
 | 
				
			||||||
 | 
					          sizeof(myconfig->version) - 1); // Firmware version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // device factory settings
 | 
					  // device factory settings
 | 
				
			||||||
  myconfig->loradr = LORADRDEFAULT; // 0-15, lora datarate, see paxcounter.conf
 | 
					  myconfig->loradr = LORADRDEFAULT; // 0-15, lora datarate, see paxcounter.conf
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user