mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-30 18:07:52 +00:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
			led_respec
			...
			v4.1.0-rc3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 7dd139cf3b | ||
|   | 544b687f46 | ||
|   | c27b015a63 | ||
|   | 02c2e6945b | ||
|   | e7cd5038ac | ||
|   | 34e4a01e25 | ||
|   | 462ff4f813 | ||
|   | 71b738f8ee | ||
|   | 4ad04c7948 | 
| @@ -200,7 +200,7 @@ | |||||||
| 			phy-mode = "sgmii"; | 			phy-mode = "sgmii"; | ||||||
| 			full-duplex; | 			full-duplex; | ||||||
| 			pause; | 			pause; | ||||||
| 			airoha,surge = <1>; | 			airoha,surge = <0>; | ||||||
| 			airoha,polarity = <2>; | 			airoha,polarity = <2>; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -49,10 +49,12 @@ function detect_certificate_type() { | |||||||
| 	let issuer = pipe.read("all"); | 	let issuer = pipe.read("all"); | ||||||
| 	pipe.close(); | 	pipe.close(); | ||||||
|  |  | ||||||
| 	if (!match(issuer, /Telecom Infra Project Issuing CA/)) { | 	if (match(issuer, /OpenLAN Demo Birth CA/)) { | ||||||
| 		ulog(LOG_INFO, 'Certificate type is "Demo" \n'); | 		ulog(LOG_INFO, 'Certificate type is "Demo" \n'); | ||||||
| 		cds_server = 'discovery-qa.open-lan.org'; | 		cds_server = 'discovery-qa.open-lan.org'; | ||||||
| 		timeouts.expiry_threshold = 3 * 24 * 60 * 60; | 		timeouts.expiry_threshold = 3 * 24 * 60 * 60; | ||||||
|  | 	} else if (match(issuer, /OpenLAN Birth Issuing CA/)) { | ||||||
|  | 		ulog(LOG_INFO, 'Certificate type is "Production"\n'); | ||||||
| 	} else { | 	} else { | ||||||
| 		ulog(LOG_INFO, 'Certificate type is "TIP"\n'); | 		ulog(LOG_INFO, 'Certificate type is "TIP"\n'); | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -16,9 +16,11 @@ function set_est_server() { | |||||||
| 	let issuer = pipe.read("all"); | 	let issuer = pipe.read("all"); | ||||||
| 	pipe.close(); | 	pipe.close(); | ||||||
|  |  | ||||||
| 	if (!match(issuer, /Telecom Infra Project Issuing CA/)) { | 	if (match(issuer, /OpenLAN Demo Birth CA/)) { | ||||||
| 		ulog(LOG_INFO, 'Certificate type is "Demo" \n'); | 		ulog(LOG_INFO, 'Certificate type is "Demo" \n'); | ||||||
| 		est_server = 'qaest.certificates.open-lan.org:8001'; | 		est_server = 'qaest.certificates.open-lan.org:8001'; | ||||||
|  | 	} else if (match(issuer, /OpenLAN Birth Issuing CA/)) { | ||||||
|  | 		ulog(LOG_INFO, 'Certificate type is "Production"\n'); | ||||||
| 	} else { | 	} else { | ||||||
| 		ulog(LOG_INFO, 'Certificate type is "TIP"\n'); | 		ulog(LOG_INFO, 'Certificate type is "TIP"\n'); | ||||||
| 	} | 	} | ||||||
| @@ -165,7 +167,7 @@ function fwtool() { | |||||||
| 	let issuer = pipe.read("all"); | 	let issuer = pipe.read("all"); | ||||||
| 	pipe.close(); | 	pipe.close(); | ||||||
|  |  | ||||||
| 	if (!(match(issuer, /OpenLAN/) && match(issuer, /Birth CA/))) | 	if (!(match(issuer, /OpenLAN/) && match(issuer, /Birth/))) | ||||||
| 		return 0; | 		return 0; | ||||||
|  |  | ||||||
| 	ulog(LOG_INFO, 'The issuer is insta\n'); | 	ulog(LOG_INFO, 'The issuer is insta\n'); | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ let config; | |||||||
| let offline_timer; | let offline_timer; | ||||||
| let current_state; | let current_state; | ||||||
| let online = false; | let online = false; | ||||||
|  | let leds_off = false; | ||||||
|  |  | ||||||
| function self_healing() { | function self_healing() { | ||||||
| 	let heal_wifi = false; | 	let heal_wifi = false; | ||||||
| @@ -148,6 +149,13 @@ function online_handler() { | |||||||
|  |  | ||||||
| function config_load() { | function config_load() { | ||||||
| 	ulog(LOG_INFO, 'loading config\n'); | 	ulog(LOG_INFO, 'loading config\n'); | ||||||
|  |  | ||||||
|  | 	uci.load('system'); | ||||||
|  | 	let led_off_cfg = uci.get("system", "@system[0]", "leds_off"); | ||||||
|  | 	if (led_off_cfg == 1) { | ||||||
|  | 		leds_off = true; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	uci.load('state'); | 	uci.load('state'); | ||||||
| 	config = uci.get_all('state'); | 	config = uci.get_all('state'); | ||||||
|  |  | ||||||
| @@ -191,7 +199,7 @@ function led_find(alias) { | |||||||
| function factory_reset_timeout() { | function factory_reset_timeout() { | ||||||
| 	let led = led_find('led-running'); | 	let led = led_find('led-running'); | ||||||
| 	if (led) | 	if (led) | ||||||
| 		led_write(led, 'trigger', 'default-on'); | 		led_write(led, 'trigger', leds-off ? 'none' : 'default-on'); | ||||||
| } | } | ||||||
|  |  | ||||||
| let blink_timer; | let blink_timer; | ||||||
| @@ -210,7 +218,7 @@ let state_handler = { | |||||||
| 	offline: function() { | 	offline: function() { | ||||||
| 		online = false; | 		online = false; | ||||||
| 		let led = led_find('led-running'); | 		let led = led_find('led-running'); | ||||||
| 		if (led) | 		if (!leds_off && led) | ||||||
| 			led_write(led, 'trigger', 'heartbeat'); | 			led_write(led, 'trigger', 'heartbeat'); | ||||||
| 		if (config.ui.offline_trigger) { | 		if (config.ui.offline_trigger) { | ||||||
| 			if (offline_timer) | 			if (offline_timer) | ||||||
| @@ -223,7 +231,7 @@ let state_handler = { | |||||||
| 	online: function() { | 	online: function() { | ||||||
| 		online = true; | 		online = true; | ||||||
| 		let led = led_find('led-running'); | 		let led = led_find('led-running'); | ||||||
| 		if (led) | 		if (!leds_off && led) | ||||||
| 			led_write(led, 'trigger', 'default-on'); | 			led_write(led, 'trigger', 'default-on'); | ||||||
| 		online_handler(); | 		online_handler(); | ||||||
| 		return 0; | 		return 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user