// OCClient.cpp : Defines the entry point for the console application.
//
+#include "iotivity_config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "OCPlatform.h"
#include "OCApi.h"
-#define maxSequenceNumber 0xFFFFFF
-
using namespace OC;
static const char* SVR_DB_FILE_NAME = "./oic_svr_db_client.dat";
{
try
{
- if(eCode == OC_STACK_OK && sequenceNumber != maxSequenceNumber + 1)
+ if(eCode == OC_STACK_OK && sequenceNumber <= MAX_SEQUENCE_NUMBER)
{
if(sequenceNumber == OC_OBSERVE_REGISTER)
{
{
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
{
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();
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
};