Comments (8)
Okay, so the SetResourceValueAsync call ends up here: https://github.com/ARMmbed/mbed-cloud-sdk-dotnet/blame/7c3822bed9eb332306a31a86e9b8d11df2163d95/MbedCloudSDK/Backends/Mds/Api/ResourcesApi.cs#L1043
This line is pointless and faulty for the C# .NET version of the mbed cloud SDK. The function has an input type of 'string' for resourceValue, which means it will never be typed as a byte array. Which also means every resource value will be passed through a serializer, and if you pass a string through the serializer, the serializer will enclose it with double quotes. I think the meaning was to 'stringify' any non-string object, but then it needs to be possible to pass in any Object, and not just a String.
Please fix @alexl0gan
from mbed-cloud-sdk-dotnet.
@stevew817
The serialisation of the string is an issue with the Swagger Codegen templates and a fix is being looked at. All files in the /Backends folder are autogenerated using generic templates which is why the line you linked appears pointless for this scenario, but will be used in other parts of the SDK.
We are aware that only being able to set a resource value to a string is a limitation and have plans to address it as part of a larger effort to support more LWM2M features.
from mbed-cloud-sdk-dotnet.
Hi @alexl0gan
Thanks for the explanation. My issue is not so much in that you can only set a string through the SDK (stringifying numbers is easy enough), the issue is that the SDK will add double quotes to the passed string, which will show up on the device side. Ergo, what I push in on one side, doesn't come out the same on the other end. Hope for that fix to come soon.
from mbed-cloud-sdk-dotnet.
I thought I addressed the double quotes issue in my first comment. I am aware of this and have updated the templates so the fix will come with the next release.
from mbed-cloud-sdk-dotnet.
Thanks! 👍
from mbed-cloud-sdk-dotnet.
@alexl0gan I can't see a fix in the release you just made... Was this the release the fix was supposed to be in?
from mbed-cloud-sdk-dotnet.
Is this issue still happening in the new version?
This is a bit of a hack but it stops the double quotes.
The way the swagger codegen template is written is not ideal and I would have rather spent time to fix it properly but the team has other priorities at the moment and our next block of work will involve re-writing the templates any way so will keep it in mind for then.
from mbed-cloud-sdk-dotnet.
No reply so closing
from mbed-cloud-sdk-dotnet.
Related Issues (2)
- Doesn't run on OS X HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbed-cloud-sdk-dotnet.