Mbed OS Reference
Loading...
Searching...
No Matches
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
24namespace mbed {
25
26/**
27 * @addtogroup at-hayes AT/Hayes Command Set
28 * @ingroup Cellular
29 * @{
30 */
31
33public:
35 virtual ~AT_ControlPlane_netif();
36
37protected:
38// ControlPlane_netif
39
40 /* Sends data using +CSODCP specified in
41 * 3GPP 27007 10.1.43: Sending of originating data via the control plane
42 */
43 virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length);
44
45 /* Receives data using +CRTDCP specified in
46 * 3GPP 27007 10.1.44: Reporting of terminating data via the control plane
47 */
48 virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length);
49
50 virtual void data_received();
51 virtual void attach(void (*callback)(void *), void *data);
52
53 // Id of the PDP context that enables the control plane data connection
54 int _cid;
55
56private:
57 struct packet_t {
58 uint8_t *data;
59 nsapi_size_t data_len;
60 packet_t *next;
61 };
62 CellularList<packet_t> _packet_list;
63 void (*_cb)(void *);
64 void *_data;
65 // Called on receiving URC: +CRTDCP
66 void urc_cp_recv();
67
68protected:
69 ATHandler &_at;
70 AT_CellularDevice &_device;
71};
72
73/**
74 * @}
75 */
76
77} //mbed namespace
Implements support for data transfer using Control Plane CIoT EPS optimization.
Class AT_CellularDevice.
virtual void attach(void(*callback)(void *), void *data)
Register a callback on state change of the socket.
virtual void data_received()
Receives data from the control plane PDP context.
virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length)
Send data over cellular control plane.
virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length)
Receive data over cellular control plane.
Class for sending AT commands and parsing AT responses.
Definition: ATHandler.h:68
Class CellularList.
Definition: CellularList.h:30
Implements support for data transfer using Control Plane CIoT EPS optimization specified in 3GPP 23....
signed int nsapi_size_or_error_t
Type used to represent either a size or error passed through sockets.
Definition: nsapi_types.h:153
unsigned int nsapi_size_t
Type used to represent the size of data passed through sockets.
Definition: nsapi_types.h:146
Callback< R(ArgTs...)> callback(R(*func)(ArgTs...)=nullptr) noexcept
Create a callback class with type inferred from the arguments.
Definition: Callback.h:678