Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Mikko Newsgroups: comp.lang.c Subject: Re: Which newsgroup for json parsing? Date: Thu, 16 May 2024 19:27:00 +0300 Organization: - Lines: 24 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 16 May 2024 18:27:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="185e4add552b97a7a134d1e78ba21d85"; logging-data="1754622"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PRnHCF/Ef+6sM1U4z4fzr" User-Agent: Unison/2.2 Cancel-Lock: sha1:g8V458Oyce6sGfJZFbVAhiCcfwM= Bytes: 1659 On 2024-05-08 13:04:56 +0000, Josef Möllers said: > Hi all, > > I am trying to parse a json string received through MQTT from a "Shelly > Plug S", e.g. > {"id":0, "source":"button", "output":true, "apower":0.0, > "voltage":237.9, "current":0.000, > "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1715172119},"temperature":{"tC":41.1, > "tF":106.0}} > > I am trying to use libjson-glib but I can't figure out what to use as > the first argument to json_gobject_from_data()! > I am also looking at libjson-c but cannot find any examples that could > guide me. > > Thanks in advance, Sometimes it is easier to make a parser than to use an existing one. In this case I might try LEX. -- Mikko