Without a little code I am a little lost why your payload would be null. > Is it okay to have 2 get handler for 1 resource? 1 for get_light and 1 for > get_pstat?
As far as I know you can put as many get handlers as you would like. It is quite reasonable to have 1 for light and 1 for pstat. I am a little curious what you are trying to achieve. The oc_pstat.h header is considered an internal API and should not need to use IoTivity-lite. However, most developers will not even need to know about the pstat resource in their daily use of IoTivity-lite so you may have a reason you are tying to use the internal API that was not considered by us. If you can expand on your question I will see if I can help. George From: [email protected] <[email protected]> On Behalf Of [email protected] Sent: Friday, February 28, 2020 9:37 AM To: [email protected] Subject: Re: [dev] Iotivity Client George, Thanks! What I did was, I use simpleclient and simpleserver example. I edited the simpleclient --> in do_ip_discovery, I discover the oic.r.pstat. Then, in discover callback function I could get the coaps endpoint and port for /oic/sec/psat/ resource. Inside discover callback function, I put oc_do_observe(...) and call the handler. Here I create new function called observe_pstat that oc_do_observe will call. But, in my function observe_pstat, when I want to get the data payload, it was null. I don't know why? Should I put the get handler in simpleserver for get_pstat? Is it okay to have 2 get handler for 1 resource? 1 for get_light and 1 for get_pstat? In the other hand, I've read the oc_pstat.h, It has get function to get the pstat attribute (cm, tm, etc). But, I have no idea how to use it. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#10362): https://iotivity.groups.io/g/iotivity-dev/message/10362 Mute This Topic: https://groups.io/mt/69378274/21656 Group Owner: [email protected] Unsubscribe: https://iotivity.groups.io/g/iotivity-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
