It should be added that this appears to only be possible with the C SDK, not 
the C++ SDK since the Discovery Callback function signature doesn’t provide 
endpoint information.

If the client has to choose which version of a discovered resource to store and 
act on (ie. Get/Post) later, there should be a sample app in the C++ SDK that 
shows how to do this. We have only found a sample in the C SDK that shows this 
and it’s not merged into 1.3-rel or master as of the last time we’ve checked 
(last week). This means, no one knows how to perform a Secure Request as a 
client unless you’re using the C SDK. This quite odd.

Thanks,

Joey Morrow

From: 
<[email protected]<mailto:[email protected]>>
 on behalf of "Matthews, Michael L" 
<[email protected]<mailto:[email protected]>>
Date: Tuesday, December 12, 2017 at 1:38 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [dev] How to determine if an OC::OCResource object endpoint is using 
COAP or COAPS?

Hello,

The code I am working with has a pointer to a C++ OC::OCResource object and I 
am trying to determine if the IoTivity endpoint is using COAP or COAPS. The 
eps->tps member of the OCResourcePayload data structure can be used to 
determine the transport type (i.e., COAP or COAPS). I don't know how to convert 
OC::OCResource to type OCResourcePayload so that the connection type can be 
determined with the eps->tps member. Is there a way to determine if an 
OC::OCResource object is using COAP or COAPS?



-Michael

_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to