Mistake on this page? Email us
m2mconnectionobserver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 ARM Limited. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef M2M_CONNECTION_OBSERVER_H__
17 #define M2M_CONNECTION_OBSERVER_H__
18 
20 
27 {
28 
29 public :
30 
35  typedef enum {
36  Bootstrap,
37  LWM2MServer
38  }ServerType;
39 
40  typedef enum {
41  NetworkInterfaceConnected,
42  NetworkInterfaceDisconnected
43  }NetworkInterfaceStatus;
44 
50  struct SocketAddress{
52  void *_address;
53  uint8_t _length;
54  uint16_t _port;
55  };
56 
63  virtual void data_available(uint8_t* data,
64  uint16_t data_size,
65  const M2MConnectionObserver::SocketAddress &address) = 0;
66 
72  virtual void socket_error(int error_code, bool retry = true) = 0;
73 
80  virtual void address_ready(const M2MConnectionObserver::SocketAddress &address,
82  const uint16_t server_port) = 0;
83 
87  virtual void data_sent() = 0;
88 
89  virtual void network_interface_status_change(NetworkInterfaceStatus status) = 0;
90 };
91 
92 #endif // M2M_CONNECTION_OBSERVER_H__
virtual void address_ready(const M2MConnectionObserver::SocketAddress &address, M2MConnectionObserver::ServerType server_type, const uint16_t server_port)=0
Indicates that the server address resolving is ready.
ServerType
Definition: m2mconnectionobserver.h:35
virtual void data_available(uint8_t *data, uint16_t data_size, const M2MConnectionObserver::SocketAddress &address)=0
Indicates that data is available from socket.
The M2MSocketAddress struct. A unified container for holding socket address data across different pla...
Definition: m2mconnectionobserver.h:50
M2MInterface. This class provides an interface for handling all mbed Client interface operations defi...
NetworkStack
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition: m2minterface.h:131
Definition: m2mconnectionobserver.h:26
virtual void socket_error(int error_code, bool retry=true)=0
Indicates an error occured in socket.
virtual void data_sent()=0
Indicates that data has been sent successfully.