How to make not mesh application based on HCI Control but stand-alone?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PICH_4397076
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

Dear,,,All

I'm testing cypress mesh solution the below environment.

-. KIT : CYBT-213043-MESH

-. IDE : ModusToolbox 1.1

-. BT SDK 1.4

-. Code Example : Download BT SDK 1.4 example from GIT

-. Test : mesh location client / server among snip folder in code example.

The mesh code examples provided by cypress are example codes based on the HCI control command.

But, I need stand-alone example code for my mesh application.

Question 1 : Could you provide me with an example for a stand-alone type mesh application that I mean?

(Additional, I need an example code to receive a provisioning from remote (ex, client control android app))

I'm trying to replace the HCI control-based example code provided by Cypress with the stand-alone example I'm talking about.i

In this process, I have the following questions.

From the mesh_location_client.c file of the mesh location code example, I can see "mesh_app_proc_rx_cmd" function.

In this function, I can see "wiced_bt_mesh_create_event_from_wiced_hci" function.

But,The "wiced_bt_mesh_create_event_from_wiced_hci" fucntion be calloed with HCI controlled command.

Because I have to make the stand-alone mesh application, I can call "wiced_bt_mesh_create_event" function instead of "wiced_bt_mesh_create_event_from_wiced_hci" function

if necessary.

Question 2 : For stand-alone project, If I need to call "wiced_bt_mesh_create_event" function directly, how can I put app_key_idx among the function argument?

(For reference, in the case of the HIC controll method, the value of the command packet is parsed and inserted)

Question 3: In case of "wiced_bt_mesh_create_event" function, I can the description below.

But, I can not understand fully about the function call.

Please explain in detail so that I can understand???

===========================================================================================================================

/**

* \brief Create mesh event for an unsolicited message.

* \details In case dst is 0 the function takes all information from the model's publication or fails if publication is not configured for the specified model.

* In case non-0 dst the function uses specified dst and app_key_idx and fills all other fields with default values.

* In special case with company_id equals to 0xffff the function creates a message event with default ttl.

*

* @param       element_index   Element index.

* @param       company_id      Company ID.

* @param       model_id        Model ID.

* @param       dst             Destination address. If parameter is 0, the function finds publication and take uses its fields for the mesh event.

* @param       app_key_idx     Global app key index. The parameter is ignored if dst is equal to 0. The 0xffff means device key.

*

* @return      p_event Pointer to a newly allocated mesh event.

*/

wiced_bt_mesh_event_t *wiced_bt_mesh_create_event(uint8_t element_index, uint16_t company_id, uint16_t model_id, uint16_t dst, uint16_t app_key_idx);

=============================================================================================================================

Question 4: In order to make my desired stand alone mesh application, after provisioning the device, the device should store the provisioning information in internal flash memory. Is it right?

How can I get provisioning information if needed?

If I call the "wiced_bt_mesh_create_event" function, I need the app_key_idx value after provisioning.

Thanks,

Best Regards,

Pilheon

0 Likes
1 Solution
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi Pilheon,

I did not understand the real meaning of "Standalone mesh Application". Could you please provide me the actual requirement of it?

You can get implementation of mesh models from snip/mesh applications. And demo/mesh applications are complete demonstration of the model/feature. But both these applications are capable of receiving and sending mesh messages through HCI as well as over mesh.

I would suggest you to go through the below demo/mesh applications to understand the end application.

Please have a look at,

1.on_off_switch (based on mesh_onoff_client) and

2.light_dimmable (based on mesh_light_lightness_server).

You need a provisioner (MeshClient (WIN10), Android, IOS) to provision this client and server devices into the mesh network, and, provisioner will take care of the entire database of the network (MeshClient application generates networkname.JSON).

When you use above two mesh applications and MehClient (Hosted on Windows OS) as provisioner, then all the communications are happening over mesh only. While provisioning provisioner shares necessary keys and indexes with the application and it stores in it.

