|  |  |  | @@ -5,52 +5,62 @@ LoRa_E220 e220ttl(GPIO_LORA_TX, GPIO_LORA_RX, GPIO_LORA_AUX, 3, 4); // Arduino R | 
		
	
		
			
				|  |  |  |  | void printParameters(struct Configuration configuration); | 
		
	
		
			
				|  |  |  |  | void printModuleInformation(struct ModuleInformation moduleInformation); | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | void InitLoRa(void (*MPinHelper)(int, int)) | 
		
	
		
			
				|  |  |  |  | bool InitLoRa(void (*MPinHelper)(int, int)) | 
		
	
		
			
				|  |  |  |  | { | 
		
	
		
			
				|  |  |  |  |     bool returnval; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     e220ttl.setMPins = MPinHelper; | 
		
	
		
			
				|  |  |  |  |     e220ttl.begin(); | 
		
	
		
			
				|  |  |  |  |     returnval = e220ttl.begin(); | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     ResponseStructContainer c; | 
		
	
		
			
				|  |  |  |  |     c = e220ttl.getConfiguration(); | 
		
	
		
			
				|  |  |  |  |     // It's important get configuration pointer before all other operation | 
		
	
		
			
				|  |  |  |  |     Configuration configuration = *(Configuration *)c.data; | 
		
	
		
			
				|  |  |  |  |     Serial.println(c.status.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |     Serial.println(c.status.code); | 
		
	
		
			
				|  |  |  |  |     if (returnval == true) | 
		
	
		
			
				|  |  |  |  |     { | 
		
	
		
			
				|  |  |  |  |         ResponseStructContainer c; | 
		
	
		
			
				|  |  |  |  |         c = e220ttl.getConfiguration(); | 
		
	
		
			
				|  |  |  |  |         // It's important get configuration pointer before all other operation | 
		
	
		
			
				|  |  |  |  |         Configuration configuration = *(Configuration *)c.data; | 
		
	
		
			
				|  |  |  |  |         Serial.println(c.status.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |         Serial.println(c.status.code); | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     ResponseStructContainer cMi; | 
		
	
		
			
				|  |  |  |  |     cMi = e220ttl.getModuleInformation(); | 
		
	
		
			
				|  |  |  |  |     // It's important get information pointer before all other operation | 
		
	
		
			
				|  |  |  |  |     // ModuleInformation mi = *(ModuleInformation *)cMi.data; | 
		
	
		
			
				|  |  |  |  |         ResponseStructContainer cMi; | 
		
	
		
			
				|  |  |  |  |         cMi = e220ttl.getModuleInformation(); | 
		
	
		
			
				|  |  |  |  |         // It's important get information pointer before all other operation | 
		
	
		
			
				|  |  |  |  |         // ModuleInformation mi = *(ModuleInformation *)cMi.data; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     Serial.println(cMi.status.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |     Serial.println(cMi.status.code); | 
		
	
		
			
				|  |  |  |  |         Serial.println(cMi.status.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |         Serial.println(cMi.status.code); | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     //	----------------------- DEFAULT TRANSPARENT WITH RSSI ----------------------- | 
		
	
		
			
				|  |  |  |  |     configuration.ADDL = 0x02; | 
		
	
		
			
				|  |  |  |  |     configuration.ADDH = 0x00; | 
		
	
		
			
				|  |  |  |  |         //	----------------------- DEFAULT TRANSPARENT WITH RSSI ----------------------- | 
		
	
		
			
				|  |  |  |  |         configuration.ADDL = 0x02; | 
		
	
		
			
				|  |  |  |  |         configuration.ADDH = 0x00; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     configuration.CHAN = 23; | 
		
	
		
			
				|  |  |  |  |         configuration.CHAN = 23; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     configuration.SPED.uartBaudRate = UART_BPS_9600; | 
		
	
		
			
				|  |  |  |  |     configuration.SPED.airDataRate = AIR_DATA_RATE_010_24; | 
		
	
		
			
				|  |  |  |  |     configuration.SPED.uartParity = MODE_00_8N1; | 
		
	
		
			
				|  |  |  |  |         configuration.SPED.uartBaudRate = UART_BPS_9600; | 
		
	
		
			
				|  |  |  |  |         configuration.SPED.airDataRate = AIR_DATA_RATE_010_24; | 
		
	
		
			
				|  |  |  |  |         configuration.SPED.uartParity = MODE_00_8N1; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     configuration.OPTION.subPacketSetting = SPS_200_00; | 
		
	
		
			
				|  |  |  |  |     configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_ENABLED; | 
		
	
		
			
				|  |  |  |  |     configuration.OPTION.transmissionPower = POWER_22; | 
		
	
		
			
				|  |  |  |  |         configuration.OPTION.subPacketSetting = SPS_200_00; | 
		
	
		
			
				|  |  |  |  |         configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_ENABLED; | 
		
	
		
			
				|  |  |  |  |         configuration.OPTION.transmissionPower = POWER_22; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED; | 
		
	
		
			
				|  |  |  |  |     configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION; | 
		
	
		
			
				|  |  |  |  |     configuration.TRANSMISSION_MODE.enableLBT = LBT_ENABLED; | 
		
	
		
			
				|  |  |  |  |     configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011; | 
		
	
		
			
				|  |  |  |  |         configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED; | 
		
	
		
			
				|  |  |  |  |         configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION; | 
		
	
		
			
				|  |  |  |  |         configuration.TRANSMISSION_MODE.enableLBT = LBT_ENABLED; | 
		
	
		
			
				|  |  |  |  |         configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011; | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     // Set configuration changed and set to not hold the configuration | 
		
	
		
			
				|  |  |  |  |     ResponseStatus rs = e220ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE); | 
		
	
		
			
				|  |  |  |  |     Serial.println(rs.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |     Serial.println(rs.code); | 
		
	
		
			
				|  |  |  |  |     c.close(); | 
		
	
		
			
				|  |  |  |  |         // Set configuration changed and set to not hold the configuration | 
		
	
		
			
				|  |  |  |  |         ResponseStatus rs = e220ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE); | 
		
	
		
			
				|  |  |  |  |         Serial.println(rs.getResponseDescription()); | 
		
	
		
			
				|  |  |  |  |         Serial.println(rs.code); | 
		
	
		
			
				|  |  |  |  |         c.close(); | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  |     printParameters(configuration); | 
		
	
		
			
				|  |  |  |  |         printParameters(configuration); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     else | 
		
	
		
			
				|  |  |  |  |     { | 
		
	
		
			
				|  |  |  |  |         MaintainDTC(DTC_NO_LORA_FOUND, DTC_WARN, true); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |     return returnval; | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
		
	
		
			
				|  |  |  |  | void LoRa_Process() | 
		
	
	
		
			
				
					
					|  |  |  |   |