I have used many tools such as cJSON, nxjson and jsmn parsers to parse the JSON response but none of the tools which i had used is giving the output in some structure format. Below is my JSON response in string:
{"Code":1,"MSN":0,"HWID":7001,"Data":{"SignOffRequest":{"messageId":0,"barCodeReadErrorCnt":0,"markSenseReadErrorCnt":0,"markSenseValidationErrorCnt":0,"postPrintErrorCnt":0,"custTicketFeedErrorCnt":0,"custInputTicketJamsCnt":0,"keyStrokeCnt":0,"keyStrokeErrorCnt":0,"commCrcErrorCnt":0,"readTxnCnt":0,"keyedTxnCnt":0,"ticketMotionErrorCnt":0,"blankFeedErrorCnt":0,"blankTicketJamCnt":0,"startupNormalRespCnt":0,"startupErrorRespCnt":0,"primCommMesgSentCnt":0,"commRetransmitTxnCnt":0,"rawMessage":null,"TableUpdateNo":1,"FixtureUpdateNo":0}}}
I have used cJSON tool and the output is as below which is in also a string:
{
"Code": 1,
"MSN": 0,
"HWID": 7001,
"Data": {
"SignOffRequest": {
"messageId": 0,
"barCodeReadErrorCnt": 0,
"markSenseReadErrorCnt": 0,
"markSenseValidationErrorCnt": 0,
"postPrintErrorCnt": 0,
"custTicketFeedErrorCnt": 0,
"custInputTicketJamsCnt": 0,
"keyStrokeCnt": 0,
"keyStrokeErrorCnt": 0,
"commCrcErrorCnt": 0,
"readTxnCnt": 0,
"keyedTxnCnt": 0,
"ticketMotionErrorCnt": 0,
"blankFeedErrorCnt": 0,
"blankTicketJamCnt": 0,
"startupNormalRespCnt": 0,
"startupErrorRespCnt": 0,
"primCommMesgSentCnt": 0,
"commRetransmitTxnCnt": 0,
"rawMessage": null,
"TableUpdateNo": 1,
"FixtureUpdateNo": 0
}
}
}
but I don't want the output in the above format. I want the output in the form of a C structure. Is it possible to get the output in C structure?