Also you can go through the code of mesh_provision_client which is an implementation of multiple clients including configuration_client.

Useful documents:

Getting Started with Bluetooth Mesh

MeshClient and ClientControlMesh App User Guide

Thanks,

-Dheeraj

View solution in original post

0 Likes
4 Replies
PICH_4397076
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

The stand-alone type mesh application requested in question 1 of the previous question is for the mesh location client and the mesh location server.

0 Likes
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi Pilheon,

I did not understand the real meaning of "Standalone mesh Application". Could you please provide me the actual requirement of it?

You can get implementation of mesh models from snip/mesh applications. And demo/mesh applications are complete demonstration of the model/feature. But both these applications are capable of receiving and sending mesh messages through HCI as well as over mesh.

I would suggest you to go through the below demo/mesh applications to understand the end application.

Please have a look at,

1.on_off_switch (based on mesh_onoff_client) and

2.light_dimmable (based on mesh_light_lightness_server).

You need a provisioner (MeshClient (WIN10), Android, IOS) to provision this client and server devices into the mesh network, and, provisioner will take care of the entire database of the network (MeshClient application generates networkname.JSON).

When you use above two mesh applications and MehClient (Hosted on Windows OS) as provisioner, then all the communications are happening over mesh only. While provisioning provisioner shares necessary keys and indexes with the application and it stores in it.

Also you can go through the code of mesh_provision_client which is an implementation of multiple clients including configuration_client.

Useful documents:

Getting Started with Bluetooth Mesh

MeshClient and ClientControlMesh App User Guide

Thanks,

-Dheeraj

0 Likes

Dear Dheeraj,,,

For your reference, I'm already looking at useful documents you recommended.

I hoped to find the location server and client code example, just like the other examples in demo / application.

However, since I only searched the location server and client example in snip / application.

From the mesh_location_client.c file of the mesh location code example in snip/application, I can see "mesh_app_proc_rx_cmd" function.

Without "mesh_app_proc_rx_cmd" function,  I'm going to create and take a test any mesh communication between mesh location client and server.

In the process, I have the following question.

From the mesh_location_client.c file of the mesh location client code example, I can see "mesh_app_proc_rx_cmd" function.

In this function, I can see "wiced_bt_mesh_create_event_from_wiced_hci" function.

To use without "mesh_app_proc_rx_cmd" function, I'm going to call "wiced_bt_mesh_create_event" function instead of "wiced_bt_mesh_create_event_from_wiced_hci" function.

Question 1 : To call "wiced_bt_mesh_create_event" function directly, how can I put app_key_idx among the function argument?

(For reference, in the case of using "mesh_app_proc_rx_cmd" function, the value of the command packet is parsed and inserted)sk

Question 2: In case of "wiced_bt_mesh_create_event" function, I can see the description below at API reference.

But, I can not understand fully about this function.

Please explain in detail so that I can understand???

===========================================================================================================================

/**

* \brief Create mesh event for an unsolicited message.

* \details In case dst is 0 the function takes all information from the model's publication or fails if publication is not configured for the specified model.

* In case non-0 dst the function uses specified dst and app_key_idx and fills all other fields with default values.

* In special case with company_id equals to 0xffff the function creates a message event with default ttl.

*

* @param      element_index  Element index.

* @param      company_id      Company ID.

* @param      model_id        Model ID.

* @param      dst            Destination address. If parameter is 0, the function finds publication and take uses its fields for the mesh event.

* @param      app_key_idx    Global app key index. The parameter is ignored if dst is equal to 0. The 0xffff means device key.

*

* @return      p_event Pointer to a newly allocated mesh event.

*/

wiced_bt_mesh_event_t *wiced_bt_mesh_create_event(uint8_t element_index, uint16_t company_id, uint16_t model_id, uint16_t dst, uint16_t app_key_idx);

=============================================================================================================================

Question 3: after provisioning the device, the device should store the provisioning information in internal flash memory. Is it right?

Which function call can I get provisioning information if necessary?

0 Likes