cammiboi / jsonFunctions

ESP-32 esp-idf component: C functions to parse JSON strings

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsonFunctions

ESP-32 eps-idf component to parse JSON strings

Functions

int jsonTagFinder(char *jsonStringToSearch, char *tagToFind, char *stringToStoreValue, int maxValueLength);

given:

  • a pointer to JSON string to search, jsonStringToSearch
  • a pointer to string of the key to find, tagToFind
  • the maximum length of the value, aka maximum number of characters of the value to copy

it returns:

  • return value - -1 if not found and 0 if found
  • the found value in stringToStoreValue - pointer to string where the found value should be copied to

int jsonGetArray(char *jsonStringToSearch, char *tagToFind, int *arrayToStoreValues, int maxArrayLength);

given:

  • a pointer to JSON string to search, jsonStringToSearch
  • a pointer to string of the key to find, tagToFind
  • the maximum length of the array to find, maxArrayLength

it returns:

  • return value - -1 if not found and 0 if found
  • the found array copied to arrayToStoreValues, up to maxArrayLength values

About

ESP-32 esp-idf component: C functions to parse JSON strings


Languages

Language:C 95.7%Language:Makefile 4.3%