Homebrew Adding JSMN to my homebrew - Need help :/

WhoAmI?

PASTA's dirty animal
OP
Member
Joined
Mar 15, 2015
Messages
1,276
Trophies
0
Location
Poké Ball
Website
lavanoid.github.io
XP
1,279
Country
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:

{
"name": "jsbr Ford Mustang",
"description": "Ford Mustang, 40MHz, No. 23819",
"frequency": 40.0,
"synchronization_burst_us": 1200,
"synchronization_spacing_us": 500,
"total_synchronizations": 4,
"signal_burst_us": 400,
"signal_spacing_us": 400,
"forward": 11,
"left": 59,
"forward_left": 27,
"right": 64,
"forward_right": 33,
"reverse": 39,
"reverse_left": 51,
"reverse_right": 45
}
 
Last edited by WhoAmI?,

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,131
Country
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/
 
  • Like
Reactions: WhoAmI?

WhoAmI?

PASTA's dirty animal
OP
Member
Joined
Mar 15, 2015
Messages
1,276
Trophies
0
Location
Poké Ball
Website
lavanoid.github.io
XP
1,279
Country
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/
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
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Well start walking towards them +1