Denislam Valeev / Mbed OS Nucleo_rtos_basic
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OnboardCellularInterface.h Source File

OnboardCellularInterface.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 ONBOARD_CELLULAR_INTERFACE_
00017 #define ONBOARD_CELLULAR_INTERFACE_
00018 
00019 #include "EasyCellularConnection.h"
00020 #ifdef CELLULAR_DEVICE
00021 typedef mbed::EasyCellularConnection OnboardCellularInterface;
00022 #elif MODEM_ON_BOARD && MODEM_ON_BOARD_UART && NSAPI_PPP_AVAILABLE
00023 
00024 #include "UARTCellularInterface.h"
00025 
00026 /** OnboardCellularInterface class
00027  *
00028  *  This interface serves as the controller/driver for an
00029  *  onboard modem implementing onboard_modem_api.h.
00030  *
00031  *  Depending on the type of on-board modem, OnboardCellularInterface
00032  *  could be derived from different implementation classes.
00033  *  Portable applications should only rely on it being a CellularBase.
00034  */
00035 class OnboardCellularInterface : public UARTCellularInterface {
00036 
00037 public:
00038 
00039     OnboardCellularInterface(bool debug = false);
00040 
00041     virtual ~OnboardCellularInterface();
00042 
00043 protected:
00044     /** Sets the modem up for powering on
00045      *
00046      *  modem_init() is equivalent to plugging in the device, for example, attaching power and serial port.
00047      *  Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
00048      */
00049     virtual void modem_init();
00050 
00051     /** Sets the modem in unplugged state
00052      *
00053      *  modem_deinit() will be equivalent to pulling the plug off of the device, in other words, detaching power
00054      *  and serial port. This puts the modem in lowest power state.
00055      *  Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
00056      */
00057     virtual void modem_deinit();
00058 
00059     /** Powers up the modem
00060      *
00061      *  modem_power_up() is equivalent to pressing the soft power button.
00062      *  The driver may repeat this if the modem is not responsive to AT commands.
00063      *  Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
00064      */
00065     virtual void modem_power_up();
00066 
00067     /** Powers down the modem
00068      *
00069      *  modem_power_down() is equivalent to turning off the modem by button press.
00070      *  Uses onboard_modem_api.h where the target provides the implementation of onboard_modem_api.
00071      */
00072     virtual void modem_power_down();
00073 };
00074 
00075 #endif //MODEM_ON_BOARD && MODEM_ON_BOARD_UART && NSAPI_PPP_AVAILABLE
00076 #endif //ONBOARD_CELLULAR_INTERFACE_