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.
Fork of OmniWheels by
AT_CellularSMS_stub.cpp
00001 /* 00002 * Copyright (c) 2017, 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 00018 #include <time.h> 00019 #include "AT_CellularSMS.h" 00020 #include "CellularLog.h" 00021 00022 using namespace mbed; 00023 00024 #define CTRL_Z "\x1a" 00025 #define ESC "\x1b" 00026 00027 const int SMS_STATUS_SIZE = 12 + 1; 00028 const int FIRST_OCTET_DELIVER_SUBMIT = 17; 00029 const int TP_VALIDITY_PERIOD_24_HOURS = 167; 00030 const int TP_PROTOCOL_IDENTIFIER = 0; 00031 const int SMS_DATA_CODING_SCHEME = 0; 00032 00033 const uint16_t SMS_MAX_8BIT_CONCATENATED_SINGLE_SMS_SIZE = 134; 00034 const uint16_t SMS_MAX_GSM7_CONCATENATED_SINGLE_SMS_SIZE = 153; 00035 00036 00037 AT_CellularSMS::AT_CellularSMS(ATHandler &at) : AT_CellularBase(at), _cb(0), _mode(CellularSMSMmodeText), 00038 _use_8bit_encoding(false), _sim_wait_time(0), _sms_message_ref_number(1), _sms_info(NULL) 00039 { 00040 } 00041 00042 AT_CellularSMS::~AT_CellularSMS() 00043 { 00044 } 00045 00046 void AT_CellularSMS::cmt_urc() 00047 { 00048 } 00049 00050 void AT_CellularSMS::cmti_urc() 00051 { 00052 } 00053 00054 nsapi_error_t AT_CellularSMS::set_cnmi() 00055 { 00056 return NSAPI_ERROR_OK ; 00057 } 00058 00059 nsapi_error_t AT_CellularSMS::set_cmgf(int msg_format) 00060 { 00061 return NSAPI_ERROR_OK ; 00062 } 00063 00064 nsapi_error_t AT_CellularSMS::set_csmp(int fo, int vp, int pid, int dcs) 00065 { 00066 return NSAPI_ERROR_OK ; 00067 } 00068 00069 nsapi_error_t AT_CellularSMS::set_csdh(int show_header) 00070 { 00071 return NSAPI_ERROR_OK ; 00072 } 00073 00074 nsapi_error_t AT_CellularSMS::initialize(CellularSMSMmode mode) 00075 { 00076 return NSAPI_ERROR_OK ; 00077 } 00078 00079 void AT_CellularSMS::set_extra_sim_wait_time(int sim_wait_time) 00080 { 00081 } 00082 00083 char* AT_CellularSMS::create_pdu(const char* phone_number, const char* message, uint8_t message_length, uint8_t msg_parts, 00084 uint8_t msg_part_number, uint8_t& header_size) 00085 { 00086 return NULL; 00087 } 00088 00089 nsapi_size_or_error_t AT_CellularSMS::send_sms(const char* phone_number, const char* message, int msg_len) 00090 { 00091 return NSAPI_ERROR_OK ; 00092 } 00093 00094 void AT_CellularSMS::set_sms_callback(Callback<void()> func) 00095 { 00096 } 00097 00098 nsapi_error_t AT_CellularSMS::set_cpms(const char *memr, const char *memw, const char *mems) 00099 { 00100 return NSAPI_ERROR_OK ; 00101 } 00102 00103 nsapi_error_t AT_CellularSMS::set_csca(const char *sca, int type) 00104 { 00105 return NSAPI_ERROR_OK ; 00106 } 00107 00108 nsapi_size_or_error_t AT_CellularSMS::set_cscs(const char *chr_set) 00109 { 00110 return NSAPI_ERROR_OK ; 00111 } 00112 00113 //nsapi_error_t AT_CellularSMS::set_csms(int msg_service) 00114 //{ 00115 // return NSAPI_ERROR_OK; 00116 //} 00117 00118 nsapi_error_t AT_CellularSMS::delete_sms(sms_info_t* sms) 00119 { 00120 return NSAPI_ERROR_OK ; 00121 } 00122 00123 nsapi_error_t AT_CellularSMS::delete_all_messages() 00124 { 00125 return NSAPI_ERROR_OK ; 00126 } 00127 00128 nsapi_size_or_error_t AT_CellularSMS::read_sms_from_index(int msg_index, char* buf, uint16_t len, char* phone_num, char* time_stamp) 00129 { 00130 return NSAPI_ERROR_OK ; 00131 } 00132 00133 // read msg in PDU mode 00134 nsapi_size_or_error_t AT_CellularSMS::read_sms(sms_info_t* sms, char* buf, char* phone_num, char* time_stamp) 00135 { 00136 return NSAPI_ERROR_OK ; 00137 } 00138 00139 nsapi_size_or_error_t AT_CellularSMS::get_sms(char* buf, uint16_t len, char* phone_num, uint16_t phone_len, 00140 char* time_stamp, uint16_t time_len, int *buf_size) 00141 { 00142 return NSAPI_ERROR_OK ; 00143 } 00144 00145 nsapi_size_or_error_t AT_CellularSMS::get_data_from_pdu(const char* pdu, sms_info_t *info, int *part_number, char *phone_number, char *msg) 00146 { 00147 return NSAPI_ERROR_OK ; 00148 } 00149 00150 // read params from User DEfined Header 00151 int AT_CellularSMS::read_udh_from_pdu(const char* pdu, sms_info_t *info, int &part_number, int &padding_bits) 00152 { 00153 return 0; 00154 } 00155 00156 nsapi_size_or_error_t AT_CellularSMS::read_pdu_payload(const char* pdu, int msg_len, int scheme, char *msg, int padding_bits) 00157 { 00158 return NSAPI_ERROR_OK ; 00159 } 00160 00161 void AT_CellularSMS::free_linked_list() 00162 { 00163 } 00164 00165 void AT_CellularSMS::add_info(sms_info_t* info, int index, int part_number) 00166 { 00167 } 00168 00169 // reads all the messages to the linked list AT_CellularSMS::_sms_info 00170 nsapi_error_t AT_CellularSMS::list_messages() 00171 { 00172 return NSAPI_ERROR_OK ; 00173 } 00174 00175 AT_CellularSMS::sms_info_t* AT_CellularSMS::get_oldest_sms_index() 00176 { 00177 return NULL; 00178 } 00179 00180 // if time_string_1 is greater (more fresh date) then return 1, same 0, smaller -1. Error -2 00181 int AT_CellularSMS::compare_time_strings(const char* time_string_1, const char* time_string_2) 00182 { 00183 return 0; 00184 } 00185 00186 bool AT_CellularSMS::create_time(const char* time_string, time_t* time) 00187 { 00188 return 0; 00189 } 00190
Generated on Fri Jul 22 2022 04:53:45 by
