bugfix senddata.cpp
This commit is contained in:
		
							parent
							
								
									2821bc60f3
								
							
						
					
					
						commit
						53fbab8f92
					
				| @ -10,7 +10,7 @@ void senddata(uint8_t port) { | |||||||
|     sprintf(display_line7, "LORA BUSY"); |     sprintf(display_line7, "LORA BUSY"); | ||||||
|   } else { |   } else { | ||||||
|     // send payload via LoRa
 |     // send payload via LoRa
 | ||||||
|     LMIC_setTxData2(PAYLOADPORT, payload.getBuffer(), payload.getSize(), |     LMIC_setTxData2(port, payload.getBuffer(), payload.getSize(), | ||||||
|                     (cfg.countermode & 0x02)); |                     (cfg.countermode & 0x02)); | ||||||
|     ESP_LOGI(TAG, "%d bytes queued to send on LoRa", payload.getSize()); |     ESP_LOGI(TAG, "%d bytes queued to send on LoRa", payload.getSize()); | ||||||
|     sprintf(display_line7, "PACKET QUEUED"); |     sprintf(display_line7, "PACKET QUEUED"); | ||||||
| @ -18,12 +18,12 @@ void senddata(uint8_t port) { | |||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| #ifdef HAS_SPI | #ifdef HAS_SPI | ||||||
|   // code for sending payload via SPI to come
 |   // to come here: code for sending payload to a local master via SPI
 | ||||||
|   ESP_LOGI(TAG, "%d bytes sent on SPI", payload.getSize()); |   ESP_LOGI(TAG, "%d bytes sent on SPI", payload.getSize()); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|   // clear counter if not in cumulative counter mode
 |   // clear counter if not in cumulative counter mode
 | ||||||
|   if (cfg.countermode != 1) { |   if ((port == PAYLOADPORT) && (cfg.countermode != 1)) { | ||||||
|     reset_counters(); // clear macs container and reset all counters
 |     reset_counters(); // clear macs container and reset all counters
 | ||||||
|     reset_salt();     // get new salt for salting hashes
 |     reset_salt();     // get new salt for salting hashes
 | ||||||
|     ESP_LOGI(TAG, "Counter cleared (countermode = %d)", cfg.countermode); |     ESP_LOGI(TAG, "Counter cleared (countermode = %d)", cfg.countermode); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user