Loading ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -35,5 +35,5 @@ package android.hardware.ir; @VintfStability interface IConsumerIr { android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs(); void transmit(in int carrierFreq, in int[] pattern); void transmit(in int carrierFreqHz, in int[] pattern); } ir/aidl/android/hardware/ir/IConsumerIr.aidl +7 −9 Original line number Diff line number Diff line Loading @@ -23,23 +23,21 @@ interface IConsumerIr { /** * Enumerates which frequencies the IR transmitter supports. * * Status OK (EX_NONE) on success. * * @return - an array of all supported frequency ranges. */ ConsumerIrFreqRange[] getCarrierFreqs(); /** * Sends an IR pattern at a given frequency in HZ. * This call must return when the transmit is complete or encounters an error. * * The pattern is alternating series of carrier on and off periods measured in * microseconds. The carrier should be turned off at the end of a transmit * even if there are and odd number of entries in the pattern array. * @param carrierFreq - Frequency of the transmission in HZ. * * This call must return when the transmit is complete or encounters an error. * @param pattern - Alternating series of on and off periods measured in * microseconds. The carrier should be turned off at the end of a transmit * even if there are an odd number of entries in the pattern array. * * Status OK (EX_NONE) on success. * EX_UNSUPPORTED_OPERATION when the frequency is not supported. * @throws EX_UNSUPPORTED_OPERATION when the frequency is not supported. */ void transmit(in int carrierFreq, in int[] pattern); void transmit(in int carrierFreqHz, in int[] pattern); } ir/aidl/default/main.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ const std::vector<ConsumerIrFreqRange> kSupportedFreqs = { class ConsumerIr : public BnConsumerIr { ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override; ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq, ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) override; }; Loading @@ -46,9 +46,9 @@ bool isSupportedFreq(int32_t freq) { return false; } ::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq, ::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) { if (isSupportedFreq(in_carrierFreq)) { if (isSupportedFreq(in_carrierFreqHz)) { // trasmit the pattern, each integer is number of microseconds in an // alternating on/off state. usleep(std::accumulate(in_pattern.begin(), in_pattern.end(), 0)); Loading Loading
ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -35,5 +35,5 @@ package android.hardware.ir; @VintfStability interface IConsumerIr { android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs(); void transmit(in int carrierFreq, in int[] pattern); void transmit(in int carrierFreqHz, in int[] pattern); }
ir/aidl/android/hardware/ir/IConsumerIr.aidl +7 −9 Original line number Diff line number Diff line Loading @@ -23,23 +23,21 @@ interface IConsumerIr { /** * Enumerates which frequencies the IR transmitter supports. * * Status OK (EX_NONE) on success. * * @return - an array of all supported frequency ranges. */ ConsumerIrFreqRange[] getCarrierFreqs(); /** * Sends an IR pattern at a given frequency in HZ. * This call must return when the transmit is complete or encounters an error. * * The pattern is alternating series of carrier on and off periods measured in * microseconds. The carrier should be turned off at the end of a transmit * even if there are and odd number of entries in the pattern array. * @param carrierFreq - Frequency of the transmission in HZ. * * This call must return when the transmit is complete or encounters an error. * @param pattern - Alternating series of on and off periods measured in * microseconds. The carrier should be turned off at the end of a transmit * even if there are an odd number of entries in the pattern array. * * Status OK (EX_NONE) on success. * EX_UNSUPPORTED_OPERATION when the frequency is not supported. * @throws EX_UNSUPPORTED_OPERATION when the frequency is not supported. */ void transmit(in int carrierFreq, in int[] pattern); void transmit(in int carrierFreqHz, in int[] pattern); }
ir/aidl/default/main.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ const std::vector<ConsumerIrFreqRange> kSupportedFreqs = { class ConsumerIr : public BnConsumerIr { ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override; ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq, ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) override; }; Loading @@ -46,9 +46,9 @@ bool isSupportedFreq(int32_t freq) { return false; } ::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq, ::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreqHz, const std::vector<int32_t>& in_pattern) { if (isSupportedFreq(in_carrierFreq)) { if (isSupportedFreq(in_carrierFreqHz)) { // trasmit the pattern, each integer is number of microseconds in an // alternating on/off state. usleep(std::accumulate(in_pattern.begin(), in_pattern.end(), 0)); Loading