Qualcomm CSRmesh v2.1 Application 移植指南简介(六)

2.4.4 Mesh model handlers(网格模型处理程序)

    To make the applications more modular and to make the effort of inclusion of models much simpler the handling of models is done in the model handlers. The model handlers would initialize the models of the CSRmesh library as well as handle the events received from the models. The model handlers also share the data structure with the main application so that the data can be accessed by both.
    This section describes the application modifications required to include a model into the CSRmesh application code. First a new model supported flag needs to be defined in the user_config.h for inclusion of the model as shown in
Table 2-12.
    为了使应用程序更加模块化,并使模型包含的工作更简单,模型处理程序完成模型的处理。 模型处理程序将初始化CSRmesh库的模型以及处理从模型接收到的事件。 模型处理程序还与主应用程序共享数据结构,以便两者都可以访问数据。

     本节介绍将模型包含到CSRmesh应用程序代码中所需的应用程序修改。 首先需要在user_config.h中定义一个支持新模型的标志,以包含模型,如表2-12所示。

    There are certain instances where the events from the mesh models would need to be indicated to the application. This can be done by calling a predefined function as done in some models or by passing the mesh model events received along with the relevant data received from the model events. An example of calling a common function and passing the model events is shown in.

    在某些情况下,需要指示来自网格模型的事件到应用程序。 这可以通过在某些模型中调用预定义的函数来完成通过传递接收到的网格模型事件以及从模型接收到的相关数据事件。 显示调用通用函数和传递模型事件的示例。