-
Notifications
You must be signed in to change notification settings - Fork 408
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
O & N #601
Comments
It seems you are talking about To set attributes (lt,gt,pmin,pmax ....), you just need to send a |
i was doing this by change in leshan-server code( commit id - 790fe57) +ObserveSpec spec = new +ObserveSpec.Builder().greaterThan(16).lessThan(8).minPeriod(5).maxPeriod(10).step(3).build(); My changes are applicable for all objects and their resources....how i can set these parameter for specific object and their resources. |
I do not understand ... There are severals constructor which allow to target object, object instance or resource ... This is not enough ? Did you read the LWM2M specification about write attributes ? |
I am trying to write-attributes for temperature sensor value using below command: I am using htp requester but i am getting error: Invalid request:Invalid value type for resource /3303/0/5700, expected FLOAT, got STRING what could be the reason |
Finally, I understand you are not talking about So, currently there is no REST API or UI for Write Attributes. (see : #341 and LWM2M-Supported-features) |
can we add write attribute support in doPut function of ClientServlet.java file. |
You just want to add the REST API right ? (no UI ?) So adding this is You can look at the I propose to choose an URI like this : To deserialize write-attributes you can use If you succeed, you can provide a PR :D ! |
yes i want to just add REST API so that i can change my sensor resources attributes through http. I am using tool http requester a firefox extension for sending PUT command for write attributes. |
Thanx for the approach,how i will use AttributeSet.parse() to copy query string parameter(pmin,pmax,lt,gt and st) to ObserveSpec spec then i will call |
Which version are you using ? |
i am using leshan master branch and i was hardcoding the value like below but how i will copy this parameter from write-attribute restapi to AttributeSet.
I am stuck in List uriQueries = {}; ,how i will use it to copy write-attributes(pmin,pmax,lt,gt and step) |
I suspect you want I write all the code for you 😛 Look at (you can just pass a String to AttributeSet.parse) |
I would buy you a couple of beers if you did 😸 Also frantically looking for this Read/Write attributes feature using the REST API in Leshan Server Demo. It's one of the "small" missing pieces to get proper Resource Observations working as intended. |
@sbernard31 Thanks for guiding, i am able to write-attributes using rest API,now i am testing it fully once it will complete i will raise a PR. For customer demo purpose this is temporary solution for us,we want it through GUI,can you please guide me how i will proceed to write-attributes using leshan GUI. |
Honestly, I don't know how it could looks like. But if you want to look at the code all happened here : directive/controller for this templates : It would not be as straightforward than implementing the REST API and angular 1.2 is a bit obsolete. |
I do not understand. |
i mean to say that,the figure i have attached of temperature sensor in which,can i use temperature instance 0 Write button to write-attributes of temperature sensor. |
Write button is use to do a You want to change it to use a "write attribute request` instead ? In that case, you could have a look at leshan-server-demo/src/main/resources/webapp/js/instances-directives.js look at this : https://github.com/eclipse/leshan/blob/master/leshan-server-demo/src/main/resources/webapp/js/instance-directives.js#L93 |
i want a separate write attribute button just like write and i want to copy all the code of "write" for write attributes then i want to change that code,for that i think i have to change the code for passing my attributes data(pmin,pmax,lt,gt and st) through this GUI because these attributes will go as string value but for normal write operation we pass id and its value. can you help me out what changes required in normal "write" function to support write-attributes functionality through GUI. |
I already pointed you the file to look at. Just use it as example. |
how i will use this line for writing attribute i am trying with this $http({method: 'PUT', url: "api/clients/" + $routeParams.clientId + scope.resource.path+"/attributes", data: pmin=1, headers:{'Content-Type': 'application/json'},params:{format:format}}) i need some guidance to run this. |
https://code.angularjs.org/1.2.7/docs/api/ng.$http I proposed 2 ways : passing attributes as request payload/data or a url query parameters... |
i want to set lt,gt,pmin,pmax and step value for different sensor.
is present leshan server code support this,if not,where i can change different value of(lt,gt,pmin,pmax and step value) for different sensor.
I need help where i can do changes for this requirement in leshan-server code.
The text was updated successfully, but these errors were encountered: