Mistake on this page?
Report an issue in GitHub or email us
AT_ControlPlane_netif.h
1 /*
2  * Copyright (c) 2019, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include "CellularList.h"
20 #include "ATHandler.h"
21 #include "AT_CellularDevice.h"
22 
23 namespace mbed {
24 
26 public:
27  AT_ControlPlane_netif(ATHandler &at, int cid, AT_CellularDevice &device);
28  virtual ~AT_ControlPlane_netif();
29 
30 protected:
31 // ControlPlane_netif
32 
33  /* Sends data using +CSODCP specified in
34  * 3GPP 27007 10.1.43: Sending of originating data via the control plane
35  */
36  virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length);
37 
38  /* Receives data using +CRTDCP specified in
39  * 3GPP 27007 10.1.44: Reporting of terminating data via the control plane
40  */
41  virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length);
42 
43  virtual void data_received();
44  virtual void attach(void (*callback)(void *), void *data);
45 
46  // Id of the PDP context that enables the control plane data connection
47  int _cid;
48 
49 private:
50  struct packet_t {
51  uint8_t *data;
52  nsapi_size_t data_len;
53  packet_t *next;
54  };
55  CellularList<packet_t> _packet_list;
56  void (*_cb)(void *);
57  void *_data;
58  // Called on receiving URC: +CRTDCP
59  void urc_cp_recv();
60 
61 protected:
62  ATHandler &_at;
63  AT_CellularDevice &_device;
64 };
65 
66 } //mbed namespace
Implements support for data transfer using Control Plane CIoT EPS optimization specified in 3GPP 23...
virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length)
Receive data over cellular control plane.
Implements support for data transfer using Control Plane CIoT EPS optimization.
virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length)
Send data over cellular control plane.
Callback< R(ArgTs...)> callback(R(*func)(ArgTs...)=nullptr) noexcept
Create a callback class with type inferred from the arguments.
Definition: Callback.h:678
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
Definition: nsapi_types.h:151
virtual void data_received()
Receives data from the control plane PDP context.
Class AT_CellularDevice.
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
Definition: nsapi_types.h:144
Definition: ATHandler.h:46
Class for sending AT commands and parsing AT responses.
Definition: ATHandler.h:70
virtual void attach(void(*callback)(void *), void *data)
Register a callback on state change of the socket.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.