X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Finclude%2FCAManager.h;h=1ac687fd6ec5e74540270284e5089189ec9eede5;hb=7f00f942c39b7bc27c7eeecf213a239c3fe4173c;hp=0a6974397585f0b57af608d68527e2d3469cbeca;hpb=cf56a410a2150ae474c676e7e6d01b89552a4873;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/include/CAManager.h b/resource/include/CAManager.h index 0a69743..1ac687f 100644 --- a/resource/include/CAManager.h +++ b/resource/include/CAManager.h @@ -32,9 +32,26 @@ namespace OC */ namespace CAManager { + /** + * Data structure to provide the configuration for cautil. + */ + struct CAUtilConfig + { + /** the flag for ble advertising. */ + OCTransportBTFlags_t bleFlag; + + public: + CAUtilConfig() + : bleFlag(OC_DEFAULT_BT_FLAGS) + {} + CAUtilConfig(OCTransportBTFlags_t bleFlag_) + : bleFlag(bleFlag_) + {} + }; + // typedef to get adapter status changes from CA. - typedef std::function ConnectionChangedCallback; + typedef std::function ConnectionChangedCallback; // typedef to get connection status changes from CA. typedef std::function AdapterChangedCallback; @@ -49,6 +66,118 @@ namespace OC */ OCStackResult setNetworkMonitorHandler(AdapterChangedCallback adapterHandler, ConnectionChangedCallback connectionHandler); + + /** + * Set port number to use. + * @param adapter transport adapter type to assign the specified port number. + * @param flag transport flag information. + * @param port the specified port number to use. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult setPortNumberToAssign(OCTransportAdapter adapter, + OCTransportFlags flag, uint16_t port); + + /** + * Get the assigned port number. + * @param adapter transport adapter type to get the opened port number. + * @param flag transport flag information. + * @return Returns currently assigned port number. + */ + uint16_t getAssignedPortNumber(OCTransportAdapter adapter, OCTransportFlags flag); + + /** + * Set multicast time to live to control the scope of the multicasts. + * @param 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 Returns ::OC_STACK_OK if success. + */ + OCStackResult setMulticastTTL(size_t ttl); + + /** + * Get multicast time to live. + * @param ttl TTL pointer to get the stored multicast time to live. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult getMulticastTTL(size_t *ttl); + + /** + * set BT configure. + * @param[in] config ::CAUtilConfig data + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult setBTConfigure(const CAUtilConfig& config); + + /** + * set CAUtil log preference. + * @param[in] level ::OCLogLevel value. + * @param[in] hidePrivateLogEntries Private Log Entries. + * Example: + * true : hide private log. + * false : show private log. + * (privacy : uid, did, access token, etc) + */ + void setLogLevel(OCLogLevel level, bool hidePrivateLogEntries); + + //Custom advertise +#if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE) + OCStackResult setAdvertisementData(const char* data, int length); + OCStackResult setScanResponseData(const char* data, int length); +#endif + + /** + * start BLE advertising. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult startLEAdvertising(); + + /** + * stop BLE advertising. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult stopLEAdvertising(); + + /** + * 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. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult disconnectTCPSession(const char *address, + uint16_t port, + OCTransportFlags flags); + + OCStackResult startCAGattServer(); + OCStackResult stopCAGattServer(); +#if defined(__WITH_DTLS__) || defined(__WITH_TLS__) + /** + * Select the cipher suite for TLS/DTLS handshake. + * @param cipher cipher suite (Note : Make sure endianness). + * TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D + * TLS_RSA_WITH_AES_128_GCM_SHA256 0x009C + * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B + * TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE + * TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC + * TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C + * TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 + * TLS_ECDH_anon_WITH_AES_128_CBC_SHA 0xC018 + * @param adapter transport adapter type. + * @return Returns ::OC_STACK_OK if success. + */ + OCStackResult setCipherSuite(const uint16_t cipher, OCTransportAdapter adapter); +#endif // defined(__WITH_DTLS__) || defined(__WITH_TLS__) } }