Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UARTCellularInterface.cpp Source File

UARTCellularInterface.cpp

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 #include "UARTCellularInterface.h"
00016 
00017 #if NSAPI_PPP_AVAILABLE
00018 
00019 UARTCellularInterface::UARTCellularInterface(PinName txd, PinName rxd, PinName dcd, PinName rts, PinName cts, PinName ri,
00020                                              PinName dtr, PinName dsr, int baud, bool active_high, bool debug) :
00021                                                       PPPCellularInterface(&_serial, debug),
00022                                                       _serial(txd, rxd, baud)
00023 {
00024     _dcd_pin = dcd;
00025     _active_high = active_high;
00026 }
00027 
00028 UARTCellularInterface::~UARTCellularInterface()
00029 {
00030     //do nothing
00031 }
00032 
00033 void UARTCellularInterface::enable_hup(bool enable)
00034 {
00035     _serial.set_data_carrier_detect(enable ? _dcd_pin : NC, _active_high);
00036 }
00037 
00038 #endif // NSAPI_PPP_AVAILABLE