BA
/
BaBoRo1
Embed:
(wiki syntax)
Show/hide line numbers
CellularUtil_stub.cpp
00001 /* 00002 * Copyright (c) , Arm Limited and affiliates. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * 00005 * Licensed under the Apache License, Version 2.0 (the "License"); 00006 * you may not use this file except in compliance with the License. 00007 * You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 #include "CellularUtil.h" 00018 #include <string.h> 00019 #include <stdlib.h> 00020 #include <stdint.h> 00021 00022 namespace mbed_cellular_util { 00023 00024 #define MAX_STRING_LEN 200 00025 00026 void str_copy_skip_char(char *dest, uint16_t dest_size, const char *src, char c) 00027 { 00028 } 00029 00030 void str_remove_char(char *src, char c) 00031 { 00032 } 00033 00034 void uint_to_binary_str(uint32_t num, char* str, uint8_t str_size, uint8_t bit_cnt) 00035 { 00036 } 00037 00038 // converts the given str to hex string to buf 00039 uint16_t char_str_to_hex(const char* str, uint16_t len, char *buf, bool omit_leading_zero) 00040 { 00041 return 0; 00042 } 00043 00044 void convert_ipv6(char* ip) 00045 { 00046 00047 } 00048 00049 char* find_dot_number(char* str, int dot_number) 00050 { 00051 return NULL; 00052 } 00053 00054 void separate_ip4like_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size) 00055 { 00056 } 00057 00058 void separate_ip_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size) 00059 { 00060 } 00061 00062 void prefer_ipv6(char* ip, size_t ip_size, char* ip2, size_t ip2_size) 00063 { 00064 } 00065 00066 void int_to_hex_str(uint8_t num, char* buf) 00067 { 00068 buf[0] = '0'; 00069 buf[1] = '2'; 00070 } 00071 00072 int hex_str_to_int(const char *hex_string, int hex_string_length) 00073 { 00074 return 0; 00075 } 00076 00077 int hex_str_to_char_str(const char* str, uint16_t len, char *buf) 00078 { 00079 return 0; 00080 } 00081 00082 void uint_to_binary_str(uint32_t num, char* str, int str_size, int bit_cnt) 00083 { 00084 00085 } 00086 00087 int char_str_to_hex_str(const char* str, uint16_t len, char *buf, bool omit_leading_zero) 00088 { 00089 //The code is dependent on this, so this is easiest just to put here 00090 if (!str || !buf) { 00091 return 0; 00092 } 00093 00094 char *ptr = buf; 00095 int i=0; 00096 while (i < len) { 00097 if (omit_leading_zero == true && i == 0 && !(str[i]>>4 & 0x0F)) { 00098 *ptr++ = hex_values[(str[i]) & 0x0F]; 00099 } else { 00100 *ptr++ = hex_values[((str[i])>>4) & 0x0F]; 00101 *ptr++ = hex_values[(str[i]) & 0x0F]; 00102 } 00103 i++; 00104 } 00105 return ptr-buf; 00106 } 00107 00108 uint16_t get_dynamic_ip_port() 00109 { 00110 return 0; 00111 } 00112 00113 } // namespace mbed_cellular_util
Generated on Tue Jul 12 2022 12:21:45 by
