Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DTLSSocketWrapper.h Source File

DTLSSocketWrapper.h

Go to the documentation of this file.
00001 /** @file DTLSSocketWrapper.h DTLSSocketWrapper */
00002 /*
00003  * Copyright (c) 2018 ARM Limited
00004  * SPDX-License-Identifier: Apache-2.0
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 /** @addtogroup netsocket
00019 * @{
00020 */
00021 
00022 #ifndef DTLSSOCKETWRAPPER_H
00023 #define DTLSSOCKETWRAPPER_H
00024 
00025 #include "TLSSocketWrapper.h"
00026 
00027 // This class requires Mbed TLS SSL/TLS client code
00028 #if defined(MBEDTLS_SSL_CLI_C) || defined(DOXYGEN_ONLY)
00029 
00030 /**
00031  * \brief DTLSSocketWrapper implement DTLS stream over the existing Socket transport.
00032  */
00033 class DTLSSocketWrapper : public TLSSocketWrapper {
00034 public:
00035     /** Create a DTLSSocketWrapper.
00036      *
00037      * @param transport    Underlying transport socket to wrap.
00038      * @param hostname     Hostname of the remote host, used for certificate checking.
00039      * @param control      Transport control mode. See @ref control_transport.
00040      */
00041     DTLSSocketWrapper(Socket *transport, const char *hostname = NULL, control_transport control = TRANSPORT_CONNECT_AND_CLOSE);
00042 private:
00043     static void timing_set_delay(void *ctx, uint32_t int_ms, uint32_t fin_ms);
00044     static int timing_get_delay(void *ctx);
00045     void timer_event();
00046     uint64_t _int_ms_tick;
00047     int _timer_event_id;
00048     bool _timer_expired : 1;
00049 };
00050 
00051 #endif
00052 #endif
00053 /** @} */