BA / SerialCom

Fork of OmniWheels by Gustav Atmel

Committer:
gustavatmel
Date:
Tue May 01 15:47:08 2018 +0000
Revision:
1:9c5af431a1f1
sdf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gustavatmel 1:9c5af431a1f1 1 /* CellularInterface
gustavatmel 1:9c5af431a1f1 2 * Copyright (c) 2015 ARM Limited
gustavatmel 1:9c5af431a1f1 3 *
gustavatmel 1:9c5af431a1f1 4 * Licensed under the Apache License, Version 2.0 (the "License");
gustavatmel 1:9c5af431a1f1 5 * you may not use this file except in compliance with the License.
gustavatmel 1:9c5af431a1f1 6 * You may obtain a copy of the License at
gustavatmel 1:9c5af431a1f1 7 *
gustavatmel 1:9c5af431a1f1 8 * http://www.apache.org/licenses/LICENSE-2.0
gustavatmel 1:9c5af431a1f1 9 *
gustavatmel 1:9c5af431a1f1 10 * Unless required by applicable law or agreed to in writing, software
gustavatmel 1:9c5af431a1f1 11 * distributed under the License is distributed on an "AS IS" BASIS,
gustavatmel 1:9c5af431a1f1 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
gustavatmel 1:9c5af431a1f1 13 * See the License for the specific language governing permissions and
gustavatmel 1:9c5af431a1f1 14 * limitations under the License.
gustavatmel 1:9c5af431a1f1 15 */
gustavatmel 1:9c5af431a1f1 16
gustavatmel 1:9c5af431a1f1 17 #ifndef CELLULAR_INTERFACE_H
gustavatmel 1:9c5af431a1f1 18 #define CELLULAR_INTERFACE_H
gustavatmel 1:9c5af431a1f1 19
gustavatmel 1:9c5af431a1f1 20 #include "netsocket/NetworkInterface.h"
gustavatmel 1:9c5af431a1f1 21
gustavatmel 1:9c5af431a1f1 22 /** CellularInterface class
gustavatmel 1:9c5af431a1f1 23 *
gustavatmel 1:9c5af431a1f1 24 * Common interface that is shared between ethernet hardware
gustavatmel 1:9c5af431a1f1 25 * @addtogroup netsocket
gustavatmel 1:9c5af431a1f1 26 */
gustavatmel 1:9c5af431a1f1 27 class CellularInterface : public NetworkInterface
gustavatmel 1:9c5af431a1f1 28 {
gustavatmel 1:9c5af431a1f1 29 public:
gustavatmel 1:9c5af431a1f1 30 /** CellularInterface lifetime
gustavatmel 1:9c5af431a1f1 31 */
gustavatmel 1:9c5af431a1f1 32 MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
gustavatmel 1:9c5af431a1f1 33 virtual ~CellularInterface() {};
gustavatmel 1:9c5af431a1f1 34
gustavatmel 1:9c5af431a1f1 35 /** Set the cellular network APN and credentials
gustavatmel 1:9c5af431a1f1 36 *
gustavatmel 1:9c5af431a1f1 37 * @param apn Optional name of the network to connect to
gustavatmel 1:9c5af431a1f1 38 * @param username Optional username for the APN
gustavatmel 1:9c5af431a1f1 39 * @param password Optional password fot the APN
gustavatmel 1:9c5af431a1f1 40 * @return 0 on success, negative error code on failure
gustavatmel 1:9c5af431a1f1 41 */
gustavatmel 1:9c5af431a1f1 42 MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
gustavatmel 1:9c5af431a1f1 43 virtual nsapi_error_t set_credentials(const char *apn,
gustavatmel 1:9c5af431a1f1 44 const char *username = 0, const char *password = 0) = 0;
gustavatmel 1:9c5af431a1f1 45
gustavatmel 1:9c5af431a1f1 46 /** Start the interface
gustavatmel 1:9c5af431a1f1 47 *
gustavatmel 1:9c5af431a1f1 48 * @param apn Optional name of the network to connect to
gustavatmel 1:9c5af431a1f1 49 * @param username Optional username for your APN
gustavatmel 1:9c5af431a1f1 50 * @param password Optional password for your APN
gustavatmel 1:9c5af431a1f1 51 * @return 0 on success, negative error code on failure
gustavatmel 1:9c5af431a1f1 52 */
gustavatmel 1:9c5af431a1f1 53 MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
gustavatmel 1:9c5af431a1f1 54 virtual nsapi_error_t connect(const char *apn,
gustavatmel 1:9c5af431a1f1 55 const char *username = 0, const char *password = 0) = 0;
gustavatmel 1:9c5af431a1f1 56
gustavatmel 1:9c5af431a1f1 57 /** Start the interface
gustavatmel 1:9c5af431a1f1 58 *
gustavatmel 1:9c5af431a1f1 59 * Attempts to connect to a cellular network based on supplied credentials
gustavatmel 1:9c5af431a1f1 60 *
gustavatmel 1:9c5af431a1f1 61 * @return 0 on success, negative error code on failure
gustavatmel 1:9c5af431a1f1 62 */
gustavatmel 1:9c5af431a1f1 63 MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
gustavatmel 1:9c5af431a1f1 64 virtual nsapi_error_t connect() = 0;
gustavatmel 1:9c5af431a1f1 65
gustavatmel 1:9c5af431a1f1 66 /** Stop the interface
gustavatmel 1:9c5af431a1f1 67 *
gustavatmel 1:9c5af431a1f1 68 * @return 0 on success, negative error code on failure
gustavatmel 1:9c5af431a1f1 69 */
gustavatmel 1:9c5af431a1f1 70 MBED_DEPRECATED_SINCE("mbed-os-5.9", "This API will be deprecated, use mbed-os/features/cellular/framework/API/CellularNetwork.h instead.")
gustavatmel 1:9c5af431a1f1 71 virtual nsapi_error_t disconnect() = 0;
gustavatmel 1:9c5af431a1f1 72 };
gustavatmel 1:9c5af431a1f1 73
gustavatmel 1:9c5af431a1f1 74
gustavatmel 1:9c5af431a1f1 75 #endif