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 
25 {
26 
27 public :
28 
33  typedef enum {
34  Bootstrap,
35  LWM2MServer
36  }ServerType;
37 
38  typedef enum {
39  NetworkInterfaceConnected,
40  NetworkInterfaceDisconnected
41  }NetworkInterfaceStatus;
42 
48  struct SocketAddress{
50  void *_address;
51  uint8_t _length;
52  uint16_t _port;
53  };
54 
61  virtual void data_available(uint8_t* data,
62  uint16_t data_size,
63  const M2MConnectionObserver::SocketAddress &address) = 0;
64 
70  virtual void socket_error(int error_code, bool retry = true) = 0;
71 
78  virtual void address_ready(const M2MConnectionObserver::SocketAddress &address,
80  const uint16_t server_port) = 0;
81 
85  virtual void data_sent() = 0;
86 
87  virtual void network_interface_status_change(NetworkInterfaceStatus status) = 0;
88 };
89 
90 #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:33
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:48
header for M2MInterface
NetworkStack
An enum defining different kinds of network stacks that can be used by mbed Client.
Definition: m2minterface.h:138
Definition: m2mconnectionobserver.h:24
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.