forked from j3d1/fiatlux
		
	stash
This commit is contained in:
		
							parent
							
								
									9eb69ac329
								
							
						
					
					
						commit
						e791c5aac0
					
				
					 1 changed files with 16 additions and 1 deletions
				
			
		|  | @ -294,6 +294,7 @@ | |||
|                             <input type="checkbox" name="onoffswitch" id="led-switch" onclick="gpio()"> | ||||
|                             <span class="toggle button">toggle signal led</span> | ||||
|                         </label> | ||||
|                         <span><input type="color" onchange="console.log(colorStringToVec(event.target.value))"/></span> | ||||
|                     </footer> | ||||
|                 </article> | ||||
|             </div> | ||||
|  | @ -321,6 +322,18 @@ | |||
|         return pos; | ||||
|     }; | ||||
| 
 | ||||
|     DataView.prototype.setInt8Vec = function (pos, vec) { | ||||
|         for (var i = 0; i < vec.length; i++) { | ||||
|             this.setInt8(pos++, vec[i]); | ||||
|         } | ||||
|         return pos; | ||||
|     }; | ||||
| 
 | ||||
|     function colorStringToVec(hex) { | ||||
|         var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); | ||||
|         return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null; | ||||
|     } | ||||
| 
 | ||||
|     var ws; | ||||
|     var retries; | ||||
|     var series = new TimeSeries(); | ||||
|  | @ -556,13 +569,15 @@ | |||
|         const ssid = ap_ssid.value; | ||||
|         const password = ap_pw.value; | ||||
| 
 | ||||
|         const buffer = new ArrayBuffer(ssid.length + password.length + 4); | ||||
|         const buffer = new ArrayBuffer(ssid.length + password.length + 4 + 8); | ||||
|         const view1 = new DataView(buffer); | ||||
|         var tx_len = 0; | ||||
|         view1.setChar(tx_len++, 'A'); | ||||
|         view1.setChar(tx_len++, (en ? "E" : "D")); | ||||
|         tx_len = view1.setString(tx_len, ssid); | ||||
|         tx_len = view1.setString(tx_len, password); | ||||
|         tx_len = view1.setInt8Vec(tx_len, [192, 168, 111, 1]); | ||||
|         tx_len = view1.setInt8Vec(tx_len, [255, 255, 255, 0]); | ||||
|         wsWrite(buffer); | ||||
|     } | ||||
| </script> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue