Entrega 3er corte - sistemas embebidos

Committer:
Bethory
Date:
Wed May 30 00:01:50 2018 +0000
Revision:
0:6ad07c9019fd
Codigo de tales para todos los pasculaes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Bethory 0:6ad07c9019fd 1 /* WiFiInterface
Bethory 0:6ad07c9019fd 2 * Copyright (c) 2015 - 2016 ARM Limited
Bethory 0:6ad07c9019fd 3 *
Bethory 0:6ad07c9019fd 4 * Licensed under the Apache License, Version 2.0 (the "License");
Bethory 0:6ad07c9019fd 5 * you may not use this file except in compliance with the License.
Bethory 0:6ad07c9019fd 6 * You may obtain a copy of the License at
Bethory 0:6ad07c9019fd 7 *
Bethory 0:6ad07c9019fd 8 * http://www.apache.org/licenses/LICENSE-2.0
Bethory 0:6ad07c9019fd 9 *
Bethory 0:6ad07c9019fd 10 * Unless required by applicable law or agreed to in writing, software
Bethory 0:6ad07c9019fd 11 * distributed under the License is distributed on an "AS IS" BASIS,
Bethory 0:6ad07c9019fd 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Bethory 0:6ad07c9019fd 13 * See the License for the specific language governing permissions and
Bethory 0:6ad07c9019fd 14 * limitations under the License.
Bethory 0:6ad07c9019fd 15 */
Bethory 0:6ad07c9019fd 16
Bethory 0:6ad07c9019fd 17 #ifndef WIFI_ACCESS_POINT_H
Bethory 0:6ad07c9019fd 18 #define WIFI_ACCESS_POINT_H
Bethory 0:6ad07c9019fd 19
Bethory 0:6ad07c9019fd 20 #include <string.h>
Bethory 0:6ad07c9019fd 21 #include "netsocket/nsapi_types.h"
Bethory 0:6ad07c9019fd 22
Bethory 0:6ad07c9019fd 23 /** WiFiAccessPoint class
Bethory 0:6ad07c9019fd 24 *
Bethory 0:6ad07c9019fd 25 * Class that represents a WiFi Access Point
Bethory 0:6ad07c9019fd 26 * Common interface that is shared between WiFi devices
Bethory 0:6ad07c9019fd 27 */
Bethory 0:6ad07c9019fd 28 class WiFiAccessPoint
Bethory 0:6ad07c9019fd 29 {
Bethory 0:6ad07c9019fd 30 /** WiFiAccessPoint lifetime
Bethory 0:6ad07c9019fd 31 */
Bethory 0:6ad07c9019fd 32 public:
Bethory 0:6ad07c9019fd 33 WiFiAccessPoint();
Bethory 0:6ad07c9019fd 34 WiFiAccessPoint(nsapi_wifi_ap_t ap);
Bethory 0:6ad07c9019fd 35
Bethory 0:6ad07c9019fd 36 /** Get an access point's ssid
Bethory 0:6ad07c9019fd 37 *
Bethory 0:6ad07c9019fd 38 * @return The ssid of the access point
Bethory 0:6ad07c9019fd 39 */
Bethory 0:6ad07c9019fd 40 const char *get_ssid() const;
Bethory 0:6ad07c9019fd 41
Bethory 0:6ad07c9019fd 42 /** Get an access point's bssid
Bethory 0:6ad07c9019fd 43 *
Bethory 0:6ad07c9019fd 44 * @return The bssid of the access point
Bethory 0:6ad07c9019fd 45 */
Bethory 0:6ad07c9019fd 46 const uint8_t *get_bssid() const;
Bethory 0:6ad07c9019fd 47
Bethory 0:6ad07c9019fd 48 /** Get an access point's security
Bethory 0:6ad07c9019fd 49 *
Bethory 0:6ad07c9019fd 50 * @return The security type of the access point
Bethory 0:6ad07c9019fd 51 */
Bethory 0:6ad07c9019fd 52 nsapi_security_t get_security() const;
Bethory 0:6ad07c9019fd 53
Bethory 0:6ad07c9019fd 54 /** Gets the radio signal strength for the access point
Bethory 0:6ad07c9019fd 55 *
Bethory 0:6ad07c9019fd 56 * @return Connection strength in dBm (negative value),
Bethory 0:6ad07c9019fd 57 * or 0 if measurement impossible
Bethory 0:6ad07c9019fd 58 */
Bethory 0:6ad07c9019fd 59 int8_t get_rssi() const;
Bethory 0:6ad07c9019fd 60
Bethory 0:6ad07c9019fd 61 /** Get the access point's channel
Bethory 0:6ad07c9019fd 62 *
Bethory 0:6ad07c9019fd 63 * @return The channel of the access point
Bethory 0:6ad07c9019fd 64 */
Bethory 0:6ad07c9019fd 65 uint8_t get_channel() const;
Bethory 0:6ad07c9019fd 66
Bethory 0:6ad07c9019fd 67 private:
Bethory 0:6ad07c9019fd 68 nsapi_wifi_ap_t _ap;
Bethory 0:6ad07c9019fd 69 };
Bethory 0:6ad07c9019fd 70
Bethory 0:6ad07c9019fd 71 #endif