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: TYBLE16_simple_data_logger TYBLE16_MP3_Air
ControlPlane_netif.h
00001 /* 00002 * Copyright (c) 2018, 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 #ifndef CONTROLPLANE_NETIF_H_ 00018 #define CONTROLPLANE_NETIF_H_ 00019 00020 #include "nsapi_types.h" 00021 00022 /** @file ControlPlane_netif.h 00023 * @brief Implements support for data transfer using Control Plane CIoT EPS optimization. 00024 * 00025 */ 00026 00027 namespace mbed { 00028 00029 /* Length of the buffer storing data received over control plane */ 00030 #ifndef MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN 00031 #define MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN 1358 00032 #endif 00033 00034 00035 /** 00036 * @addtogroup cellular 00037 * @{ 00038 */ 00039 00040 /** Implements support for data transfer using 00041 * Control Plane CIoT EPS optimization specified in 3GPP 23.401(4.10), 3GPP 23.682(4.5.14). 00042 */ 00043 class ControlPlane_netif { 00044 public: 00045 ControlPlane_netif() {} 00046 virtual ~ControlPlane_netif() {} 00047 00048 protected: 00049 friend class CellularNonIPSocket; 00050 friend class CellularContext; 00051 00052 /** Send data over cellular control plane 00053 * 00054 * @param cpdata Buffer of data to be sent over control plane connection 00055 * @param cpdata_length Length of data in bytes 00056 * @return Number of sent bytes on success, negative error 00057 * code on failure. 00058 */ 00059 virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length) = 0; 00060 00061 /** Receive data over cellular control plane 00062 * 00063 * @param cpdata Destination buffer for data received from control plane connection 00064 * @param cpdata_length Length of data in bytes 00065 * @return Number of received bytes on success, negative error 00066 * code on failure. 00067 */ 00068 virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length) = 0; 00069 00070 /** Receives data from the control plane PDP context 00071 * 00072 * This function is called by cellular PDP context when data 00073 * is received from network. It will invoke the callback set 00074 * by the above attach. 00075 * 00076 */ 00077 virtual void data_received() = 0; 00078 00079 /** Register a callback on state change of the socket 00080 * 00081 * The specified callback will be called on state changes such as when 00082 * the socket can recv/send successfully and on when an error 00083 * occurs. The callback may also be called spuriously without reason. 00084 * 00085 * The callback may be called in an interrupt context and should not 00086 * perform expensive operations such as recv/send calls. 00087 * 00088 * @param callback Function to call on state change 00089 * @param data Argument to pass to callback 00090 */ 00091 virtual void attach(void (*callback)(void *), void *data) = 0; 00092 }; 00093 00094 /** 00095 * @} 00096 */ 00097 00098 } // mbed namespace 00099 #endif
Generated on Tue Jul 12 2022 13:54:13 by
1.7.2