Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
features/netsocket/CellularInterface.h@0:0e018d759a2a, 2016-11-08 (annotated)
- Committer:
- switches
- Date:
- Tue Nov 08 18:27:11 2016 +0000
- Revision:
- 0:0e018d759a2a
Initial commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| switches | 0:0e018d759a2a | 1 | |
| switches | 0:0e018d759a2a | 2 | /** \addtogroup netsocket */ |
| switches | 0:0e018d759a2a | 3 | /** @{*/ |
| switches | 0:0e018d759a2a | 4 | /* CellularInterface |
| switches | 0:0e018d759a2a | 5 | * Copyright (c) 2015 ARM Limited |
| switches | 0:0e018d759a2a | 6 | * |
| switches | 0:0e018d759a2a | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| switches | 0:0e018d759a2a | 8 | * you may not use this file except in compliance with the License. |
| switches | 0:0e018d759a2a | 9 | * You may obtain a copy of the License at |
| switches | 0:0e018d759a2a | 10 | * |
| switches | 0:0e018d759a2a | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| switches | 0:0e018d759a2a | 12 | * |
| switches | 0:0e018d759a2a | 13 | * Unless required by applicable law or agreed to in writing, software |
| switches | 0:0e018d759a2a | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| switches | 0:0e018d759a2a | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| switches | 0:0e018d759a2a | 16 | * See the License for the specific language governing permissions and |
| switches | 0:0e018d759a2a | 17 | * limitations under the License. |
| switches | 0:0e018d759a2a | 18 | */ |
| switches | 0:0e018d759a2a | 19 | |
| switches | 0:0e018d759a2a | 20 | #ifndef CELLULAR_INTERFACE_H |
| switches | 0:0e018d759a2a | 21 | #define CELLULAR_INTERFACE_H |
| switches | 0:0e018d759a2a | 22 | |
| switches | 0:0e018d759a2a | 23 | #include "netsocket/NetworkInterface.h" |
| switches | 0:0e018d759a2a | 24 | |
| switches | 0:0e018d759a2a | 25 | |
| switches | 0:0e018d759a2a | 26 | /** CellularInterface class |
| switches | 0:0e018d759a2a | 27 | * |
| switches | 0:0e018d759a2a | 28 | * Common interface that is shared between ethernet hardware |
| switches | 0:0e018d759a2a | 29 | */ |
| switches | 0:0e018d759a2a | 30 | class CellularInterface : public NetworkInterface |
| switches | 0:0e018d759a2a | 31 | { |
| switches | 0:0e018d759a2a | 32 | public: |
| switches | 0:0e018d759a2a | 33 | /** CellularInterface lifetime |
| switches | 0:0e018d759a2a | 34 | */ |
| switches | 0:0e018d759a2a | 35 | virtual ~CellularInterface() {}; |
| switches | 0:0e018d759a2a | 36 | |
| switches | 0:0e018d759a2a | 37 | /** Set the cellular network APN and credentials |
| switches | 0:0e018d759a2a | 38 | * |
| switches | 0:0e018d759a2a | 39 | * @param apn Optional name of the network to connect to |
| switches | 0:0e018d759a2a | 40 | * @param user Optional username for the APN |
| switches | 0:0e018d759a2a | 41 | * @param pass Optional password fot the APN |
| switches | 0:0e018d759a2a | 42 | */ |
| switches | 0:0e018d759a2a | 43 | virtual int set_credentials(const char *apn, const char *user = 0, const char *pass = 0) = 0; |
| switches | 0:0e018d759a2a | 44 | |
| switches | 0:0e018d759a2a | 45 | /** Start the interface |
| switches | 0:0e018d759a2a | 46 | * |
| switches | 0:0e018d759a2a | 47 | * @param apn Optional name of the network to connect to |
| switches | 0:0e018d759a2a | 48 | * @param username Optional username for your APN |
| switches | 0:0e018d759a2a | 49 | * @param password Optional password for your APN |
| switches | 0:0e018d759a2a | 50 | * @return 0 on success, negative error code on failure |
| switches | 0:0e018d759a2a | 51 | */ |
| switches | 0:0e018d759a2a | 52 | virtual int connect(const char *apn, const char *username = 0, const char *password = 0) = 0; |
| switches | 0:0e018d759a2a | 53 | |
| switches | 0:0e018d759a2a | 54 | /** Start the interface |
| switches | 0:0e018d759a2a | 55 | * |
| switches | 0:0e018d759a2a | 56 | * Attempts to connect to a cellular network based on supplied credentials |
| switches | 0:0e018d759a2a | 57 | * |
| switches | 0:0e018d759a2a | 58 | * @return 0 on success, negative error code on failure |
| switches | 0:0e018d759a2a | 59 | */ |
| switches | 0:0e018d759a2a | 60 | virtual int connect() = 0; |
| switches | 0:0e018d759a2a | 61 | |
| switches | 0:0e018d759a2a | 62 | /** Stop the interface |
| switches | 0:0e018d759a2a | 63 | * |
| switches | 0:0e018d759a2a | 64 | * @return 0 on success, negative error code on failure |
| switches | 0:0e018d759a2a | 65 | */ |
| switches | 0:0e018d759a2a | 66 | virtual int disconnect() = 0; |
| switches | 0:0e018d759a2a | 67 | }; |
| switches | 0:0e018d759a2a | 68 | |
| switches | 0:0e018d759a2a | 69 | |
| switches | 0:0e018d759a2a | 70 | #endif |
| switches | 0:0e018d759a2a | 71 | |
| switches | 0:0e018d759a2a | 72 | /** @}*/ |