mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Merge pull request #9655 from mirelachirica/nonip_doxygen_updates
Cellular: Non-IP doxygen updatespull/9774/head
						commit
						e3bc37b4de
					
				| 
						 | 
					@ -21,6 +21,11 @@
 | 
				
			||||||
#include "CellularDevice.h"
 | 
					#include "CellularDevice.h"
 | 
				
			||||||
#include "ControlPlane_netif.h"
 | 
					#include "ControlPlane_netif.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** @file CellularContext.h
 | 
				
			||||||
 | 
					 * @brief Cellular PDP context class
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace mbed {
 | 
					namespace mbed {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum pdp_type {
 | 
					typedef enum pdp_type {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,6 +24,10 @@
 | 
				
			||||||
#include "ATHandler.h"
 | 
					#include "ATHandler.h"
 | 
				
			||||||
#include "UARTSerial.h"
 | 
					#include "UARTSerial.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** @file CellularDevice.h
 | 
				
			||||||
 | 
					 * @brief Class CellularDevice
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
namespace mbed {
 | 
					namespace mbed {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CellularSMS;
 | 
					class CellularSMS;
 | 
				
			||||||
| 
						 | 
					@ -168,7 +172,7 @@ public:
 | 
				
			||||||
     *  @param fh       file handle used in communication to modem. This can be, for example, UART handle. If null, then the default
 | 
					     *  @param fh       file handle used in communication to modem. This can be, for example, UART handle. If null, then the default
 | 
				
			||||||
     *                  file handle is used.
 | 
					     *                  file handle is used.
 | 
				
			||||||
     *  @param apn      access point to use with context, can be null.
 | 
					     *  @param apn      access point to use with context, can be null.
 | 
				
			||||||
     *  @param cp_req       flag indicating if EPS control plane optimisation is required
 | 
					     *  @param cp_req       flag indicating if EPS control plane optimization is required
 | 
				
			||||||
     *  @param nonip_req    flag indicating if this context is required to be Non-IP
 | 
					     *  @param nonip_req    flag indicating if this context is required to be Non-IP
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *  @return         new instance of class CellularContext or NULL in case of failure
 | 
					     *  @return         new instance of class CellularContext or NULL in case of failure
 | 
				
			||||||
| 
						 | 
					@ -184,7 +188,7 @@ public:
 | 
				
			||||||
     *  @param apn          access point to use with context, can be null.
 | 
					     *  @param apn          access point to use with context, can be null.
 | 
				
			||||||
     *  @param dcd_pin      Pin used to set data carrier detect on/off for the given UART
 | 
					     *  @param dcd_pin      Pin used to set data carrier detect on/off for the given UART
 | 
				
			||||||
     *  @param active_high  a boolean set to true if DCD polarity is active low
 | 
					     *  @param active_high  a boolean set to true if DCD polarity is active low
 | 
				
			||||||
     *  @param cp_req       Flag indicating if EPS control plane optimisation is required
 | 
					     *  @param cp_req       Flag indicating if EPS control plane optimization is required
 | 
				
			||||||
     *  @param nonip_req    Flag indicating if this context is required to be Non-IP
 | 
					     *  @param nonip_req    Flag indicating if this context is required to be Non-IP
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *  @return         new instance of class CellularContext or NULL in case of failure
 | 
					     *  @return         new instance of class CellularContext or NULL in case of failure
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -260,7 +260,7 @@ public:
 | 
				
			||||||
     *  @param supported_opt Supported CIoT EPS optimizations
 | 
					     *  @param supported_opt Supported CIoT EPS optimizations
 | 
				
			||||||
     *                       (the HW support can be checked with get_ciot_ue_optimization_config).
 | 
					     *                       (the HW support can be checked with get_ciot_ue_optimization_config).
 | 
				
			||||||
     *  @param preferred_opt Preferred CIoT EPS optimizations.
 | 
					     *  @param preferred_opt Preferred CIoT EPS optimizations.
 | 
				
			||||||
     *  @param network_support_cb This callback will be called when CIoT network optimisation support is known
 | 
					     *  @param network_support_cb This callback will be called when CIoT network optimization support is known
 | 
				
			||||||
     *  @return              NSAPI_ERROR_OK on success
 | 
					     *  @return              NSAPI_ERROR_OK on success
 | 
				
			||||||
     *                       NSAPI_ERROR_DEVICE_ERROR on failure
 | 
					     *                       NSAPI_ERROR_DEVICE_ERROR on failure
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -460,7 +460,7 @@ nsapi_error_t AT_CellularContext::do_activate_context()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // In IP case but also when Non-IP is requested and
 | 
					    // In IP case but also when Non-IP is requested and
 | 
				
			||||||
    // control plane optimisation is not established -> activate ip context
 | 
					    // control plane optimization is not established -> activate ip context
 | 
				
			||||||
    _nonip_req = false;
 | 
					    _nonip_req = false;
 | 
				
			||||||
    return activate_ip_context();
 | 
					    return activate_ip_context();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -135,7 +135,7 @@ protected:
 | 
				
			||||||
    // flag indicating if Non-IP context was requested to be setup
 | 
					    // flag indicating if Non-IP context was requested to be setup
 | 
				
			||||||
    bool _nonip_req;
 | 
					    bool _nonip_req;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // tells if CCIOTOPTI received green from network for CP optimisation use
 | 
					    // tells if CCIOTOPTI received green from network for CP optimization use
 | 
				
			||||||
    bool _cp_in_use;
 | 
					    bool _cp_in_use;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -99,9 +99,11 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /** Creates new instance of AT_CellularContext or if overridden, modem specific implementation.
 | 
					    /** Creates new instance of AT_CellularContext or if overridden, modem specific implementation.
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     *  @param at       ATHandler reference for communication with the modem.
 | 
					     *  @param at           ATHandler reference for communication with the modem.
 | 
				
			||||||
     *  @param apn      access point to use with context
 | 
					     *  @param apn          access point to use with context
 | 
				
			||||||
     *  @return         new instance of class AT_CellularContext
 | 
					     *  @param cp_req       flag indicating if control plane EPS optimization needs to be setup
 | 
				
			||||||
 | 
					     *  @param nonip_req    flag indicating if PDP context needs to be Non-IP
 | 
				
			||||||
 | 
					     *  @return             new instance of class AT_CellularContext
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    virtual AT_CellularContext *create_context_impl(ATHandler &at, const char *apn, bool cp_req = false, bool nonip_req = false);
 | 
					    virtual AT_CellularContext *create_context_impl(ATHandler &at, const char *apn, bool cp_req = false, bool nonip_req = false);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,10 +12,18 @@ public:
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ControlPlane_netif
 | 
					// ControlPlane_netif
 | 
				
			||||||
    // +CSODCP: 3GPP 27007 10.1.43
 | 
					
 | 
				
			||||||
 | 
					    /* Sends data using +CSODCP specified in
 | 
				
			||||||
 | 
					     *  3GPP 27007 10.1.43: Sending of originating data via the control plane
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length);
 | 
					    virtual nsapi_size_or_error_t send(const void *cpdata, nsapi_size_t cpdata_length);
 | 
				
			||||||
    // +CRTDCP: 3GPP 27007 10.1.44
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Receives data using +CRTDCP specified in
 | 
				
			||||||
 | 
					     *  3GPP 27007 10.1.44: Reporting of terminating data via the control plane
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length);
 | 
					    virtual nsapi_size_or_error_t recv(void *cpdata, nsapi_size_t cpdata_length);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    virtual void data_received();
 | 
					    virtual void data_received();
 | 
				
			||||||
    virtual void attach(void (*callback)(void *), void *data);
 | 
					    virtual void attach(void (*callback)(void *), void *data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,6 +35,7 @@ private:
 | 
				
			||||||
    void *_data;
 | 
					    void *_data;
 | 
				
			||||||
    char _recv_buffer[MAX_CP_DATA_RECV_LEN];
 | 
					    char _recv_buffer[MAX_CP_DATA_RECV_LEN];
 | 
				
			||||||
    size_t _recv_len;
 | 
					    size_t _recv_len;
 | 
				
			||||||
 | 
					    // Called on receiving URC: +CRTDCP
 | 
				
			||||||
    void urc_cp_recv();
 | 
					    void urc_cp_recv();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
            "value": null
 | 
					            "value": null
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        "control-plane-opt": {
 | 
					        "control-plane-opt": {
 | 
				
			||||||
            "help": "Enables control plane CIoT EPS optimisation",
 | 
					            "help": "Enables control plane CIoT EPS optimization",
 | 
				
			||||||
            "value": false
 | 
					            "value": false
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,4 @@
 | 
				
			||||||
 | 
					/* CellularNonIPSocket
 | 
				
			||||||
/** \addtogroup netsocket */
 | 
					 | 
				
			||||||
/** @{*/
 | 
					 | 
				
			||||||
/* Socket
 | 
					 | 
				
			||||||
 * Copyright (c) 2015 ARM Limited
 | 
					 * Copyright (c) 2015 ARM Limited
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
| 
						 | 
					@ -30,7 +27,13 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace mbed {
 | 
					namespace mbed {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Socket implementation for non ip datagrams over cellular control plane
 | 
					/** \addtogroup netsocket */
 | 
				
			||||||
 | 
					/** @{*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Socket implementation for cellular Non-IP data delivery(NIDD).
 | 
				
			||||||
 | 
					 *  Relies on Control Plane CIoT EPS optimization feature,
 | 
				
			||||||
 | 
					 *  implemented in ControlPlane_netif class.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
class CellularNonIPSocket : public Socket {
 | 
					class CellularNonIPSocket : public Socket {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    /** Destroy the socket.
 | 
					    /** Destroy the socket.
 | 
				
			||||||
| 
						 | 
					@ -101,7 +104,7 @@ public:
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    virtual void set_blocking(bool blocking);
 | 
					    virtual void set_blocking(bool blocking);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /** @copydoc Socket::set_blocking
 | 
					    /** @copydoc Socket::set_timeout
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    virtual void set_timeout(int timeout);
 | 
					    virtual void set_timeout(int timeout);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -109,17 +112,25 @@ public:
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    virtual void sigio(mbed::Callback<void()> func);
 | 
					    virtual void sigio(mbed::Callback<void()> func);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // NOT SUPPORTED
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t connect(const SocketAddress &address);
 | 
					    virtual nsapi_error_t connect(const SocketAddress &address);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual Socket *accept(nsapi_error_t *error = NULL);
 | 
					    virtual Socket *accept(nsapi_error_t *error = NULL);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t listen(int backlog = 1);
 | 
					    virtual nsapi_error_t listen(int backlog = 1);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t setsockopt(int level, int optname, const void *optval, unsigned optlen);
 | 
					    virtual nsapi_error_t setsockopt(int level, int optname, const void *optval, unsigned optlen);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t getsockopt(int level, int optname, void *optval, unsigned *optlen);
 | 
					    virtual nsapi_error_t getsockopt(int level, int optname, void *optval, unsigned *optlen);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t getpeername(SocketAddress *address);
 | 
					    virtual nsapi_error_t getpeername(SocketAddress *address);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_size_or_error_t sendto(const SocketAddress &address,
 | 
					    virtual nsapi_size_or_error_t sendto(const SocketAddress &address,
 | 
				
			||||||
                                         const void *data, nsapi_size_t size);
 | 
					                                         const void *data, nsapi_size_t size);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_size_or_error_t recvfrom(SocketAddress *address,
 | 
					    virtual nsapi_size_or_error_t recvfrom(SocketAddress *address,
 | 
				
			||||||
                                           void *data, nsapi_size_t size);
 | 
					                                           void *data, nsapi_size_t size);
 | 
				
			||||||
 | 
					    /// NOT APPLICABLE
 | 
				
			||||||
    virtual nsapi_error_t bind(const SocketAddress &address);
 | 
					    virtual nsapi_error_t bind(const SocketAddress &address);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
| 
						 | 
					@ -143,8 +154,7 @@ protected:
 | 
				
			||||||
    bool _opened;
 | 
					    bool _opened;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** @}*/
 | 
				
			||||||
} // namespace mbed
 | 
					} // namespace mbed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // CELLULARNONIPSOCKET_H
 | 
					#endif // CELLULARNONIPSOCKET_H
 | 
				
			||||||
 | 
					 | 
				
			||||||
/** @}*/
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,12 +19,26 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "nsapi_types.h"
 | 
					#include "nsapi_types.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** @file ControlPlane_netif.h
 | 
				
			||||||
 | 
					 * @brief Implements support for data transfer using Control Plane CIoT EPS optimization.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace mbed {
 | 
					namespace mbed {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Length of the buffer storing data received over control plane */
 | 
					/* Length of the buffer storing data received over control plane */
 | 
				
			||||||
#define MAX_CP_DATA_RECV_LEN 2048
 | 
					#define MAX_CP_DATA_RECV_LEN 2048
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// TODO: need to make this l3ip compatible
 | 
					// TODO: need to make this l3ip compatible
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @addtogroup cellular
 | 
				
			||||||
 | 
					 * @{
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/** Implements support for data transfer using
 | 
				
			||||||
 | 
					 *  Control Plane CIoT EPS optimization specified in 3GPP 23.401(4.10), 3GPP 23.682(4.5.14).
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
class ControlPlane_netif {
 | 
					class ControlPlane_netif {
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
    ControlPlane_netif() {}
 | 
					    ControlPlane_netif() {}
 | 
				
			||||||
| 
						 | 
					@ -58,8 +72,6 @@ protected:
 | 
				
			||||||
    *  is received from network. It will invoke the callback set
 | 
					    *  is received from network. It will invoke the callback set
 | 
				
			||||||
    *  by the above attach.
 | 
					    *  by the above attach.
 | 
				
			||||||
    *
 | 
					    *
 | 
				
			||||||
    *  @param buffer     Buffer containing received data
 | 
					 | 
				
			||||||
    *  @param size       Size of data in bytes
 | 
					 | 
				
			||||||
    */
 | 
					    */
 | 
				
			||||||
    virtual void data_received() = 0;
 | 
					    virtual void data_received() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -78,5 +90,9 @@ protected:
 | 
				
			||||||
    virtual void attach(void (*callback)(void *), void *data) = 0;
 | 
					    virtual void attach(void (*callback)(void *), void *data) = 0;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @}
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // mbed namespace
 | 
					} // mbed namespace
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue