This commit is contained in:
ioacademy-jikim
2018-06-15 17:07:15 +09:00
parent 931b702e82
commit b313330e0f
17 changed files with 296 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES = liblog libutils libhidlbase android.hardware.light@2.0
LOCAL_SRC_FILES := light_client.cpp
LOCAL_MODULE := light_client
include $(BUILD_EXECUTABLE)
+38
View File
@@ -0,0 +1,38 @@
#include <android-base/logging.h>
#include <android/hardware/light/2.0/ILight.h>
#include <android/hardware/light/2.0/types.h>
#include <set>
#include <unistd.h>
#include <stdio.h>
using ::android::hardware::light::V2_0::Brightness;
using ::android::hardware::light::V2_0::Flash;
using ::android::hardware::light::V2_0::ILight;
using ::android::hardware::light::V2_0::LightState;
using ::android::hardware::light::V2_0::Status;
using ::android::hardware::light::V2_0::Type;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;
const static LightState kWhite = {
.color = 0xFFFFFFFF,
.flashMode = Flash::TIMED,
.flashOnMs = 100,
.flashOffMs = 50,
.brightnessMode = Brightness::USER,
};
int main()
{
sp<ILight> light;
light = ILight::getService();
Return<Status> ret = light->setLight( Type::BACKLIGHT, kWhite);
//if( ret.isOk() == false )
// return -1;
//if( Status::SUCCESS == static_cast<Status>(ret) )
// return 0;
return 0;
}