Added client sample for proxy
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / linux / SimpleClientServer / occlient.h
index 801c456..10d0c85 100644 (file)
@@ -28,7 +28,7 @@
 // Defines
 //-----------------------------------------------------------------------------
 #define TAG "occlient"
-#define CTX_VAL 0x99
+#define DEFAULT_CONTEXT_VALUE 0x99
 #ifndef MAX_LENGTH_IPv4_ADDR
 #define MAX_LENGTH_IPv4_ADDR 16
 #endif
 //-----------------------------------------------------------------------------
 
 /**
- * List of methods that can be inititated from the client
+ * List of methods that can be initiated from the client
  */
 typedef enum {
     TEST_DISCOVER_REQ = 1,
     TEST_GET_REQ_NON,
+    TEST_GET_REQ_NON_WITH_FILTERS,
     TEST_PUT_REQ_NON,
     TEST_POST_REQ_NON,
     TEST_DELETE_REQ_NON,
@@ -54,12 +55,27 @@ typedef enum {
     TEST_OBS_REQ_CON,
 #ifdef WITH_PRESENCE
     TEST_OBS_PRESENCE,
+    TEST_OBS_PRESENCE_WITH_FILTER,
+    TEST_OBS_PRESENCE_WITH_FILTERS,
+    TEST_OBS_MULTICAST_PRESENCE,
 #endif
     TEST_OBS_REQ_NON_CANCEL_IMM,
     TEST_GET_REQ_NON_WITH_VENDOR_HEADER_OPTIONS,
+    TEST_DISCOVER_PLATFORM_REQ,
+    TEST_DISCOVER_DEV_REQ,
     MAX_TESTS
 } CLIENT_TEST;
 
+/**
+ * List of connectivity types that can be initiated from the client
+ * Required for user input validation
+ */
+typedef enum {
+    CT_ADAPTER_DEFAULT = 0,
+    CT_IP,
+    MAX_CT
+} CLIENT_CONNECTIVITY_TYPE;
+
 #ifdef WITH_PRESENCE
 int InitPresence();
 #endif
@@ -67,6 +83,7 @@ int InitPresence();
 //----------------------------------------------------------------------------
 // Function prototype
 //----------------------------------------------------------------------------
+std::string getConnectivityType (OCConnectivityType connType);
 
 /* call getResult in common.cpp to get the result in string format. */
 const char *getResult(OCStackResult result);
@@ -77,25 +94,19 @@ std::string getIPAddrTBServer(OCClientResponse * clientResponse);
 /* Get the port number the server is listening on */
 std::string getPortTBServer(OCClientResponse * clientResponse);
 
-/* Returns the query string for GET and PUT operations */
-std::string getQueryStrForGetPut(OCClientResponse * clientResponse);
-
 /* Following are initialization functions for GET, Observe, PUT
  * POST, Delete & Discovery operations
  */
-int InitGetRequestToUnavailableResource();
+int InitGetRequestToUnavailableResource(OCQualityOfService qos);
 int InitObserveRequest(OCQualityOfService qos);
-int InitPutRequest();
-int InitGetRequest(OCQualityOfService qos, uint8_t withVendorSpecificHeaderOptions);
+int InitPutRequest(OCQualityOfService qos);
+int InitGetRequest(OCQualityOfService qos, uint8_t withVendorSpecificHeaderOptions, bool getWithQuery);
 int InitPostRequest(OCQualityOfService qos);
 int InitDeleteRequest(OCQualityOfService qos);
 int InitGetRequest(OCQualityOfService qos);
-int InitDiscovery();
-
-/* Function to retrieve ip address, port no. of the server
- *  and query for the operations to be performed.
- */
-void parseClientResponse(OCClientResponse * clientResponse);
+int InitDeviceDiscovery(OCQualityOfService qos);
+int InitPlatformDiscovery(OCQualityOfService qos);
+int InitDiscovery(OCQualityOfService qos);
 
 /* Call delete operation on already deleted resource */
 void* RequestDeleteDeathResourceTask(void* myqos);
@@ -133,3 +144,4 @@ OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
 
 
 #endif
+