diff --git a/README.md b/README.md index fe90d5a778fc6d42d16ee02cde223641d6ec269d..cdada0161cb6edd825183f0b6342c1d4cfe847d3 100755 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ The sensor JS APIs listen for sensor data changes. If an API is called multiple 1. Import the sensor package. 2. Subscribe to and listen for data changes of an acceleration sensor. 3. Unsubscribe from data changes of the acceleration sensor. -4. Subscribe to and listen for a data change of a acceleration sensor. +4. Subscribe to and listen for a data change of an acceleration sensor. Example: diff --git a/frameworks/native/sensor/src/sensor_service_client.cpp b/frameworks/native/sensor/src/sensor_service_client.cpp index df26d269e3bcd3edfb2659d1a6bcbc1cd6d55779..4d41a198e82bf0a23d2e864b5b63d9eb8a05fc5b 100755 --- a/frameworks/native/sensor/src/sensor_service_client.cpp +++ b/frameworks/native/sensor/src/sensor_service_client.cpp @@ -209,7 +209,7 @@ void SensorServiceClient::ProcessDeathObserver(const wptr &object CALL_LOG_ENTER; (void)object; CHKPV(dataChannel_); - // STEP1 : Destroy revious data channel + // STEP1 : Destroy previous data channel dataChannel_->DestroySensorDataChannel(); // STEP2 : Restore data channel dataChannel_->RestoreSensorDataChannel(); diff --git a/frameworks/native/sensor/src/sensor_service_proxy.cpp b/frameworks/native/sensor/src/sensor_service_proxy.cpp index b0406b7a1ab6b066779538011780cffac1b1a41c..e7600b7de1318265db4e68860d13eecbabb0e500 100755 --- a/frameworks/native/sensor/src/sensor_service_proxy.cpp +++ b/frameworks/native/sensor/src/sensor_service_proxy.cpp @@ -65,7 +65,7 @@ ErrCode SensorServiceProxy::EnableSensor(uint32_t sensorId, int64_t samplingPeri int32_t ret = remote->SendRequest(ISensorService::ENABLE_SENSOR, data, reply, option); if (ret != NO_ERROR) { HiSysEvent::Write(HiSysEvent::Domain::SENSOR, "SENSOR_SERVICE_IPC_EXCEPTION", - HiSysEvent::EventType::FAULT, "PKG_NAME", "EnaleSensor", "ERROR_CODE", ret); + HiSysEvent::EventType::FAULT, "PKG_NAME", "EnableSensor", "ERROR_CODE", ret); SEN_HILOGE("failed, ret:%{public}d", ret); } return static_cast(ret); diff --git a/interfaces/native/include/sensor_agent_type.h b/interfaces/native/include/sensor_agent_type.h index 78479e4ed9b30879d7be9ad09b16d55c54f5c61d..f780e3e5e818aac4462df839dd6b713ac98a19c2 100644 --- a/interfaces/native/include/sensor_agent_type.h +++ b/interfaces/native/include/sensor_agent_type.h @@ -112,7 +112,7 @@ typedef struct SensorInfo { float precision; /**< Sensor accuracy */ float power; /**< Sensor power */ int64_t minSamplePeriod; /**< Minimum sample period allowed, in ns */ - int64_t maxSamplePeriod; /**< Maxmum sample period allowed, in ns */ + int64_t maxSamplePeriod; /**< Maximum sample period allowed, in ns */ } SensorInfo; /** diff --git a/interfaces/native/test/unittest/sensor_agent_test.cpp b/interfaces/native/test/unittest/sensor_agent_test.cpp index 4dc06b25735c79aa8be106cecacbd2711b45246d..412af3711de19502d9539f94a9ffd770d26a30bc 100755 --- a/interfaces/native/test/unittest/sensor_agent_test.cpp +++ b/interfaces/native/test/unittest/sensor_agent_test.cpp @@ -326,7 +326,7 @@ HWTEST_F(SensorAgentTest, SetModeTest_003, TestSize.Level1) * Function: SubscribeSensor * FunctionPoints: Check the interface function * EnvConditions: mobile that can run ohos test framework - * CaseDescription: Verify the senser service framework process. + * CaseDescription: Verify the sensor service framework process. */ HWTEST_F(SensorAgentTest, SensorNativeApiTest_001, TestSize.Level1) { @@ -361,7 +361,7 @@ HWTEST_F(SensorAgentTest, GetProcCpuUsageTest_001, TestSize.Level1) const std::string process_name = "sensors"; auto usage = cpuInfo.GetProcCpuUsage(process_name); SEN_HILOGD("The CPU usage of the %{public}s process is %{public}.2f", process_name.c_str(), usage); - ASSERT_TRUE(usage < SYSTEM_INFO::CPU_USAGE_LOAD && usage != SYSTEM_INFO::CPU_USAGE_UNKONW); + ASSERT_TRUE(usage < SYSTEM_INFO::CPU_USAGE_LOAD && usage != SYSTEM_INFO::CPU_USAGE_UNKNOWN); } /* @@ -369,7 +369,7 @@ HWTEST_F(SensorAgentTest, GetProcCpuUsageTest_001, TestSize.Level1) * Function: GetAllSensors * FunctionPoints: Check the interface function * EnvConditions: mobile that can run ohos test framework - * CaseDescription: Verify the senser service framework process. + * CaseDescription: Verify the sensor service framework process. */ HWTEST_F(SensorAgentTest, SensorListTest_001, TestSize.Level1) { diff --git a/interfaces/plugin/src/sensor_js.cpp b/interfaces/plugin/src/sensor_js.cpp index c87bb402b5c270b25c7cc5f51f19247e3c2ae99d..fd0d3985d6e7b8716bd4ee03f8bd4269eaf37702 100644 --- a/interfaces/plugin/src/sensor_js.cpp +++ b/interfaces/plugin/src/sensor_js.cpp @@ -40,7 +40,7 @@ constexpr int32_t INVALID_SENSOR_ID = -1; constexpr int32_t SENSOR_SUBSCRIBE_FAILURE = 1001; constexpr int32_t INPUT_ERROR = 202; constexpr float BODY_STATE_EXCEPT = 1.0f; -constexpr float THREESHOLD = 0.000001f; +constexpr float THRESHOLD = 0.000001f; } static std::map g_samplingPeriod = { {"normal", 200000000}, @@ -77,7 +77,7 @@ static bool copySensorData(sptr callbackInfo, SensorEvent *ev std::lock_guard onBodyLock(bodyMutex_); g_bodyState = *data; callbackInfo->data.sensorData.data[0] = - (fabs(g_bodyState - BODY_STATE_EXCEPT) < THREESHOLD) ? true : false; + (fabs(g_bodyState - BODY_STATE_EXCEPT) < THRESHOLD) ? true : false; return true; } if (memcpy_s(callbackInfo->data.sensorData.data, event->dataLen, data, event->dataLen) != EOK) { @@ -1212,7 +1212,7 @@ napi_value GetBodyState(napi_env env, napi_callback_info info) "register success callback fail"); std::lock_guard onBodyLock(bodyMutex_); asyncCallbackInfo->data.sensorData.data[0] = - (fabs(g_bodyState - BODY_STATE_EXCEPT) < THREESHOLD) ? true : false; + (fabs(g_bodyState - BODY_STATE_EXCEPT) < THRESHOLD) ? true : false; EmitUvEventLoop(asyncCallbackInfo); return nullptr; } diff --git a/interfaces/plugin/src/sensor_napi_utils.cpp b/interfaces/plugin/src/sensor_napi_utils.cpp index 4ee5a4b4ff068f6ba302e37211268e213201df33..3a29492b1bf9c8e3f04519bf6b0d44a04ab40df3 100644 --- a/interfaces/plugin/src/sensor_napi_utils.cpp +++ b/interfaces/plugin/src/sensor_napi_utils.cpp @@ -318,8 +318,8 @@ bool ConvertToSensorData(const napi_env &env, sptr asyncCallb return ConvertToBodyData(env, asyncCallbackInfo, result); } size_t size = g_sensorAttributeList[sensorTypeId].size(); - uint32_t dataLenth = asyncCallbackInfo->data.sensorData.dataLength / sizeof(float); - CHKNCF(env, (size <= dataLenth), "Data length mismatch"); + uint32_t dataLength = asyncCallbackInfo->data.sensorData.dataLength / sizeof(float); + CHKNCF(env, (size <= dataLength), "Data length mismatch"); CHKNRF(env, napi_create_object(env, &result[1]), "napi_create_object"); napi_value message = nullptr; @@ -434,7 +434,7 @@ void EmitAsyncCallbackWork(sptr asyncCallbackInfo) sptr asyncCallbackInfo(static_cast(data)); /** * After the asynchronous task is created, the asyncCallbackInfo reference count is reduced - * to 0 destructions, so you need to add 1 to the asyncCallbackInfo reference count when the + * to 0 destruction, so you need to add 1 to the asyncCallbackInfo reference count when the * asynchronous task is created, and subtract 1 from the reference count after the naked * pointer is converted to a pointer when the asynchronous task is executed, the reference * count of the smart pointer is guaranteed to be 1. @@ -494,7 +494,7 @@ void EmitUvEventLoop(sptr asyncCallbackInfo) DeleteWork(work); /** * After the asynchronous task is created, the asyncCallbackInfo reference count is reduced - * to 0 destructions, so you need to add 1 to the asyncCallbackInfo reference count when the + * to 0 destruction, so you need to add 1 to the asyncCallbackInfo reference count when the * asynchronous task is created, and subtract 1 from the reference count after the naked * pointer is converted to a pointer when the asynchronous task is executed, the reference * count of the smart pointer is guaranteed to be 1. @@ -554,7 +554,7 @@ void EmitPromiseWork(sptr asyncCallbackInfo) sptr asyncCallbackInfo(static_cast(data)); /** * After the asynchronous task is created, the asyncCallbackInfo reference count is reduced - * to 0 destructions, so you need to add 1 to the asyncCallbackInfo reference count when the + * to 0 destruction, so you need to add 1 to the asyncCallbackInfo reference count when the * asynchronous task is created, and subtract 1 from the reference count after the naked * pointer is converted to a pointer when the asynchronous task is executed, the reference * count of the smart pointer is guaranteed to be 1. diff --git a/interfaces/plugin/test/unittest/ExampleJsunit.test.js b/interfaces/plugin/test/unittest/ExampleJsunit.test.js index 3ab3807c9233f15f752c173507ef308428fa2a46..aa037534a8cb383cf149f82bf19e146c481ab20d 100755 --- a/interfaces/plugin/test/unittest/ExampleJsunit.test.js +++ b/interfaces/plugin/test/unittest/ExampleJsunit.test.js @@ -2052,7 +2052,7 @@ describe("SensorJsTest", function () { ] /* * @tc.name: Sensor_CreateRotationMatrix_012 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -2076,7 +2076,7 @@ describe("SensorJsTest", function () { /* * tc.name: Sensor_CreateRotationMatrix_013 - * tc.desc: Verfication results of the incorrect parameters of test interface. + * tc.desc: Verification results of the incorrect parameters of test interface. * tc.require: SR000GH2A2 * @tc.author: */ @@ -2098,7 +2098,7 @@ describe("SensorJsTest", function () { /* * tc.name: Sensor_CreateRotationMatrix_014 - * tc.desc: Verfication results of the incorrect parameters of test interface. + * tc.desc: Verification results of the incorrect parameters of test interface. * tc.require: I5SWJI * @tc.author: */ @@ -2758,17 +2758,17 @@ describe("SensorJsTest", function () { ] /* - * @tc.name: Sensor_CreateQuaterniont_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_001 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_001', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_001 start') + it('Sensor_CreateQuaternion_001', 0,async function (done) { + console.info('Sensor_CreateQuaternion_001 start') sensor.getQuaternion([0.52, -0.336, -0.251], (error, data) =>{ - console.info('Sensor_CreateQuaterniont_001' + 'lengh:' + data.length); + console.info('Sensor_CreateQuaternion_001' + 'length:' + data.length); if (error) { - console.info('Sensor_CreateQuaterniont_001 failed'); + console.info('Sensor_CreateQuaternion_001 failed'); expect(false).assertTrue(); } else { for (var i = 0; i < data.length; i++) { @@ -2781,16 +2781,16 @@ describe("SensorJsTest", function () { }) /* - * @tc.name: Sensor_CreateQuaterniont_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_002 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_002', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_002 start') + it('Sensor_CreateQuaternion_002', 0,async function (done) { + console.info('Sensor_CreateQuaternion_002 start') sensor.getQuaternion([3.40282e+38, 3.40282e+38, 3.40282e+38], (error, data) =>{ if (error) { - console.info('Sensor_CreateQuaterniont_002 failed'); + console.info('Sensor_CreateQuaternion_002 failed'); expect(false).assertTrue(); } else { for (var i = 0; i < data.length; i++) { @@ -2803,16 +2803,16 @@ describe("SensorJsTest", function () { }) /* - * @tc.name: Sensor_CreateQuaterniont_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_003 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_003', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_003 start') + it('Sensor_CreateQuaternion_003', 0,async function (done) { + console.info('Sensor_CreateQuaternion_003 start') sensor.getQuaternion([0, 0, 0], (error, data) =>{ if (error) { - console.info('Sensor_CreateQuaterniont_003 failed'); + console.info('Sensor_CreateQuaternion_003 failed'); expect(false).assertTrue(); } else { for (var i = 0; i < data.length; i++) { @@ -2822,20 +2822,20 @@ describe("SensorJsTest", function () { } done() }) - console.info("Sensor_CreateQuaterniont_003 end") + console.info("Sensor_CreateQuaternion_003 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_004 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_004', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_004 start') + it('Sensor_CreateQuaternion_004', 0,async function (done) { + console.info('Sensor_CreateQuaternion_004 start') sensor.getQuaternion([-0.325, -0.562, -0.25], (error, data) =>{ if (error) { - console.info('Sensor_CreateQuaterniont_004 failed'); + console.info('Sensor_CreateQuaternion_004 failed'); expect(false).assertTrue(); } else { for (var i = 0; i < data.length; i++) { @@ -2845,17 +2845,17 @@ describe("SensorJsTest", function () { } done() }) - console.info("Sensor_CreateQuaterniont_004 end") + console.info("Sensor_CreateQuaternion_004 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_005 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_005 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_005', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_005 start') + it('Sensor_CreateQuaternion_005', 0,async function (done) { + console.info('Sensor_CreateQuaternion_005 start') try { sensor.getQuaternion([0.25, 0.14], (error, data) =>{ if (error) { @@ -2870,19 +2870,19 @@ describe("SensorJsTest", function () { expect(err.message).assertEqual(PARAMETER_ERROR_MSG) done() } - console.info("Sensor_CreateQuaterniont_005 end") + console.info("Sensor_CreateQuaternion_005 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_006 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_006 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_006', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_006 start') + it('Sensor_CreateQuaternion_006', 0,async function (done) { + console.info('Sensor_CreateQuaternion_006 start') sensor.getQuaternion([0.52, -0.336, -0.251]).then((data) => { - console.info('Sensor_CreateQuaterniont_006'); + console.info('Sensor_CreateQuaternion_006'); for (var i = 0; i < data.length; i++) { console.info("data[" + i + "]: " + data[i]); expect(data[i]).assertEqual(result[0][i]) @@ -2893,20 +2893,20 @@ describe("SensorJsTest", function () { console.info('promise failed') done() }) - console.info("Sensor_CreateQuaterniont_006 end") + console.info("Sensor_CreateQuaternion_006 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_007 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_007 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_007', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_007 start') + it('Sensor_CreateQuaternion_007', 0,async function (done) { + console.info('Sensor_CreateQuaternion_007 start') try { sensor.getQuaternion([0, 0]).then((data) => { - console.info('Sensor_CreateQuaterniont_007'); + console.info('Sensor_CreateQuaternion_007'); expect(false).assertTrue(); done() }, (error) => { @@ -2919,19 +2919,19 @@ describe("SensorJsTest", function () { expect(err.message).assertEqual(PARAMETER_ERROR_MSG) done() } - console.info("Sensor_CreateQuaterniont_007 end") + console.info("Sensor_CreateQuaternion_007 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_008 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_008 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_008', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_008 start') + it('Sensor_CreateQuaternion_008', 0,async function (done) { + console.info('Sensor_CreateQuaternion_008 start') sensor.getQuaternion([0, 0, 0]).then((data) => { - console.info('Sensor_CreateQuaterniont_008'); + console.info('Sensor_CreateQuaternion_008'); for (var i = 0; i < data.length; i++) { console.info("data[" + i + "]: " + data[i]); expect(data[i]).assertEqual(result[2][i]) @@ -2942,19 +2942,19 @@ describe("SensorJsTest", function () { console.info('promise failed') done() }) - console.info("Sensor_CreateQuaterniont_008 end") + console.info("Sensor_CreateQuaternion_008 end") }) /* - * @tc.name: Sensor_CreateQuaterniont_009 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_009 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_009', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_009 start') + it('Sensor_CreateQuaternion_009', 0,async function (done) { + console.info('Sensor_CreateQuaternion_009 start') sensor.getQuaternion([-0.325, -0.562, -0.25]).then((data) => { - console.info('Sensor_CreateQuaterniont_009'); + console.info('Sensor_CreateQuaternion_009'); for (var i = 0; i < data.length; i++) { console.info("data[" + i + "]: " + data[i]); expect(data[i]).assertEqual(result[3][i]) @@ -2968,16 +2968,16 @@ describe("SensorJsTest", function () { }) /* - * @tc.name: Sensor_CreateQuaterniont_010 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.name: Sensor_CreateQuaternion_010 + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2RP * @tc.author: */ - it('Sensor_CreateQuaterniont_010', 0,async function (done) { - console.info('Sensor_CreateQuaterniont_010 start') + it('Sensor_CreateQuaternion_010', 0,async function (done) { + console.info('Sensor_CreateQuaternion_010 start') try { sensor.getQuaternion([0.25, 0.14]).then((data) => { - console.info('Sensor_CreateQuaterniont_010'); + console.info('Sensor_CreateQuaternion_010'); expect(false).assertTrue(); done() },(error) => { @@ -2995,12 +2995,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_011 + * @tc.name: Sensor_CreateQuaternion_011 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_011', 0, async function (done) { + it('Sensor_CreateQuaternion_011', 0, async function (done) { try { sensor.createQuaternion() } catch (err) { @@ -3013,12 +3013,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_012 + * @tc.name: Sensor_CreateQuaternion_012 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_012', 0, async function (done) { + it('Sensor_CreateQuaternion_012', 0, async function (done) { try { sensor.createQuaternion(-1) } catch (err) { @@ -3031,12 +3031,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_013 + * @tc.name: Sensor_CreateQuaternion_013 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_013', 0, async function (done) { + it('Sensor_CreateQuaternion_013', 0, async function (done) { try { sensor.createQuaternion([0.52, -0.336, -0.251], -1) } catch (err) { @@ -3049,12 +3049,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_014 + * @tc.name: Sensor_CreateQuaternion_014 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_014', 0, async function (done) { + it('Sensor_CreateQuaternion_014', 0, async function (done) { try { sensor.createQuaternion().then((data) => { expect(true).assertfalse() @@ -3073,12 +3073,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_015 + * @tc.name: Sensor_CreateQuaternion_015 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_015', 0, async function (done) { + it('Sensor_CreateQuaternion_015', 0, async function (done) { try { sensor.createQuaternion(-1).then((data) => { expect(true).assertfalse() @@ -3097,12 +3097,12 @@ describe("SensorJsTest", function () { /* * test * - * @tc.name: Sensor_CreateQuaterniont_016 + * @tc.name: Sensor_CreateQuaternion_016 * @tc.desc: Verification results of the incorrect parameters of the test interface. * @tc.require: I5SWJI * @tc.author: */ - it('Sensor_CreateQuaterniont_016', 0, async function (done) { + it('Sensor_CreateQuaternion_016', 0, async function (done) { try { sensor.createQuaternion([0.52, -0.336, -0.251], -1).then((data) => { expect(true).assertfalse() @@ -3122,7 +3122,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetGeomagneticDip_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3137,14 +3137,14 @@ describe("SensorJsTest", function () { expect(data).assertEqual(getGeomagneticDipResult[0]) } done() - console.info('Sensor_GetGeomagneticDip_001' + 'lengh:' + data.length); + console.info('Sensor_GetGeomagneticDip_001' + 'length:' + data.length); }) console.info("Sensor_GetGeomagneticDip_001 end") }) /* * @tc.name: Sensor_GetGeomagneticDip_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3169,7 +3169,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetGeomagneticDip_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3188,7 +3188,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetGeomagneticDip_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3204,7 +3204,7 @@ describe("SensorJsTest", function () { expect(data).assertEqual(getGeomagneticDipResult[0]) } done() - console.info('Sensor_GetGeomagneticDip_004' + 'lengh:' + data.length); + console.info('Sensor_GetGeomagneticDip_004' + 'length:' + data.length); }) } catch(error) { console.info(error); @@ -3217,7 +3217,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetGeomagneticDip_005 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3243,7 +3243,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetGeomagneticDip_006 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3269,7 +3269,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3290,7 +3290,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3311,7 +3311,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3329,7 +3329,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2OG * @tc.author: */ @@ -3347,7 +3347,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_005 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3366,7 +3366,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_006 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3382,7 +3382,7 @@ describe("SensorJsTest", function () { expect(data).assertEqual(getGeomagneticDipResult[0]) } done() - console.info('Sensor_GetAltitude_006' + 'lengh:' + data.length); + console.info('Sensor_GetAltitude_006' + 'length:' + data.length); }) } catch(error) { console.info(error); @@ -3395,7 +3395,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_007 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3421,7 +3421,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetAltitude_008 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3454,7 +3454,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3474,7 +3474,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3494,7 +3494,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3515,7 +3515,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3536,7 +3536,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_005 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3555,7 +3555,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_006 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3583,7 +3583,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_007 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3609,7 +3609,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_008 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3635,7 +3635,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_009 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3661,7 +3661,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_TransformCoordinateSystem_010 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: I5SWJI * @tc.author: */ @@ -3689,7 +3689,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSensorList_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3711,7 +3711,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSensorList_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3734,7 +3734,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSensorList_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3752,7 +3752,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSensorList_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3779,7 +3779,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSingleSensor_001 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3800,7 +3800,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSingleSensor_002 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3828,7 +3828,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSingleSensor_003 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ @@ -3847,7 +3847,7 @@ describe("SensorJsTest", function () { /* * @tc.name: Sensor_GetSingleSensor_004 - * @tc.desc: Verfication results of the incorrect parameters of test interface. + * @tc.desc: Verification results of the incorrect parameters of test interface. * @tc.require: AR000GH2TR * @tc.author: */ diff --git a/services/sensor/src/sensor_data_processer.cpp b/services/sensor/src/sensor_data_processer.cpp index f2c1daaa1210146dac45353794ff2fcb335ae9cd..466cd693c0e6733b180fb34bc7fac4b0a3ec7eca 100644 --- a/services/sensor/src/sensor_data_processer.cpp +++ b/services/sensor/src/sensor_data_processer.cpp @@ -41,9 +41,9 @@ enum { constexpr uint32_t SENSOR_INDEX_SHIFT = 8; constexpr uint32_t SENSOR_TYPE_SHIFT = 16; -constexpr uint32_t SENSOR_CATAGORY_SHIFT = 24; +constexpr uint32_t SENSOR_CATEGORY_SHIFT = 24; -constexpr uint32_t FLUSH_COMPLETE_ID = ((uint32_t)OTHER << SENSOR_CATAGORY_SHIFT) | +constexpr uint32_t FLUSH_COMPLETE_ID = ((uint32_t)OTHER << SENSOR_CATEGORY_SHIFT) | ((uint32_t)SENSOR_TYPE_FLUSH << SENSOR_TYPE_SHIFT) | ((uint32_t)FIRST_INDEX << SENSOR_INDEX_SHIFT); } // namespace diff --git a/services/sensor/src/sensor_service.cpp b/services/sensor/src/sensor_service.cpp index c25ac318e99130a9bec2ad46abc7d6f31ca4a9f7..377e739d17c3192f2d7b5fe9c2811395f87c53b5 100644 --- a/services/sensor/src/sensor_service.cpp +++ b/services/sensor/src/sensor_service.cpp @@ -366,8 +366,8 @@ ErrCode SensorService::DestroySensorChannel(sptr sensorClient) return CLIENT_PID_INVALID_ERR; } std::lock_guard serviceLock(serviceLock_); - bool destoryRet = clientInfo_.DestroySensorChannel(clientPid); - if (!destoryRet) { + bool destroyRet = clientInfo_.DestroySensorChannel(clientPid); + if (!destroyRet) { SEN_HILOGE("DestroySensorChannel is failed"); return DESTROY_SENSOR_CHANNEL_ERR; } @@ -386,12 +386,12 @@ void SensorService::ProcessDeathObserver(const wptr &object) SEN_HILOGE("pid is -1"); return; } - SEN_HILOGI("pid is %{pubilc}d", pid); + SEN_HILOGI("pid is %{public}d", pid); std::vector activeSensors = clientInfo_.GetSensorIdByPid(pid); for (size_t i = 0; i < activeSensors.size(); ++i) { int32_t ret = DisableSensor(activeSensors[i], pid); if (ret != ERR_OK) { - SEN_HILOGE("disablesensor failed, ret:%{pubilc}d", ret); + SEN_HILOGE("disablesensor failed, ret:%{public}d", ret); } } clientInfo_.DestroySensorChannel(pid); diff --git a/services/sensor/src/sensor_service_stub.cpp b/services/sensor/src/sensor_service_stub.cpp index bed7a011e211b46817073be3ed2477cebf20ca01..554843f2f27157912924e4b6545b2ef996ff8c17 100644 --- a/services/sensor/src/sensor_service_stub.cpp +++ b/services/sensor/src/sensor_service_stub.cpp @@ -77,7 +77,11 @@ int32_t SensorServiceStub::OnRemoteRequest(uint32_t code, MessageParcel &data, M ErrCode SensorServiceStub::SensorEnableInner(MessageParcel &data, MessageParcel &reply) { (void)reply; - uint32_t sensorId = data.ReadUint32(); + uint32_t sensorId; + if (!data.ReadUint32(sensorId)) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } PermissionUtil &permissionUtil = PermissionUtil::GetInstance(); int32_t ret = permissionUtil.CheckSensorPermission(GetCallingTokenID(), sensorId); if (ret != PERMISSION_GRANTED) { @@ -86,13 +90,23 @@ ErrCode SensorServiceStub::SensorEnableInner(MessageParcel &data, MessageParcel SEN_HILOGE("sensorId:%{public}u grant failed,result:%{public}d", sensorId, ret); return PERMISSION_DENIED; } - return EnableSensor(sensorId, data.ReadInt64(), data.ReadInt64()); + int64_t samplingPeriodNs; + int64_t maxReportDelayNs; + if ((!data.ReadInt64(samplingPeriodNs)) || (!data.ReadInt64(maxReportDelayNs))) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } + return EnableSensor(sensorId, samplingPeriodNs, maxReportDelayNs); } ErrCode SensorServiceStub::SensorDisableInner(MessageParcel &data, MessageParcel &reply) { (void)reply; - uint32_t sensorId = data.ReadUint32(); + uint32_t sensorId; + if (!data.ReadUint32(sensorId)) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } PermissionUtil &permissionUtil = PermissionUtil::GetInstance(); int32_t ret = permissionUtil.CheckSensorPermission(GetCallingTokenID(), sensorId); if (ret != PERMISSION_GRANTED) { @@ -107,7 +121,11 @@ ErrCode SensorServiceStub::SensorDisableInner(MessageParcel &data, MessageParcel ErrCode SensorServiceStub::GetSensorStateInner(MessageParcel &data, MessageParcel &reply) { (void)reply; - uint32_t sensorId = data.ReadUint32(); + uint32_t sensorId; + if (!data.ReadUint32(sensorId)) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } PermissionUtil &permissionUtil = PermissionUtil::GetInstance(); int32_t ret = permissionUtil.CheckSensorPermission(GetCallingTokenID(), sensorId); if (ret != PERMISSION_GRANTED) { @@ -122,7 +140,11 @@ ErrCode SensorServiceStub::GetSensorStateInner(MessageParcel &data, MessageParce ErrCode SensorServiceStub::RunCommandInner(MessageParcel &data, MessageParcel &reply) { (void)reply; - uint32_t sensorId = data.ReadUint32(); + uint32_t sensorId; + if (!data.ReadUint32(sensorId)) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } PermissionUtil &permissionUtil = PermissionUtil::GetInstance(); int32_t ret = permissionUtil.CheckSensorPermission(GetCallingTokenID(), sensorId); if (ret != PERMISSION_GRANTED) { @@ -131,7 +153,13 @@ ErrCode SensorServiceStub::RunCommandInner(MessageParcel &data, MessageParcel &r SEN_HILOGE("sensorId:%{public}u grant failed,result:%{public}d", sensorId, ret); return PERMISSION_DENIED; } - return RunCommand(sensorId, data.ReadUint32(), data.ReadUint32()); + uint32_t cmdType; + uint32_t params; + if ((!data.ReadUint32(cmdType)) || (!data.ReadUint32(params))) { + SEN_HILOGE("Parcel read failed"); + return ERROR; + } + return RunCommand(sensorId, cmdType, params); } ErrCode SensorServiceStub::GetAllSensorsInner(MessageParcel &data, MessageParcel &reply) diff --git a/services/sensor/src/sensor_suspend_policy.cpp b/services/sensor/src/sensor_suspend_policy.cpp index 217e25400b86fc58a93063c824e6f6db0e60c39d..1e9f2444062ab558b0b26e8d8a023caf417cc843 100644 --- a/services/sensor/src/sensor_suspend_policy.cpp +++ b/services/sensor/src/sensor_suspend_policy.cpp @@ -27,10 +27,10 @@ namespace { constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorSuspendPolicy" }; constexpr uint32_t INVALID_SENSOR_ID = -1; constexpr int64_t MAX_EVENT_COUNT = 1000; -constexpr int64_t DEFAULT_SAMPLEING_RATE = 200000000; +constexpr int64_t DEFAULT_SAMPLING_RATE = 200000000; constexpr int64_t DEFAULT_REPORT_DELAY = 0; constexpr uint32_t STEP_COUNTER_ID = 524544; -constexpr uint32_t STEP_DETECOTR_ID = 590080; +constexpr uint32_t STEP_DETECTOR_ID = 590080; } // namespace SensorSuspendPolicy::~SensorSuspendPolicy() @@ -38,7 +38,7 @@ SensorSuspendPolicy::~SensorSuspendPolicy() bool SensorSuspendPolicy::CheckFreezingSensor(uint32_t sensorId) { - return ((sensorId == STEP_COUNTER_ID) || (sensorId == STEP_DETECOTR_ID)); + return ((sensorId == STEP_COUNTER_ID) || (sensorId == STEP_DETECTOR_ID)); } ErrCode SensorSuspendPolicy::DisableSensor(uint32_t sensorId, int32_t pid) @@ -150,7 +150,7 @@ std::vector SensorSuspendPolicy::GetSensorIdByPid(int32_t pid) void SensorSuspendPolicy::DoActive(const std::shared_ptr &info) { CALL_LOG_ENTER; - int64_t samplePeriod = DEFAULT_SAMPLEING_RATE; + int64_t samplePeriod = DEFAULT_SAMPLING_RATE; int64_t maxReportDelay = DEFAULT_REPORT_DELAY; std::vector sensorIdList; std::lock_guard suspendLock(suspendMutex_); diff --git a/test/unittest/common/include/system_info.h b/test/unittest/common/include/system_info.h index a3ad5de74d5db04960fc44b3d1d99fb9a677c126..a26dd47c01c10c3639debb4dabadfde467d1c33d 100755 --- a/test/unittest/common/include/system_info.h +++ b/test/unittest/common/include/system_info.h @@ -21,7 +21,7 @@ namespace OHOS { namespace Sensors { namespace SYSTEM_INFO { -static constexpr double CPU_USAGE_UNKONW = -1.0; +static constexpr double CPU_USAGE_UNKNOWN = -1.0; static constexpr double CPU_USAGE_LOAD = 20.0; static constexpr double CPU_USAGE_MAX = 100.0; class SystemInfo { diff --git a/test/unittest/common/src/system_info.cpp b/test/unittest/common/src/system_info.cpp index f21a27ccc692ec0b483493464034f8c8cec5119f..0142c928799304c32518cba3d31e0be376fc2648 100755 --- a/test/unittest/common/src/system_info.cpp +++ b/test/unittest/common/src/system_info.cpp @@ -195,14 +195,14 @@ double CpuInfo::GetSystemCpuUsage() int32_t ret = GetSystemCpuStatInfo(first); if (ret != OHOS::Sensors::SUCCESS) { SEN_HILOGE("Failed to obtain CPU information, errcode:%{public}d", ret); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_OP)); Total_Cpu_Occupy second {}; ret = GetSystemCpuStatInfo(second); if (ret != OHOS::Sensors::SUCCESS) { SEN_HILOGE("Failed to obtain CPU information, errcode:%{public}d", ret); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } return GetCpuUsage(first, second); @@ -229,22 +229,22 @@ double CpuInfo::GetProcCpuUsage(const std::string& process_name) if ((totalTime1 = GetSystemTotalOccupy()) == OHOS::Sensors::ERROR) { SEN_HILOGE("Failed to obtain CPU occupy"); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } if ((procTime1 = GetProcOccupy(pid)) == OHOS::Sensors::ERROR) { SEN_HILOGE("Failed to obtain process CPU information"); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } std::this_thread::sleep_for(std::chrono::milliseconds(TIME_WAIT_FOR_OP)); if ((totalTime2 = GetSystemTotalOccupy()) == OHOS::Sensors::ERROR) { SEN_HILOGE("Failed to obtain CPU occupy"); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } if ((procTime2 = GetProcOccupy(pid)) == OHOS::Sensors::ERROR) { SEN_HILOGE("Failed to obtain process CPU information"); - return CPU_USAGE_UNKONW; + return CPU_USAGE_UNKNOWN; } return CHK_RATE(CPU_USAGE_MAX * (procTime2 - procTime1) / (totalTime2 - totalTime1)); diff --git a/utils/include/miscdevice_common.h b/utils/include/miscdevice_common.h index 9932d560ab22cd7ab571f70b3e648905835637f4..ad742270fe9868c8cc5c96b3dde794825667a283 100755 --- a/utils/include/miscdevice_common.h +++ b/utils/include/miscdevice_common.h @@ -21,7 +21,7 @@ namespace OHOS { namespace Sensors { -// These LightId correspand to logical lights +// These LightId correspond to logical lights enum LightId { LIGHT_ID_LED = 0, LIGHT_ID_KEYBOARD, diff --git a/utils/include/report_data_callback.h b/utils/include/report_data_callback.h index 608e9a7bb06a50986ca8d40ca01b36e8b925732e..c7c6fa3794180bd82f5ea13378f640cbd2287f7f 100644 --- a/utils/include/report_data_callback.h +++ b/utils/include/report_data_callback.h @@ -22,7 +22,7 @@ namespace OHOS { namespace Sensors { constexpr int32_t CIRCULAR_BUF_LEN = 1024; -constexpr int32_t SENSOR_DATA_LENGHT = 64; +constexpr int32_t SENSOR_DATA_LENGTH = 64; struct CircularEventBuf { struct SensorData *circularBuf; diff --git a/utils/include/sensor_catalog.h b/utils/include/sensor_catalog.h index 5856f6d5ea99b927e7404cc7cbe3bd8e901312fa..37b70458b52254606c82880795cbc5c967df9696 100755 --- a/utils/include/sensor_catalog.h +++ b/utils/include/sensor_catalog.h @@ -82,7 +82,7 @@ enum GroupBody { }; struct SensorCombination { - SensorGroup sensorCatagory; + SensorGroup sensorCategory; uint8_t sensorType; uint8_t sensorIndex; }; diff --git a/utils/include/sensors_errors.h b/utils/include/sensors_errors.h index 7c20589372b5d7b240138e20a6b3bf177a422ae7..7279ab75070f9f809c369118db7f28cb298906bc 100644 --- a/utils/include/sensors_errors.h +++ b/utils/include/sensors_errors.h @@ -93,7 +93,7 @@ enum { REGIST_CALLBACK_ERR = SET_SENSOR_OPTION_ERR + 1, }; -// Error code for Sensor uitls +// Error code for Sensor utils constexpr ErrCode SENSOR_UTILS_ERR_OFFSET = ErrCodeOffset(SUBSYS_SENSORS, MODULE_SENSORS_UTILS); enum { SENSOR_CHANNEL_SOCKET_CREATE_ERR = SENSOR_UTILS_ERR_OFFSET,