最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android v, I want to send two data to the framework - Stack Overflow

programmeradmin3浏览0评论

in android v, I want to send two data to the framework. such as proximity,i need to send two data to the framework. In previous versions,We modify it in the hardware: in hardware/interfaces / sensors/1.0/default/convert.cpp in convertFromSensorEvent function: convertFromSensorEvent {

    case SensorType::PROXIMITY: {
    dst->u.data[0] = src.data[0];
        dst->u.data[1] = src.data[1];
        break;
    }

}

in convertToSensorEvent function: convertToSensorEvent { case SensorType::PROXIMITY:{ dst->data[0] = src.u.data[0]; dst->data[1] = src.u.data[1]; break; }

but in android v, in hardware ,This modification method doesn't work. If aidl is used instead of hidl, and two values ​​need to be passed to the hardware, what should the hardware do?

I tried modifying the file in aidl, convert.cpp

in convertFromSensorEvent function:

convertFromSensorEvent
{ 
    case SensorType::PROXIMITY:
         Event::EventPayload::Data data;
         memcpy(data.values.data(), src.data, 2 * sizeof(float));
        dst->payload.set<Event::EventPayload::Tag::data>(data);
        break;
}

in convertToSensorEvent function: convertToSensorEvent { case SensorType::PROXIMITY: memcpy(dst->data, src.payload.getEvent::EventPayload::data().values.data(), 16 * sizeof(float)); break; }

This modification will cause the machine to restart.

发布评论

评论列表(0)

  1. 暂无评论