From 542a11b42b294cfd1fcebc88c8ea37b21b207085 Mon Sep 17 00:00:00 2001 From: Connor O'Brien Date: Mon, 19 Dec 2016 15:55:12 -0800 Subject: [PATCH] Remove length arg from transmit() in IR HAL The length argument is not necessary since the pattern is passed to transmit() as a hidl_vec, so remove it. Test: Built and called new transmit() function. Change-Id: I4bee4557c2cca6562a43df5e22a7d6b846f20bb4 Signed-off-by: Connor O'Brien --- ir/1.0/IConsumerIr.hal | 2 +- ir/1.0/default/ConsumerIr.cpp | 4 ++-- ir/1.0/default/ConsumerIr.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ir/1.0/IConsumerIr.hal b/ir/1.0/IConsumerIr.hal index f928c0ecd6..f9e6316008 100644 --- a/ir/1.0/IConsumerIr.hal +++ b/ir/1.0/IConsumerIr.hal @@ -28,7 +28,7 @@ interface IConsumerIr { * * returns: true on success, false on error. */ - transmit(int32_t carrierFreq, vec pattern, int32_t patternLen) generates (bool success); + transmit(int32_t carrierFreq, vec pattern) generates (bool success); /* * getCarrierFreqs() enumerates which frequencies the IR transmitter supports. diff --git a/ir/1.0/default/ConsumerIr.cpp b/ir/1.0/default/ConsumerIr.cpp index 763e09a157..8cfb2e8716 100644 --- a/ir/1.0/default/ConsumerIr.cpp +++ b/ir/1.0/default/ConsumerIr.cpp @@ -32,8 +32,8 @@ ConsumerIr::ConsumerIr(consumerir_device_t *device) { } // Methods from ::android::hardware::consumerir::V1_0::IConsumerIr follow. -Return ConsumerIr::transmit(int32_t carrierFreq, const hidl_vec& pattern, int32_t patternLen) { - return mDevice->transmit(mDevice, carrierFreq, pattern.data(), patternLen) == 0; +Return ConsumerIr::transmit(int32_t carrierFreq, const hidl_vec& pattern) { + return mDevice->transmit(mDevice, carrierFreq, pattern.data(), pattern.size()) == 0; } Return ConsumerIr::getCarrierFreqs(getCarrierFreqs_cb _hidl_cb) { diff --git a/ir/1.0/default/ConsumerIr.h b/ir/1.0/default/ConsumerIr.h index 527c5772ee..1532183a53 100644 --- a/ir/1.0/default/ConsumerIr.h +++ b/ir/1.0/default/ConsumerIr.h @@ -40,7 +40,7 @@ using ::android::sp; struct ConsumerIr : public IConsumerIr { ConsumerIr(consumerir_device_t *device); // Methods from ::android::hardware::ir::V1_0::IConsumerIr follow. - Return transmit(int32_t carrierFreq, const hidl_vec& pattern, int32_t patternLen) override; + Return transmit(int32_t carrierFreq, const hidl_vec& pattern) override; Return getCarrierFreqs(getCarrierFreqs_cb _hidl_cb) override; private: consumerir_device_t *mDevice;