Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: blinky_max32630fthr
coap_security_handler_stub.c
00001 /* 00002 * Copyright (c) 2015-2016 ARM Limited. All Rights Reserved. 00003 */ 00004 00005 #include <string.h> 00006 #include <time.h> 00007 #include <stdlib.h> 00008 #include "ns_trace.h" 00009 #include "nsdynmemLIB.h" 00010 #include "coap_connection_handler.h" 00011 #include "coap_security_handler_stub.h" 00012 00013 thread_sec_def coap_security_handler_stub; 00014 00015 coap_security_t *coap_security_create(int8_t socket_id, int8_t timer_id, uint8_t *address_ptr, uint16_t port, SecureConnectionMode mode, 00016 int (*send_cb)(int8_t socket_id, uint8_t *address_ptr, uint16_t port, const unsigned char *, size_t), 00017 int (*receive_cb)(int8_t socket_id, unsigned char *, size_t), 00018 void (*start_timer_cb)(int8_t timer_id, uint32_t min, uint32_t fin), 00019 int (*timer_status_cb)(int8_t timer_id)) 00020 { 00021 coap_security_handler_stub.send_cb = send_cb; 00022 coap_security_handler_stub.receive_cb = receive_cb; 00023 coap_security_handler_stub.start_timer_cb = start_timer_cb; 00024 coap_security_handler_stub.timer_status_cb = timer_status_cb; 00025 return coap_security_handler_stub.sec_obj; 00026 } 00027 00028 void coap_security_destroy(coap_security_t *sec) 00029 { 00030 00031 } 00032 00033 int coap_security_handler_connect_non_blocking(coap_security_t *sec, bool is_server, SecureSocketMode sock_mode, coap_security_keys_t keys, uint32_t timeout_min, uint32_t timeout_max) 00034 { 00035 sec->_is_started = true; 00036 if( coap_security_handler_stub.counter >= 0){ 00037 return coap_security_handler_stub.values[coap_security_handler_stub.counter--]; 00038 } 00039 return coap_security_handler_stub.int_value; 00040 } 00041 00042 int coap_security_handler_continue_connecting(coap_security_t *sec) 00043 { 00044 if( coap_security_handler_stub.counter >= 0){ 00045 return coap_security_handler_stub.values[coap_security_handler_stub.counter--]; 00046 } 00047 00048 return coap_security_handler_stub.int_value; 00049 } 00050 00051 00052 int coap_security_handler_send_message(coap_security_t *sec, unsigned char *message, size_t len) 00053 { 00054 if( coap_security_handler_stub.counter >= 0){ 00055 return coap_security_handler_stub.values[coap_security_handler_stub.counter--]; 00056 } 00057 return coap_security_handler_stub.int_value; 00058 } 00059 00060 int coap_security_send_close_alert(coap_security_t *sec) 00061 { 00062 if( coap_security_handler_stub.counter >= 0){ 00063 return coap_security_handler_stub.values[coap_security_handler_stub.counter--]; 00064 } 00065 return coap_security_handler_stub.int_value; 00066 } 00067 00068 int coap_security_handler_read(coap_security_t *sec, unsigned char* buffer, size_t len) 00069 { 00070 if( coap_security_handler_stub.counter >= 0){ 00071 return coap_security_handler_stub.values[coap_security_handler_stub.counter--]; 00072 } 00073 return coap_security_handler_stub.int_value; 00074 }
Generated on Tue Jul 12 2022 14:21:01 by
1.7.2
