mbed client on ethernet with LWIP
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client-mbedtls/source/m2mconnectionsecurity.cpp@11:cada08fc8a70, 2016-06-09 (annotated)
- Committer:
- mbedAustin
- Date:
- Thu Jun 09 17:08:36 2016 +0000
- Revision:
- 11:cada08fc8a70
Commit for public Consumption
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbedAustin | 11:cada08fc8a70 | 1 | /* |
mbedAustin | 11:cada08fc8a70 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
mbedAustin | 11:cada08fc8a70 | 3 | * SPDX-License-Identifier: Apache-2.0 |
mbedAustin | 11:cada08fc8a70 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
mbedAustin | 11:cada08fc8a70 | 5 | * not use this file except in compliance with the License. |
mbedAustin | 11:cada08fc8a70 | 6 | * You may obtain a copy of the License at |
mbedAustin | 11:cada08fc8a70 | 7 | * |
mbedAustin | 11:cada08fc8a70 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbedAustin | 11:cada08fc8a70 | 9 | * |
mbedAustin | 11:cada08fc8a70 | 10 | * Unless required by applicable law or agreed to in writing, software |
mbedAustin | 11:cada08fc8a70 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
mbedAustin | 11:cada08fc8a70 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbedAustin | 11:cada08fc8a70 | 13 | * See the License for the specific language governing permissions and |
mbedAustin | 11:cada08fc8a70 | 14 | * limitations under the License. |
mbedAustin | 11:cada08fc8a70 | 15 | */ |
mbedAustin | 11:cada08fc8a70 | 16 | |
mbedAustin | 11:cada08fc8a70 | 17 | #include <string.h> |
mbedAustin | 11:cada08fc8a70 | 18 | #include "mbed-client/m2mconnectionhandler.h" |
mbedAustin | 11:cada08fc8a70 | 19 | #include "mbed-client/m2mconnectionsecurity.h" |
mbedAustin | 11:cada08fc8a70 | 20 | #include "mbed-client/m2mtimer.h" |
mbedAustin | 11:cada08fc8a70 | 21 | #include "mbed-client/m2msecurity.h" |
mbedAustin | 11:cada08fc8a70 | 22 | #include "mbed-client-mbedtls/m2mconnectionsecuritypimpl.h" |
mbedAustin | 11:cada08fc8a70 | 23 | |
mbedAustin | 11:cada08fc8a70 | 24 | M2MConnectionSecurity::M2MConnectionSecurity(SecurityMode mode) |
mbedAustin | 11:cada08fc8a70 | 25 | { |
mbedAustin | 11:cada08fc8a70 | 26 | _private_impl = new M2MConnectionSecurityPimpl(mode); |
mbedAustin | 11:cada08fc8a70 | 27 | } |
mbedAustin | 11:cada08fc8a70 | 28 | |
mbedAustin | 11:cada08fc8a70 | 29 | M2MConnectionSecurity::~M2MConnectionSecurity(){ |
mbedAustin | 11:cada08fc8a70 | 30 | delete _private_impl; |
mbedAustin | 11:cada08fc8a70 | 31 | } |
mbedAustin | 11:cada08fc8a70 | 32 | |
mbedAustin | 11:cada08fc8a70 | 33 | void M2MConnectionSecurity::reset(){ |
mbedAustin | 11:cada08fc8a70 | 34 | _private_impl->reset(); |
mbedAustin | 11:cada08fc8a70 | 35 | } |
mbedAustin | 11:cada08fc8a70 | 36 | |
mbedAustin | 11:cada08fc8a70 | 37 | int M2MConnectionSecurity::init(const M2MSecurity *security){ |
mbedAustin | 11:cada08fc8a70 | 38 | return _private_impl->init(security); |
mbedAustin | 11:cada08fc8a70 | 39 | } |
mbedAustin | 11:cada08fc8a70 | 40 | |
mbedAustin | 11:cada08fc8a70 | 41 | int M2MConnectionSecurity::start_connecting_non_blocking(M2MConnectionHandler* connHandler) |
mbedAustin | 11:cada08fc8a70 | 42 | { |
mbedAustin | 11:cada08fc8a70 | 43 | return _private_impl->start_connecting_non_blocking(connHandler); |
mbedAustin | 11:cada08fc8a70 | 44 | } |
mbedAustin | 11:cada08fc8a70 | 45 | |
mbedAustin | 11:cada08fc8a70 | 46 | int M2MConnectionSecurity::continue_connecting() |
mbedAustin | 11:cada08fc8a70 | 47 | { |
mbedAustin | 11:cada08fc8a70 | 48 | return _private_impl->continue_connecting(); |
mbedAustin | 11:cada08fc8a70 | 49 | } |
mbedAustin | 11:cada08fc8a70 | 50 | |
mbedAustin | 11:cada08fc8a70 | 51 | int M2MConnectionSecurity::connect(M2MConnectionHandler* connHandler){ |
mbedAustin | 11:cada08fc8a70 | 52 | return _private_impl->connect(connHandler); |
mbedAustin | 11:cada08fc8a70 | 53 | } |
mbedAustin | 11:cada08fc8a70 | 54 | |
mbedAustin | 11:cada08fc8a70 | 55 | int M2MConnectionSecurity::send_message(unsigned char *message, int len){ |
mbedAustin | 11:cada08fc8a70 | 56 | return _private_impl->send_message(message, len); |
mbedAustin | 11:cada08fc8a70 | 57 | } |
mbedAustin | 11:cada08fc8a70 | 58 | |
mbedAustin | 11:cada08fc8a70 | 59 | int M2MConnectionSecurity::read(unsigned char* buffer, uint16_t len){ |
mbedAustin | 11:cada08fc8a70 | 60 | return _private_impl->read(buffer, len); |
mbedAustin | 11:cada08fc8a70 | 61 | } |