Re: Which newsgroup for json parsing?

Liste des GroupesRevenir à l c 
Sujet : Re: Which newsgroup for json parsing?
De : anton.txt (at) *nospam* g{oogle}mail.com (Anton Shepelev)
Groupes : comp.lang.c
Date : 08. May 2024, 15:21:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240508162146.61cfc58f4140a4a0074adab1@g{oogle}mail.com>
References : 1
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Josef Mollers:

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 have reformatted your example, because it was a mess.
JSON is so easy to parse, that writing your own parser may
prove an interesting exercise for a couple of days.  I used
the following site for reference:

  <https://www.json.org/json-en.html>

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()!

Have you checked the documentation?--

  <https://gnome.pages.gitlab.gnome.org/json-glib/func.gobject_from_data.html>

Additionally, the WIKI page has some examples:

  <https://wiki.gnome.org/Projects/JsonGlib>

I am also looking at libjson-c but cannot find any
examples that could guide me.

Have you checked the documentation?--

  <http://json-c.github.io/json-c/json-c-current-release/doc/html/index.html#using>

Observe that examples are optional in that they illustrate
documentation rather then provide it.  It is better to learn
from first principles than from examples.  See also:

  <http://json-c.github.io/json-c/json-c-current-release/doc/html/index.html#gettinghelp>

--
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments

Date Sujet#  Auteur
8 May 24 * Which newsgroup for json parsing?29Josef Möllers
8 May 24 +* Re: Which newsgroup for json parsing?2Anton Shepelev
23 May 24 i`- Re: Which newsgroup for json parsing?1Lawrence D'Oliveiro
8 May 24 +* Re: Which newsgroup for json parsing?2Malcolm McLean
8 May 24 i`- Re: Which newsgroup for json parsing?1Anton Shepelev
9 May 24 +- Re: Which newsgroup for json parsing?1jak
13 May 24 +- Re: Which newsgroup for json parsing?1Josef Möllers
16 May 24 `* Re: Which newsgroup for json parsing?22Mikko
16 May 24  +* Re: Which newsgroup for json parsing?19Josef Möllers
16 May 24  i+* Re: Which newsgroup for json parsing?6bart
17 May 24  ii`* Re: Which newsgroup for json parsing?5Malcolm McLean
17 May 24  ii +* Re: Which newsgroup for json parsing?2bart
25 May 24  ii i`- Re: XML (was Re: Which newsgroup for json parsing?)1Lawrence D'Oliveiro
17 May 24  ii `* Re: Which newsgroup for json parsing?2jak
17 May 24  ii  `- Re: Which newsgroup for json parsing?1Malcolm McLean
18 May 24  i`* Re: Which newsgroup for json parsing?12Mikko
27 May 24  i `* Re: Which newsgroup for json parsing?11Josef Möllers
27 May 24  i  `* Re: Which newsgroup for json parsing?10Vir Campestris
28 May 24  i   `* Re: Which newsgroup for json parsing?9Josef Möllers
28 May 24  i    +* Re: Which newsgroup for json parsing?7Michael S
28 May 24  i    i+- Re: Which newsgroup for json parsing?1Josef Möllers
29 May 24  i    i+* Re: Which newsgroup for json parsing?3Malcolm McLean
29 May 24  i    ii`* Re: Which newsgroup for json parsing?2David Brown
30 May 24  i    ii `- Re: Which newsgroup for json parsing?1Malcolm McLean
31 May 24  i    i+- Re: Which newsgroup for json parsing?1Tim Rentsch
5 Aug 24  i    i`- Re: Which newsgroup for json parsing?1Lawrence D'Oliveiro
30 May 24  i    `- Re: Which newsgroup for json parsing?1Vir Campestris
23 May 24  `* Re: Which newsgroup for json parsing?2Lawrence D'Oliveiro
23 May 24   `- Re: Which newsgroup for json parsing?1Malcolm McLean

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal