Adding JSMN to my homebrew - Need help :/

Discussion in '3DS - Homebrew Development and Emulators' started by WhoAmI?, Aug 21, 2015.

  1. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball
    Hai!

    So a while back @173210 added JSON support to rxTools and it was great! He used the library "JSMN", which is a JSON parser. Anyway, I need some help with adding it to a homebrew that I'm working on ._.

    Anyone care to help me out? An example code would be pretty nice. I'm still learning about this stuff, so...

    Here's the commit that was made when JSON support was initially added to rxTools (for reference): https://github.com/roxas75/rxTools/commit/7e33116e35d05d7816d9438dd64d90d97cf6da91

    I need it added to a Ninjhax homebrew... Pretty please? 0~0

    Edit: I need to be able to parse a json file like this:

     
    Last edited by WhoAmI?, Aug 21, 2015
  2. TheCruel

    TheCruel Developer

    Banned
    1,351
    2,884
    Dec 6, 2013
    United States
    Not sure, but seems to say everything you need. Says there's one too many arguments for ping "note: declared here
    void ping(char* url)"

    You can use (unless I make a typo):
    Code:
    char* str;
    sprintf(str, "http://%s/command/enable/", HOST);
    ping(str);
    Note that you shouldn't be using %d unless you're using integers are input. See: http://www.cplusplus.com/reference/cstdio/printf/
     
    WhoAmI? likes this.
  3. WhoAmI?
    OP

    WhoAmI? PASTA's dirty animal

    Member
    1,273
    1,009
    Mar 15, 2015
    Poké Ball
    Thank you. I also had some help from a dude named "Cooper", over at the Hak5 forums :) Everything seems to be coming together :D

    Now I just need to add JSMN 0~0