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