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