Closed pai-da-xin closed 4 years ago
We just released a new version 1.4.0, are you using that? We fixed a lot of minor issues, if you could please try on that latest release and let us know if you're seeing the same thing that would help.
I tested it with the latest version, there is still this problem.
The return value of function jsmn_parse is equal to - 2, Indicates that the character in the JSON string is invalid, Why is that.
-2 returned from the jsmn parser API indicates JSMN_ERROR_INVAL which indicates that your JSON contains characters or bad JSON escaped string or unbalanced quotes.
Can't quite understand what's causing this in your offer/answer as the printed out JSON is in a valid format.
Is there any modification you've done to the codebase? Can you cleanup everything and rebuild? Is it possible you are intermixing widechar/multi-byte? JSON only handles ASCII.
Can you please capture the string right before the parser?
Could you give a little more info on your platform and OS?
How can we help you more in debugging this issue? The jsmn code is publicly available so you can debug into it.
My modification has nothing to do with offer / answer, the main modification is the kvswebrtcclientmaster.c file.
I printed sessiondescriptionjson using the " printf("sessionDescriptionJSON = %s \n", sessionDescriptionJSON); " command, the result is that "sessionDescriptionJSON = ¼"
I use cross compilation, my platform is "Linux wja 3.10.14isvp_turkey_1.0 #3 PREEMPT Thu Feb 21 14:40:58 CST 2019 mips GNU/Linux", system architecture is MIPS R3000.
So as you see you have a bad JSON. Try to debug and find the root cause as now you know you have a bad data.
Start off with absolutely no modifications to the master sample and only then try to apply your changes one-by-one.
It could also be, as I mentioned, that your compiler interprets characters as two-byte or multi-byte which will break.
Please update the issue once you have more data or you are able to reproduce this with the stock master sample.
After my debugging, I found that, In the function receiveLwsMessage, the value of pMessage is different from that of pSignalingMessageWrapper->receivedSignalingMessage.signalingMessage.payload.
The value of pMessage is the received offer. But the value of pSignalingMessageWrapper->receivedSignalingMessage.signalingMessage.payload, which I printed out, is "¼".
Cool, dig deeper now and try to understand how your code that listens to the received message stores and submits it to the offer handler. Are you using freed a freed pointer or using the pointer to the structure returned in the callback after the callback has exited? Are you familiar with native code and unmanaged memory?
I used the pSignalingMessageWrapper parameter here, printing "pSignalingMessageWrapper-> receivedSignalingMessage.signalingMessage.payload". This should be after the callback exits.
The native code is familiar with the section, But unmanaged memory doesn't understand.
SDP needs base64 encode.
@pai-da-xin this really is outside of the scope of the support we can provide. You need to ensure in your code you follow the sample or fully understand the codebase. Can you please get the sample working and only then start modifying to your application.
I am resolving this issue as it's not specific to KVS. Please cut a new issue with detailed description of the issue that pinpoints to KVS assets. If you need help or have a targeted question please note that directly in the issue so people can help with your code or technology and won't spend too much cycles looking and trying to deduce your scenario.
If you need more in-depth help or solution architecture then please do not hesitate to contact your AWS technical account management team.
Hi, experts, An error occurred when I sent an offer to the master using Amazon echo show, The master can successfully receive the offer of echo show. But there was an error in the jsmn_parse Function , this causes an error in the handleOffer function.
It is knowing from my printing tokenCount that the value of tokenCount is equal to - 2, and the value of tokenCount is equal to 7. I don't know why?
The log printed when an error occurs is as follows: