Simple interface for Mbed Cloud Client
Embed:
(wiki syntax)
Show/hide line numbers
m2mconnectionsecurity.cpp
00001 /* 00002 * Copyright (c) 2015 ARM Limited. All rights reserved. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * Licensed under the Apache License, Version 2.0 (the License); you may 00005 * not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #include <string.h> 00018 #include "mbed-client/m2mconnectionhandler.h" 00019 #include "mbed-client/m2mconnectionsecurity.h" 00020 #include "mbed-client-mbedtls/m2mconnectionsecuritypimpl.h" 00021 00022 M2MConnectionSecurity::M2MConnectionSecurity(SecurityMode mode) 00023 { 00024 _private_impl = new M2MConnectionSecurityPimpl(mode); 00025 } 00026 00027 M2MConnectionSecurity::~M2MConnectionSecurity(){ 00028 delete _private_impl; 00029 } 00030 00031 void M2MConnectionSecurity::reset(){ 00032 _private_impl->reset(); 00033 } 00034 00035 int M2MConnectionSecurity::init(const M2MSecurity *security, uint16_t security_instance_id){ 00036 return _private_impl->init(security, security_instance_id); 00037 } 00038 00039 int M2MConnectionSecurity::connect(M2MConnectionHandler* connHandler){ 00040 return _private_impl->connect(connHandler); 00041 } 00042 00043 int M2MConnectionSecurity::send_message(unsigned char *message, int len){ 00044 return _private_impl->send_message(message, len); 00045 } 00046 00047 int M2MConnectionSecurity::read(unsigned char* buffer, uint16_t len){ 00048 return _private_impl->read(buffer, len); 00049 } 00050 00051 void M2MConnectionSecurity::set_random_number_callback(random_number_cb callback) 00052 { 00053 _private_impl->set_random_number_callback(callback); 00054 } 00055 00056 void M2MConnectionSecurity::set_entropy_callback(entropy_cb callback) 00057 { 00058 _private_impl->set_entropy_callback(callback); 00059 } 00060 00061 void M2MConnectionSecurity::set_socket(void *socket, void *address) 00062 { 00063 _private_impl->set_socket((palSocket_t) socket, (palSocketAddress_t*) address); 00064 }
Generated on Tue Jul 12 2022 19:01:35 by 1.7.2