X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fexamples%2Fsimpleclient.cpp;h=5667b07c0ba63d6010b090ec7ec7f0a0e0ed3349;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=f9452af89b3f49dc72ca2fc342da401416d9f4f7;hpb=bf2e580e6786fbf35b87ad4074c8d477e97e1244;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/examples/simpleclient.cpp b/resource/examples/simpleclient.cpp index f9452af..5667b07 100644 --- a/resource/examples/simpleclient.cpp +++ b/resource/examples/simpleclient.cpp @@ -20,6 +20,7 @@ // OCClient.cpp : Defines the entry point for the console application. // +#include "iotivity_config.h" #ifdef HAVE_UNISTD_H #include #endif @@ -37,8 +38,6 @@ #include "OCPlatform.h" #include "OCApi.h" -#define maxSequenceNumber 0xFFFFFF - using namespace OC; static const char* SVR_DB_FILE_NAME = "./oic_svr_db_client.dat"; @@ -76,7 +75,7 @@ void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& re { try { - if(eCode == OC_STACK_OK && sequenceNumber != maxSequenceNumber + 1) + if(eCode == OC_STACK_OK && sequenceNumber <= MAX_SEQUENCE_NUMBER) { if(sequenceNumber == OC_OBSERVE_REGISTER) { @@ -108,7 +107,9 @@ void onObserve(const HeaderOptions /*headerOptions*/, const OCRepresentation& re { if(eCode == OC_STACK_OK) { - std::cout << "Observe registration failed or de-registration action failed/succeeded" << std::endl; + std::cout << "No observe option header is returned in the response." << std::endl; + std::cout << "For a registration request, it means the registration failed" + << std::endl; } else { @@ -475,7 +476,7 @@ static FILE* client_open(const char* /*path*/, const char *mode) int main(int argc, char* argv[]) { std::ostringstream requestURI; - OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink }; + OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink, NULL, NULL}; try { printUsage(); @@ -508,8 +509,9 @@ int main(int argc, char* argv[]) { PlatformConfig cfg { OC::ServiceType::InProc, OC::ModeType::Both, - "0.0.0.0", - 0, + OCConnectivityType::CT_ADAPTER_IP, + OCConnectivityType::CT_ADAPTER_IP, + (OCTransportAdapter)(OCTransportAdapter::OC_ADAPTER_IP|OCTransportAdapter::OC_ADAPTER_TCP), OC::QualityOfService::HighQos, &ps };