replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / connectivity / api / cautilinterface.h
index 47d840a..15727ff 100644 (file)
@@ -31,6 +31,37 @@ extern "C"
 #endif
 
 /**
+ * this level depends on transmission time.
+ * unicast based UDP will be checked by caretransmission.
+ */
+typedef enum
+{
+    HIGH_SPEED = 0,
+    NORMAL_SPEED
+} CMSpeedLevel_t;
+
+typedef struct
+{
+    /** address for all **/
+    char addr[MAX_ADDR_STR_SIZE_CA];
+
+    /** adapter priority of all transmissions. **/
+    CATransportAdapter_t adapter;
+
+    /** level about speed of response. **/
+    CMSpeedLevel_t level;
+} CMConfigureInfo_t;
+
+/*
+ * CAUtilConfig_t structure.
+ */
+typedef struct
+{
+    CATransportBTFlags_t bleFlags;
+    CMConfigureInfo_t cmInfo;
+} CAUtilConfig_t;
+
+/**
  * Callback function type for connection status changes delivery.
  * @param[out]   info           Remote endpoint information.
  * @param[out]   isConnected    Current connection status info.
@@ -101,6 +132,42 @@ CAResult_t CASetPortNumberToAssign(CATransportAdapter_t adapter,
  */
 uint16_t CAGetAssignedPortNumber(CATransportAdapter_t adapter, CATransportFlags_t flag);
 
+//custom advertisement data setting
+#if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE)
+CAResult_t CASetAdvertisementData(const char* data, int length);
+CAResult_t CASetScanResponseData(const char* data, int length);
+#endif
+
+#ifdef __APPLE__
+/**
+ * initialize client connection manager
+ */
+CAResult_t CAUtilClientInitialize();
+
+/**
+ * terminate client connection manager
+ */
+CAResult_t CAUtilClientTerminate();
+
+/**
+ * stop LE scan.
+ * @return  ::CA_STATUS_OK or ::CA_NOT_SUPPORTED
+ */
+CAResult_t CAUtilStopLEScan();
+
+/**
+ * start LE scan.
+ * @return  ::CA_STATUS_OK or ::CA_NOT_SUPPORTED
+ */
+CAResult_t CAUtilStartLEScan();
+
+/**
+ * Client disconnect.
+ * @return  ::CA_STATUS_OK or ::CA_NOT_SUPPORTED
+ */
+CAResult_t CAUtilClientDisconnect();
+#endif
+
 #ifdef __ANDROID__
 /**
  * initialize util client for android
@@ -152,12 +219,89 @@ void CAUtilSetFoundDeviceListener(jobject listener);
  * @param[in]  intervalTime         interval time(Seconds).
  * @param[in]  workingCount         working cycle for selected interval time.
  *
- * @return  ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
+ * @return  ::CA_STATUS_OK or ::CA_NOT_SUPPORTED
  */
 CAResult_t CAUtilSetLEScanInterval(jint intervalTime, jint workingCount);
 
+/**
+ * stop LE scan.
+ *
+ * @return  ::CA_STATUS_OK or ::CA_NOT_SUPPORTED
+ */
+CAResult_t CAUtilStopLEScan();
 #endif
 
+// BLE util
+/**
+ * start BLE advertising.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUtilStartLEAdvertising();
+
+/**
+ * stop BLE advertising.
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUtilStopLEAdvertising();
+
+/**
+ * set CAUtil BT configure.
+ * @param[in]  config       ::CAUtilConfig_t value
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUtilSetBTConfigure(CAUtilConfig_t config);
+
+/**
+ * set CAUtil log preference.
+ * @param[in]  level                     ::CAUtilLogLevel_t value
+ * @param[in]  hidePrivateLogEntries     Private Log Entries.
+ *                                       Example:
+ *                                       true : hide private log.
+ *                                       false : show private log.
+ *                                       (privacy : uid, did, access token, etc)
+ */
+void CAUtilSetLogLevel(CAUtilLogLevel_t level, bool hidePrivateLogEntries);
+
+/**
+ * Set multicast time to live value to control the scope of the multicasts.
+ * @param[in]  ttl         To be set to any value from 0 to 255.
+ *                         Example:
+ *                         0: Are restricted to the same host.
+ *                         1: Are restricted to the same subnet.
+ *                         32: Are restricted to the same site.
+ *                         64: Are restricted to the same region.
+ *                         128: Are restricted to the same continent.
+ *                         255: Are unrestricted in scope.
+ *                         We cannot support region, continent and unrestricted in scope.
+ *
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUtilSetMulticastTTL(size_t ttl);
+
+/**
+ * Get multicast time to live value.
+ * @param[out]  ttl        TTL pointer to get the stored multicast time to live.
+ *
+ * @return  ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CAUtilGetMulticastTTL(size_t *ttl);
+
+/**
+ * Disconnect TCP session.
+ * When there is no transmission for a long time.
+ * Some carrier Vendor is blocking data.
+ * Thur, TCP Session is cleaned through this function.
+ * @param[in]   address        Address.
+ * @param[in]   port           Port.
+ * @param[in]   flags          Transport flag.
+ */
+CAResult_t CAUtilTCPDisconnectSession(const char *address,
+                                      uint16_t port,
+                                      CATransportFlags_t flags);
+
+CAResult_t CAUtilStartGattServer();
+CAResult_t CAUtilStopGattServer();
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif