added setGpioCfg json api + unit tests