-
Notifications
You must be signed in to change notification settings - Fork 407
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
[Question] Decoding of Object Instances during WRITE Request #1369
Comments
(Note that I didn't check if Leshan client behaves like this but it SHOULD) About 1) LWM2M-v1.1.1@core§6.3.3. Write Operation says :
So, I think yes, "the client just ignore the value for /3/0/3 and report CREATED 2.04" About 2) LWM2M-v1.1.1@core§6.3.3. Write Operation says :
So, I think that " client just set the value for /3/0/1 (report CREATED 2.04) and ignores that one resource is missing".
Answers would probably not be the same for mandatory resources. |
Thank you very much for your answer. You're right I also have to keep Mandatory and Partial Update in mind. So if not all Mandatory Resources of Instance /3/0/ are updated during Partial Update, I assume that is still OK? But if I do not update all Mandatory Resource during Replace Update it will be rejected, right? Because Replace is basically a Create call carrying a payload. |
Yep, at least this is my understanding.
I would say Replace is a kind of Delete then Create. |
Alright, that clarifies a lot.
That leaves me with the following question:
|
I'm not sure I get you ?
You mean send a Write Replace Request directly on resource /3/0/3 ? |
Yes, sorry for being inaccurate. I was talking about this case. But the other case is interesting, too :) |
The whole 3/0 instance is replaced. |
Yes that makes sense. So if the Replace Write does not contain the Mandatory Resources of that Object Instance, it will be rejected then. So the Client requires some check whether these are present or not, I guess. |
Yep. |
Awesome! Really appreciate your prompt and concise replies. Will see if any question pops up later today or tomorrow. Otherwise, I'll close this thread. |
You're welcome. Could I ask what you are doing with LWM2M ? It seems to me that you currently try to implement a kind of LWM2M client, is that correct ? |
Of course, it's no secret. I'm/We're working on a LwM2M client fully in C++. The focus of the implementation lies in its easy integration with existing applications which is something, imo, many current implementations struggle with (LwM2M dictates the implementation of network and application layers). The idea is to fully detach application layer integration from the LwM2M client and treat LwM2M as what it is: a high-level network stack. The client will be publicly available on github. |
Thx for detailed explanation 🙏
What do you consider as application layer ? e.g. Object implementations seems not really pure network layer, or ? When you said :
Does it means it will be released under FOSS license ? |
I think the objects are a "design flaw" in LwM2M because they make your general application design less flexible. So I strip the objects of their influnce in the application, so they solely have the function to manage data exchange. The application API will look something like this:
You see the application layer itself basically subscribes to LwM2M object which are used as proxies for network data exchange. This is mainly done by a callback design (e.g. in contrast to the observer pattern leshan uses). This way, we avoid application dependencies within the LwM2M client implementation. To keep the API clean it requires lots of meta programming in the background, though. Hope this makes sense.
Yes that's the plan. |
I'm not sure I see the nuance. (Note that I didn't know Cpp so much so I maybe missed something) But I also see I try to understand because if there is some idea to better organize Leshan code, I would like to have it in mind. (not sure I will change the code but at least I know how we could do better) 🙂
👍 Great news ! |
You're right that works well, too. I intend to give the user of LwM2M stack less flexibility (not even a real adapter) which is probably not the goal of the Leshan implementation as it aims at maximal flexibility and integration. I'm far from a Java expert, though, the latest experience was the one I had with a Leshan microservice implementation. Sometimes I wish Leshan was implemented in C# with all its latest async features :) However, our C++ client is still wip, so I'm happy to keep the discussion running. More questions will pop up for sure! |
Often when you implement an open source library, you are stuck to old version to allow maximum reusability. (Currently leshan use java8 as minimal version 😬. Without thinking of this too much, if I should create Leshan now, I would give a try to Rust. 🤔 Let me know if we should close this issue ? |
One more thing regarding Bootstrap-Write I stumbled across: The spec says:
What exactly does the part "regardless of an existance of the targeting Object Instance mean? Does it mean, it will be created in case doesn't exist yet? |
Yep, I didn't double check this but If I remember well Bootstrap-Write is a kind of "Write Update or Create". |
I'm not sure I get the point but maybe you missed some points : 1.
2. The way to link a Server Instance and a Security instance is not by comparing the instance id but by comparing short server id from resource /0/?/10 and resource /1/?/0.
So this should not be an issue on object Server(1) but for completeness, you could face some kind of bootstrap config overwritting on object Security(0). There is some explanation about it Bootstrap server UI demo :
HTH |
Ok, thanks for the clarification, I missed that obious detail.
Thanks for pointing that out, I followed the discussion. In theory, should a client support multiple bootstrapping configurations to fetch LwM2M Server configs from different bootstrapping servers? |
Nope, a client can only have 1 bootstrap server at a time.
|
Another thing I overlooked! Thank you again. I think we can close this thread, otherwise it'll become very offtopic (regarding the original question). If ok, I'll open a new issue when running into further trouble. |
You're welcome 😉
let's do it. |
Question
Hello,
I've got a problem understanding the process of decoding and writing to specific resources during a Object Instance WRITE Request from server towards client.
I'm trying to explain the problem using an example:
Let's assume, during Registration the Object Instance /3/0 was reported to the server but the client internally only support 3/0/1 and 3/0/2 (let's leave aside mandatory resources).
What happens...
1.) ... in case the server sends a WRITE request for /3/0 to the client which contains the resources 3/0/1 3/0/2 and 3/0/3 in the payload; does the client just ignore the value for /3/0/3 and report CREATED 2.04?
2.) ... in case the server sends a WRITE request for /3/0 to the client but only the resource 3/0/1 is encoded in the payload, does the client just set the value for /3/0/1 (report CREATED 2.04) and ignores that one resource is missing?
Thank you,
Andy
The text was updated successfully, but these errors were encountered: