diff options
author | Amarnath Hullur Subramanyam <amarnath@codeaurora.org> | 2014-12-02 10:21:45 -0800 |
---|---|---|
committer | Vinit Deshpande <vinitd@google.com> | 2014-12-08 10:51:44 -0800 |
commit | a09170e381fa38591e74fd35c1dc12b5cd5f3843 (patch) | |
tree | 37f4063d67092d3e6d8e78aa7e4c3cb0d1ca919d | |
parent | bb73aa5a14b1cab3d4220ac0ba9f8ee7612d6d11 (diff) | |
download | hardware_libhardware_legacy-a09170e381fa38591e74fd35c1dc12b5cd5f3843.zip hardware_libhardware_legacy-a09170e381fa38591e74fd35c1dc12b5cd5f3843.tar.gz hardware_libhardware_legacy-a09170e381fa38591e74fd35c1dc12b5cd5f3843.tar.bz2 |
Fix wifi_hal.h and gscan.h to compile for c projects.
When the wifi_hal.h is included as part of the c source
code files some of the functions are not exported. The
const variable as an index to an array is causing compiler
error. The changes are to address these issues.
Change-Id: Ia2dbd7a87315cee8d0246a8ac6539c9b4b22ffd4
-rw-r--r-- | include/hardware_legacy/gscan.h | 8 | ||||
-rw-r--r-- | include/hardware_legacy/wifi_hal.h | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h index cf27d13..fed7c0e 100644 --- a/include/hardware_legacy/gscan.h +++ b/include/hardware_legacy/gscan.h @@ -16,10 +16,10 @@ typedef enum { WIFI_BAND_ABG_WITH_DFS = 7, // 2.4 GHz + 5 GHz with DFS } wifi_band; -const unsigned MAX_CHANNELS = 16; -const unsigned MAX_BUCKETS = 16; -const unsigned MAX_HOTLIST_APS = 128; -const unsigned MAX_SIGNIFICANT_CHANGE_APS = 64; +#define MAX_CHANNELS 16 +#define MAX_BUCKETS 16 +#define MAX_HOTLIST_APS 128 +#define MAX_SIGNIFICANT_CHANGE_APS 64 wifi_error wifi_get_valid_channels(wifi_interface_handle handle, int band, int max_channels, wifi_channel *channels, int *num_channels); diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index c970fc0..13ba2e4 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -17,6 +17,10 @@ #ifndef __WIFI_HAL_H__ #define __WIFI_HAL_H__ +#ifdef __cplusplus +extern "C" +{ +#endif #include <stdint.h> typedef enum { @@ -47,10 +51,8 @@ typedef byte oui[3]; typedef int64_t wifi_timestamp; // In microseconds (us) typedef int64_t wifi_timespan; // In nanoseconds (ns) -struct wifi_info; -typedef wifi_info *wifi_handle; -struct wifi_interface_info; -typedef wifi_interface_info *wifi_interface_handle; +typedef struct wifi_info *wifi_handle; +typedef struct wifi_interface_info *wifi_interface_handle; /* Initialize/Cleanup */ @@ -124,6 +126,8 @@ wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs); #include "link_layer_stats.h" #include "rtt.h" #include "tdls.h" - +#ifdef __cplusplus +} +#endif #endif |