Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is SHADOW_JSON_STRING supported as value type in delta #49

Closed
macinfox opened this issue Nov 10, 2016 · 4 comments
Closed

Is SHADOW_JSON_STRING supported as value type in delta #49

macinfox opened this issue Nov 10, 2016 · 4 comments
Labels

Comments

@macinfox
Copy link

macinfox commented Nov 10, 2016

Hello,

I'm wondering if I'm overlooking something. I want to use a string as the value for my delta. For example {"desired": {"light": "on"},"reported": {"light": "off"}}.

However, I have traced where I believe the string should get stored in UpdateValueIfNoObject() and there is not a case for SHADOW_JSON_STRING.

I added the following and everything works as expected:

else if(pDataStruct->type == SHADOW_JSON_STRING) {
ret_val = parseStringValue((char *) pDataStruct->pData, pJsonString, &token);
}

Is this an oversight or am I doing something wrong?

Thanks!

@chaurah
Copy link
Contributor

chaurah commented Nov 10, 2016

Hi @macinfox,
You can see an example of how we were expecting the update function to be used here. You can directly use add_reported and add_desired APIs to update shadows. The APIs are present in this file.

I should emphasize that while there's nothing inherently wrong with the changes you have made, we have Not tested this and we are already aware of issues with Nested JSON parsing in the current version of the SDK. This might cause issues for you later on.

Please let me know if you have any further questions. Thank you for using AWS IoT.

Rahul

@macinfox
Copy link
Author

Hi Rahul,

Thanks for the response. I think we may be talking about different issues. I'm referring to parsing an incoming delta message where the value for the token is a string {"light":"on"}.

Thanks!

@chaurah
Copy link
Contributor

chaurah commented Nov 11, 2016

Hi @macinfox,
I see what you mean now. You are correct, this looks like an oversight. We will add this to our list of issues to be fixed before the next release. Thank you for pointing it out. Please let us know if you find any other issues.

Rahul

@chaurah chaurah added the bug label Nov 19, 2016
@nesatArcelik
Copy link

@macinfox thank you very much, you saved my day.

@chaurah why do you update the fix of a SHOW STOPER bug after 1 year?

Furthermore, Json Type Null is still is missing in your SDK.

Is there another repository which is more up-to-date? We may give up using AWS for our IoT structure if we face a similar bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants