diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/hardware_legacy/AudioHardwareInterface.h | 5 | ||||
| -rw-r--r-- | include/hardware_legacy/AudioPolicyInterface.h | 31 | ||||
| -rw-r--r-- | include/hardware_legacy/AudioPolicyManagerBase.h | 144 | ||||
| -rw-r--r-- | include/hardware_legacy/AudioSystemLegacy.h | 4 | ||||
| -rw-r--r-- | include/hardware_legacy/power.h | 3 | ||||
| -rw-r--r-- | include/hardware_legacy/wifi.h | 74 |
6 files changed, 138 insertions, 123 deletions
diff --git a/include/hardware_legacy/AudioHardwareInterface.h b/include/hardware_legacy/AudioHardwareInterface.h index 425b0a5..31d6b99 100644 --- a/include/hardware_legacy/AudioHardwareInterface.h +++ b/include/hardware_legacy/AudioHardwareInterface.h @@ -56,7 +56,7 @@ public: virtual size_t bufferSize() const = 0; /** - * returns the output channel nask + * returns the output channel mask */ virtual uint32_t channels() const = 0; @@ -166,7 +166,7 @@ public: virtual String8 getParameters(const String8& keys) = 0; - // Return the amount of input frames lost in the audio driver since the last call of this function. + // Return the number of input frames lost in the audio driver since the last call of this function. // Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. // Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers. // Unit: the number of input audio frames @@ -244,6 +244,7 @@ public: uint32_t *sampleRate=0, status_t *status=0) = 0; virtual void closeOutputStream(AudioStreamOut* out) = 0; + /** This method creates and opens the audio hardware input stream */ virtual AudioStreamIn* openInputStream( uint32_t devices, diff --git a/include/hardware_legacy/AudioPolicyInterface.h b/include/hardware_legacy/AudioPolicyInterface.h index 1ee0e20..d703485 100644 --- a/include/hardware_legacy/AudioPolicyInterface.h +++ b/include/hardware_legacy/AudioPolicyInterface.h @@ -69,16 +69,14 @@ public: virtual status_t setDeviceConnectionState(AudioSystem::audio_devices device, AudioSystem::device_connection_state state, const char *device_address) = 0; - // retreive a device connection status + // retrieve a device connection status virtual AudioSystem::device_connection_state getDeviceConnectionState(AudioSystem::audio_devices device, const char *device_address) = 0; // indicate a change in phone state. Valid phones states are defined by AudioSystem::audio_mode virtual void setPhoneState(int state) = 0; - // indicate a change in ringer mode - virtual void setRingerMode(uint32_t mode, uint32_t mask) = 0; // force using a specific device category for the specified usage virtual void setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config) = 0; - // retreive current device category forced for a given usage + // retrieve current device category forced for a given usage virtual AudioSystem::forced_config getForceUse(AudioSystem::force_use usage) = 0; // set a system property (e.g. camera sound always audible) virtual void setSystemProperty(const char* property, const char* value) = 0; @@ -89,7 +87,7 @@ public: // Audio routing query functions // - // request an output appriate for playback of the supplied stream type and parameters + // request an output appropriate for playback of the supplied stream type and parameters virtual audio_io_handle_t getOutput(AudioSystem::stream_type stream, uint32_t samplingRate = 0, uint32_t format = AudioSystem::FORMAT_DEFAULT, @@ -106,7 +104,7 @@ public: // releases the output. virtual void releaseOutput(audio_io_handle_t output) = 0; - // request an input appriate for record from the supplied device with supplied parameters. + // request an input appropriate for record from the supplied device with supplied parameters. virtual audio_io_handle_t getInput(int inputSource, uint32_t samplingRate = 0, uint32_t Format = AudioSystem::FORMAT_DEFAULT, @@ -128,16 +126,25 @@ public: int indexMin, int indexMax) = 0; - // sets the new stream volume at a level corresponding to the supplied index - virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index) = 0; - // retreive current volume index for the specified stream - virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index) = 0; + // sets the new stream volume at a level corresponding to the supplied index for the + // supplied device. By convention, specifying AUDIO_DEVICE_OUT_DEFAULT means + // setting volume for all devices + virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, + int index, + audio_devices_t device) = 0; + + // retrieve current volume index for the specified stream and the + // specified device. By convention, specifying AUDIO_DEVICE_OUT_DEFAULT means + // querying the volume of the active device. + virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, + int *index, + audio_devices_t device) = 0; // return the strategy corresponding to a given stream type virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream) = 0; // return the enabled output devices for the given stream type - virtual uint32_t getDevicesForStream(AudioSystem::stream_type stream) = 0; + virtual audio_devices_t getDevicesForStream(AudioSystem::stream_type stream) = 0; // Audio effect management virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; @@ -196,7 +203,7 @@ public: uint32_t *pSamplingRate, uint32_t *pFormat, uint32_t *pChannels, - uint32_t acoustics) = 0; + audio_in_acoustics_t acoustics) = 0; // closes an audio input virtual status_t closeInput(audio_io_handle_t input) = 0; // diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index d864b0a..1459e7e 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -20,11 +20,14 @@ #include <utils/Timers.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> +#include <utils/SortedVector.h> #include <hardware_legacy/AudioPolicyInterface.h> namespace android_audio_legacy { using android::KeyedVector; + using android::DefaultKeyedVector; + using android::SortedVector; // ---------------------------------------------------------------------------- @@ -53,6 +56,20 @@ namespace android_audio_legacy { // and provided in a shared library libaudiopolicy.so. // ---------------------------------------------------------------------------- +// the output_profile_s structure describes the capabilities of an output stream. +// It is currently assumed that all combination of listed parameters are supported. +// It is used by the policy manager to determine if an output is suitable for a given use case, +// open/close it accordingly and connect/disconnect audio tracks to/from it. +typedef struct output_profile_s { + uint32_t* mSamplingRates; // supported sampling rates (terminated by 0) + audio_channel_mask_t* mChannelMasks; // supported channel masks (terminated by 0) + audio_format_t* mFormats; // supported audio formats (terminated by 0) + audio_devices_t mSupportedDevices; // supported devices (devices this output can be + // routed to) + audio_policy_output_flags_t mFlags; // attribute flags (e.g primary output, + // direct output...) +} output_profile_t; + class AudioPolicyManagerBase: public AudioPolicyInterface #ifdef AUDIO_POLICY_TEST , public Thread @@ -70,7 +87,6 @@ public: virtual AudioSystem::device_connection_state getDeviceConnectionState(AudioSystem::audio_devices device, const char *device_address); virtual void setPhoneState(int state); - virtual void setRingerMode(uint32_t mode, uint32_t mask); virtual void setForceUse(AudioSystem::force_use usage, AudioSystem::forced_config config); virtual AudioSystem::forced_config getForceUse(AudioSystem::force_use usage); virtual void setSystemProperty(const char* property, const char* value); @@ -93,22 +109,28 @@ public: uint32_t format, uint32_t channels, AudioSystem::audio_in_acoustics acoustics); + // indicates to the audio policy manager that the input starts being used. virtual status_t startInput(audio_io_handle_t input); + // indicates to the audio policy manager that the input stops being used. virtual status_t stopInput(audio_io_handle_t input); virtual void releaseInput(audio_io_handle_t input); virtual void initStreamVolume(AudioSystem::stream_type stream, int indexMin, int indexMax); - virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, int index); - virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, int *index); + virtual status_t setStreamVolumeIndex(AudioSystem::stream_type stream, + int index, + audio_devices_t device); + virtual status_t getStreamVolumeIndex(AudioSystem::stream_type stream, + int *index, + audio_devices_t device); // return the strategy corresponding to a given stream type virtual uint32_t getStrategyForStream(AudioSystem::stream_type stream); // return the enabled output devices for the given stream type - virtual uint32_t getDevicesForStream(AudioSystem::stream_type stream); + virtual audio_devices_t getDevicesForStream(AudioSystem::stream_type stream); virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); virtual status_t registerEffect(effect_descriptor_t *desc, @@ -130,6 +152,7 @@ protected: STRATEGY_PHONE, STRATEGY_SONIFICATION, STRATEGY_DTMF, + STRATEGY_ENFORCED_AUDIBLE, NUM_STRATEGIES }; @@ -170,16 +193,17 @@ protected: class AudioOutputDescriptor { public: - AudioOutputDescriptor(); + AudioOutputDescriptor(const output_profile_t *profile); status_t dump(int fd); - uint32_t device(); + audio_devices_t device(); void changeRefCount(AudioSystem::stream_type, int delta); uint32_t refCount(); uint32_t strategyRefCount(routing_strategy strategy); bool isUsedByStrategy(routing_strategy strategy) { return (strategyRefCount(strategy) != 0);} bool isDuplicated() { return (mOutput1 != NULL && mOutput2 != NULL); } + audio_devices_t supportedDevices(); audio_io_handle_t mId; // output handle uint32_t mSamplingRate; // @@ -187,13 +211,14 @@ protected: uint32_t mChannels; // output configuration uint32_t mLatency; // AudioSystem::output_flags mFlags; // - uint32_t mDevice; // current device this output is routed to + audio_devices_t mDevice; // current device this output is routed to uint32_t mRefCount[AudioSystem::NUM_STREAM_TYPES]; // number of streams of each type using this output nsecs_t mStopTime[AudioSystem::NUM_STREAM_TYPES]; AudioOutputDescriptor *mOutput1; // used by duplicated outputs: first output AudioOutputDescriptor *mOutput2; // used by duplicated outputs: second output float mCurVolume[AudioSystem::NUM_STREAM_TYPES]; // current stream volume int mMuteCount[AudioSystem::NUM_STREAM_TYPES]; // mute request counter + const output_profile_t *mProfile; }; // descriptor for audio inputs. Used to maintain current configuration of each opened audio input @@ -209,23 +234,23 @@ protected: uint32_t mFormat; // input configuration uint32_t mChannels; // AudioSystem::audio_in_acoustics mAcoustics; // - uint32_t mDevice; // current device this input is routed to + audio_devices_t mDevice; // current device this input is routed to uint32_t mRefCount; // number of AudioRecord clients using this output - int mInputSource; // input source selected by application (mediarecorder.h) + int mInputSource; // input source selected by application (mediarecorder.h) }; // stream descriptor used for volume control class StreamDescriptor { public: - StreamDescriptor() - : mIndexMin(0), mIndexMax(1), mIndexCur(1), mCanBeMuted(true) {} + StreamDescriptor(); - void dump(char* buffer, size_t size); + int getVolumeIndex(audio_devices_t device); + void dump(int fd); int mIndexMin; // min volume index int mIndexMax; // max volume index - int mIndexCur; // current volume index + KeyedVector<audio_devices_t, int> mIndexCur; // current volume index per device bool mCanBeMuted; // true is the stream can be muted const VolumeCurvePoint *mVolumeCurve[DEVICE_CATEGORY_CNT]; @@ -249,6 +274,7 @@ protected: // return the strategy corresponding to a given stream type static routing_strategy getStrategy(AudioSystem::stream_type stream); + // return appropriate device for streams handled by the specified strategy according to current // phone state, connected devices... // if fromCache is true, the device is returned from mDeviceForStrategy[], otherwise it is determined @@ -259,65 +285,93 @@ protected: // "future" device selection (fromCache == false) when called from a context // where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND // before updateDeviceForStrategy() is called. - virtual uint32_t getDeviceForStrategy(routing_strategy strategy, bool fromCache = true); + virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy, bool fromCache = true); + // change the route of the specified output - void setOutputDevice(audio_io_handle_t output, uint32_t device, bool force = false, int delayMs = 0); + void setOutputDevice(audio_io_handle_t output, + audio_devices_t device, + bool force = false, + int delayMs = 0); + // select input device corresponding to requested audio source - virtual uint32_t getDeviceForInputSource(int inputSource); + virtual audio_devices_t getDeviceForInputSource(int inputSource); + // return io handle of active input or 0 if no input is active audio_io_handle_t getActiveInput(); + // initialize volume curves for each strategy and device category void initializeVolumeCurves(); + // compute the actual volume for a given stream according to the requested index and a particular // device - virtual float computeVolume(int stream, int index, audio_io_handle_t output, uint32_t device); + virtual float computeVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device); + // check that volume change is permitted, compute and send new volume to audio hardware - status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false); + status_t checkAndSetVolume(int stream, int index, audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false); + // apply all stream volumes to the specified output and device - void applyStreamVolumes(audio_io_handle_t output, uint32_t device, int delayMs = 0, bool force = false); + void applyStreamVolumes(audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false); + // Mute or unmute all streams handled by the specified strategy on the specified output void setStrategyMute(routing_strategy strategy, bool on, audio_io_handle_t output, int delayMs = 0); + // Mute or unmute the stream on the specified output void setStreamMute(int stream, bool on, audio_io_handle_t output, int delayMs = 0); + // handle special cases for sonification strategy while in call: mute streams or replace by // a special tone in the device used for communication void handleIncallSonification(int stream, bool starting, bool stateChange); + // true is current platform implements a back microphone virtual bool hasBackMicrophone() const { return false; } + // true if device is in a telephony or VoIP call virtual bool isInCall(); + // true if given state represents a device in a telephony or VoIP call virtual bool isStateInCall(int state); -#ifdef WITH_A2DP - // true is current platform supports suplication of notifications and ringtones over A2DP output - virtual bool a2dpUsedForSonification() const { return true; } - status_t handleA2dpConnection(AudioSystem::audio_devices device, - const char *device_address); - status_t handleA2dpDisconnection(AudioSystem::audio_devices device, - const char *device_address); - void closeA2dpOutputs(); - // checks and if necessary changes output (a2dp, duplicated or hardware) used for all strategies. - // must be called every time a condition that affects the output choice for a given strategy is - // changed: connected device, phone state, force use... + // when a device is connected, checks if an open output can be routed + // to this device. If none is open, tries to open one of the available outputs. + // Returns an output suitable to this device or 0. + // when a device is disconnected, checks if an output is not used any more and + // returns its handle if any. + // transfers the audio tracks and effects from one output thread to another accordingly. + audio_io_handle_t checkOutputForDevice(audio_devices_t device, + AudioSystem::device_connection_state state); + + // close an output and its companion duplicating output. + void closeOutput(audio_io_handle_t output); + + // checks and if necessary changes outputs used for all strategies. + // must be called every time a condition that affects the output choice for a given strategy + // changes: connected device, phone state, force use... // Must be called before updateDeviceForStrategy() void checkOutputForStrategy(routing_strategy strategy); + // Same as checkOutputForStrategy() but for a all strategies in order of priority void checkOutputForAllStrategies(); + // manages A2DP output suspend/restore according to phone state and BT SCO usage void checkA2dpSuspend(); -#endif + + // returns the A2DP output handle if it is open or 0 otherwise + audio_io_handle_t getA2dpOutput(); + // selects the most appropriate device on output for current state // must be called every time a condition that affects the device choice for a given output is // changed: connected device, phone state, force use, output start, output stop.. // see getDeviceForStrategy() for the use of fromCache parameter - uint32_t getNewDevice(audio_io_handle_t output, bool fromCache = true); + + audio_devices_t getNewDevice(audio_io_handle_t output, bool fromCache = true); // updates cache of device used by all strategies (mDeviceForStrategy[]) // must be called every time a condition that affects the device choice for a given strategy is // changed: connected device, phone state, force use... // cached values are used by getDeviceForStrategy() if parameter fromCache is true. // Must be called after checkOutputForAllStrategies() + void updateDeviceForStrategy(); + // true if current platform requires a specific output to be opened for this particular // set of parameters. This function is called by getOutput() and is implemented by platform // specific audio policy manager. @@ -327,6 +381,7 @@ protected: uint32_t channels, AudioSystem::output_flags flags, uint32_t device); + virtual uint32_t getMaxEffectsCpuLoad(); virtual uint32_t getMaxEffectsMemory(); #ifdef AUDIO_POLICY_TEST @@ -338,26 +393,29 @@ protected: status_t setEffectEnabled(EffectDescriptor *pDesc, bool enabled); // returns the category the device belongs to with regard to volume curve management - static device_category getDeviceCategory(uint32_t device); + static device_category getDeviceCategory(audio_devices_t device); - AudioPolicyClientInterface *mpClientInterface; // audio policy client interface - audio_io_handle_t mHardwareOutput; // hardware output handler - audio_io_handle_t mA2dpOutput; // A2DP output handler - audio_io_handle_t mDuplicatedOutput; // duplicated output handler: outputs to hardware and A2DP. + // extract one device relevant for volume control from multiple device selection + static audio_devices_t getDeviceForVolume(audio_devices_t device); + + SortedVector<audio_io_handle_t> getOutputsForDevice(audio_devices_t device); + bool vectorsEqual(SortedVector<audio_io_handle_t>& outputs1, + SortedVector<audio_io_handle_t>& outputs2); - KeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mOutputs; // list of output descriptors - KeyedVector<audio_io_handle_t, AudioInputDescriptor *> mInputs; // list of input descriptors - uint32_t mAvailableOutputDevices; // bit field of all available output devices + AudioPolicyClientInterface *mpClientInterface; // audio policy client interface + audio_io_handle_t mPrimaryOutput; // primary output handle + DefaultKeyedVector<audio_io_handle_t, AudioOutputDescriptor *> mOutputs; // list of output descriptors + DefaultKeyedVector<audio_io_handle_t, AudioInputDescriptor *> mInputs; // list of input descriptors + audio_devices_t mAvailableOutputDevices; // bit field of all available output devices uint32_t mAvailableInputDevices; // bit field of all available input devices int mPhoneState; // current phone state - uint32_t mRingerMode; // current ringer mode AudioSystem::forced_config mForceUse[AudioSystem::NUM_FORCE_USE]; // current forced use configuration StreamDescriptor mStreams[AudioSystem::NUM_STREAM_TYPES]; // stream descriptors for volume control String8 mA2dpDeviceAddress; // A2DP device MAC address String8 mScoDeviceAddress; // SCO device MAC address bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected - uint32_t mDeviceForStrategy[NUM_STRATEGIES]; + audio_devices_t mDeviceForStrategy[NUM_STRATEGIES]; float mLastVoiceVolume; // last voice volume value sent to audio HAL // Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units @@ -385,7 +443,7 @@ protected: #endif //AUDIO_POLICY_TEST private: - static float volIndexToAmpl(uint32_t device, const StreamDescriptor& streamDesc, + static float volIndexToAmpl(audio_devices_t device, const StreamDescriptor& streamDesc, int indexInUi); }; diff --git a/include/hardware_legacy/AudioSystemLegacy.h b/include/hardware_legacy/AudioSystemLegacy.h index 4b78f58..6d90896 100644 --- a/include/hardware_legacy/AudioSystemLegacy.h +++ b/include/hardware_legacy/AudioSystemLegacy.h @@ -332,10 +332,10 @@ public: return audio_is_low_visibility((audio_stream_type_t)stream); } static bool isValidFormat(uint32_t format) { - return audio_is_valid_format(format); + return audio_is_valid_format((audio_format_t) format); } static bool isLinearPCM(uint32_t format) { - return audio_is_linear_pcm(format); + return audio_is_linear_pcm((audio_format_t) format); } static bool isOutputChannel(uint32_t channel) { return audio_is_output_channel(channel); diff --git a/include/hardware_legacy/power.h b/include/hardware_legacy/power.h index b7cee43..26d04b2 100644 --- a/include/hardware_legacy/power.h +++ b/include/hardware_legacy/power.h @@ -33,9 +33,6 @@ enum { int acquire_wake_lock(int lock, const char* id); int release_wake_lock(const char* id); -// true if you want the screen on, false if you want it off -int set_screen_state(int on); - // set how long to stay awake after the last user activity in seconds int set_last_user_activity_timeout(int64_t delay); diff --git a/include/hardware_legacy/wifi.h b/include/hardware_legacy/wifi.h index 4166a6d..4d051e7 100644 --- a/include/hardware_legacy/wifi.h +++ b/include/hardware_legacy/wifi.h @@ -48,14 +48,7 @@ int is_wifi_driver_loaded(); * * @return 0 on success, < 0 on failure. */ -int wifi_start_supplicant(); - -/** - * Start supplicant for p2p operation. - * - * @return 0 on success, < 0 on failure. - */ -int wifi_start_p2p_supplicant(); +int wifi_start_supplicant(int p2pSupported); /** * Stop supplicant. @@ -65,24 +58,25 @@ int wifi_start_p2p_supplicant(); int wifi_stop_supplicant(); /** - * Open a connection to supplicant. + * Open a connection to supplicant on interface * * @return 0 on success, < 0 on failure. */ -int wifi_connect_to_supplicant(); +int wifi_connect_to_supplicant(const char *ifname); /** - * Close connection supplicant. + * Close connection to supplicant on interface * * @return 0 on success, < 0 on failure. */ -void wifi_close_supplicant_connection(); +void wifi_close_supplicant_connection(const char *ifname); /** * wifi_wait_for_event() performs a blocking call to * get a Wi-Fi event and returns a string representing * a Wi-Fi event when it occurs. * + * @param iface is the interface on which event is received * @param buf is the buffer that receives the event * @param len is the maximum length of the buffer * @@ -90,61 +84,19 @@ void wifi_close_supplicant_connection(); * event (for instance, no connection), and less than 0 * if there is an error. */ -int wifi_wait_for_event(char *buf, size_t len); +int wifi_wait_for_event(const char *iface, char *buf, size_t len); /** * wifi_command() issues a command to the Wi-Fi driver. * - * Android extends the standard commands listed at - * /link http://hostap.epitest.fi/wpa_supplicant/devel/ctrl_iface_page.html + * Android extends the standard commands listed at + * /link http://hostap.epitest.fi/wpa_supplicant/devel/ctrl_iface_page.html * to include support for sending commands to the driver: * - * <table border="2" cellspacing="2" cellpadding="2"> - * <tr> - * <td><strong>Command / Command summary</strong></td> - * <td><strong>Form of Response</strong></td> - * <td><strong>Processing</strong></td> - * </tr> - * <tr> - * <td>DRIVER START<BR> Turn on Wi-Fi Hardware</td> - * <td>OK if successful</td> - * <td>OK ? true : false</td> - * </tr> - * <tr> - * <td>DRIVER STOP<BR> Turn off Wi-Fi hardware</td> - * <td>OK if successful</td> - * <td>OK ? true : false</td> - * </tr> - * <tr> - * <td>DRIVER RSSI<BR> Return received signal strength indicator in -db for current AP</td> - * <td><ssid> Rssi xx</td> - * <td>%*s %*s %d", &rssi</td> - * </tr> - * <tr> - * <td>DRIVER LINKSPEED<BR> Return link speed in MBPS</td> - * <td>LinkSpeed xx</td> - * <td>%*s %d", &linkspd</td> - * </tr> - * <tr> - * <td>DRIVER MACADDR<BR> Return mac address of the station</td> - * <td>Macaddr = xx.xx.xx.xx.xx.xx</td> - * <td>"%*s = %s", &macadr</td> - * </tr> - * <tr> - * <td>DRIVER SCAN-ACTIVE<BR> Set scan type to active</td> - * <td>"OK" if successful</td> - * <td>"OK" ? true : false</td> - * </tr> - * <tr> - * <td>DRIVER SCAN-PASSIVE<BR> Set scan type to passive</td> - * <td>"OK" if successful</td> - * <td>"OK" ? true : false</td> - * </tr> - * </table> - * - * See libs/android_runtime/android_net_wifi_Wifi.cpp for more information - * describing how these and other commands are invoked. + * See wifi/java/android/net/wifi/WifiNative.java for the details of + * driver commands that are supported * + * @param iface is the interface on which command is sent * @param command is the string command * @param reply is a buffer to receive a reply string * @param reply_len on entry, this is the maximum length of @@ -153,7 +105,7 @@ int wifi_wait_for_event(char *buf, size_t len); * * @return 0 if successful, < 0 if an error. */ -int wifi_command(const char *command, char *reply, size_t *reply_len); +int wifi_command(const char *iface, const char *command, char *reply, size_t *reply_len); /** * do_dhcp_request() issues a dhcp request and returns the acquired |
