mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Added README.md
This commit is contained in:
		
							
								
								
									
										27
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| # A malloc-free JSON parser for Arduino | ||||
|  | ||||
| The library is an convenient and efficient wrapper around the *jsmn* tokenizer: http://zserge.com/jsmn.html | ||||
|  | ||||
| It works without any allocation on the heap (no malloc) and supports nested objects. | ||||
|  | ||||
| ## Example | ||||
|  | ||||
|     char* json = "{\"Name\":\"Blanchon\",\"Skills\":[\"C\",\"C++\",\"C#\"],\"Age\":32,\"Online\":true}"; | ||||
|  | ||||
|     JsonParser<256> parser; | ||||
|  | ||||
|     JsonHashTable hashTable = parser.parseHashTable(json); | ||||
|  | ||||
|     if (!hashTable.success()) | ||||
|     { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     char* name = hashTable.getString("Name"); | ||||
|  | ||||
|     JsonArray skills = hashTable.getArray("Skills"); | ||||
|  | ||||
|     int age = hashTable.getLong("Age"); | ||||
|  | ||||
|     bool online = hashTable.getBool("Online"); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user