Hello, all.

I heard that Arduino(mega + Wi-Fi Shield) can't get data through multicast.
So I tried to communicate Arduino and Linux(C++ SDK) using unicast.
Below code is that.

Base code is <iotivity>/resource/examples/simpleclient.cpp and 
<iotivity>/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp
Version of Wi-Fi shield is 1.1.
I upgraded it.

1. using findResource function with IP + Port
   requestURI << OC_RSRVD_WELL_KNOWN_URI << "?rt=core.light";
        OCPlatform::findResource("112.108.39.218:55555", requestURI.str(),
                CT_DEFAULT, &foundResource);
        std::cout<< "Finding Resource... " <<std::endl;

2. using constructResourceObject function with IP
        std::vector<std::string> resourceTypes;
        resourceTypes.push_back("core.light");
        std::vector<std::string> interfaces;
        interfaces.push_back(DEFAULT_INTERFACE);
        OCResource::Ptr resource = 
OCPlatform::constructResourceObject("coap://112.108.39.218:4097", "/a/light", 
CT_DEFAULT, true, resourceTypes, interfaces);

Both code are not working.
First code can find resource, but GET command is not working.
Second is also not working on same part(GET)

I want to know the reason why it is not working.
And How to solve it.
Or the other way to communicate between Arduino(mega + wi-fi) and Others(Linux, 
Android)

Samsung S/W Membership Software Developer
Sungkyunkwan Univ. Computer Engineering 08
B.E.S.T. House Team & Side Of House 
Jake Kim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20151025/1efe5ba2/attachment.html>

Reply via email to