Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UARTCellularInterface.h Source File

UARTCellularInterface.h

00001 /* Copyright (c) 2017 ARM Limited
00002  *
00003  * Licensed under the Apache License, Version 2.0 (the "License");
00004  * you may not use this file except in compliance with the License.
00005  * You may obtain a copy of the License at
00006  *
00007  *     http://www.apache.org/licenses/LICENSE-2.0
00008  *
00009  * Unless required by applicable law or agreed to in writing, software
00010  * distributed under the License is distributed on an "AS IS" BASIS,
00011  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012  * See the License for the specific language governing permissions and
00013  * limitations under the License.
00014  */
00015 
00016 #ifndef UART_CELLULAR_INTERFACE_
00017 #define UART_CELLULAR_INTERFACE_
00018 
00019 #include "PPPCellularInterface.h"
00020 #include "UARTSerial.h"
00021 
00022 #if NSAPI_PPP_AVAILABLE
00023 
00024 /** UARTCellularInterface class
00025  *
00026  *  This interface serves as the controller/driver for Cellular
00027  *  modems attached via a UART (tested with UBLOX_C027 and MTS_DRAGONFLY_F411RE).
00028  *
00029  *  It constructs a FileHandle and passes it back to its base class as well as overrides
00030  *  enable_hup() in the base class.
00031  */
00032 
00033 class UARTCellularInterface : public PPPCellularInterface {
00034 
00035 public:
00036 
00037     MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
00038     UARTCellularInterface(PinName tx, PinName rx, PinName dcd = NC, PinName rts = NC, PinName cts = NC, PinName ri = NC,
00039                              PinName dtr = NC, PinName dsr = NC, int baud = MBED_CONF_PPP_CELL_IFACE_BAUD_RATE,
00040                              bool active_high = false,
00041                              bool debug = false);
00042 
00043     MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
00044     virtual ~UARTCellularInterface();
00045 
00046 private:
00047     UARTSerial _serial;
00048     PinName _dcd_pin;
00049     bool _active_high;
00050 
00051 protected:
00052     /** Enable or disable hang-up detection
00053      *
00054      *  When in PPP data pump mode, it is helpful if the FileHandle will signal hang-up via
00055      *  POLLHUP, e.g., if the DCD line is deasserted on a UART. During command mode, this
00056      *  signaling is not desired. enable_hup() controls whether this function should be
00057      *  active.
00058      */
00059     MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/easy_cellular/EasyCellularConnection.h instead.")
00060     virtual void enable_hup(bool enable);
00061 };
00062 
00063 #endif //NSAPI_PPP_AVAILABLE
00064 
00065 #endif //UART_CELLULAR_INTERFACE_