Reference to implement BLE-Mesh Large object (BLOB) transfer

Hi,

I need to transfer BLOB object upto 350kb through BLE-Mesh.

I saw the breakup of nCS that zephyr implements Mesh protocol layers, and nordic stack implements mesh application layer.

But i couldn't find how I could implement large object transfer via mesh.

Kindly suggest how to implement BLOB transfer & also suggest a sample nCS code to do the same.

Thanks,

Ubaid

  • Hello ,


    I will have to get back to you on this next week.

    Kindly suggest on handlers for Client TX of 100 bytes & server RX of 100 bytes.

    Please suggest as per the pseudo-code below:
    Server RX:

    #In prj.conf
    CONFIG_BT_MESH_RX_SEG_MAX=20
    
    //OPcode defn
    #define BT_MESH_RX_100_OP_MESSAGE BT_MESH_MODEL_OP_3( 0x0A , BT_MESH_VENDOR_COMPANY_ID )
    
    #define BT_MESH_PAYLOAD_GET_LEN 100
    static char centLoad[100]= {0};
    const struct bt_mesh_model_op _bt_mesh_vendor_srv_op[] = {
    	{BT_MESH_RX_100_OP_MESSAGE,
    	 BT_MESH_LEN_EXACT( BT_MESH_PAYLOAD_GET_LEN ),
    	 handle_rx100B},
    	 	BT_MESH_MODEL_OP_END,
    };
    
    
    //100bytes rx handler
    static int handle_rx100B( struct bt_mesh_model* model, struct bt_mesh_msg_ctx* ctx, struct net_buf_simple* buf )
    {
        struct bt_mesh_vendor_srv* srv = model->user_data;
        centLoad = net_buf_simple_pull_mem( buf, buf->len ); //buf->len is initialized to 100 from the opcode len definition right..? //
        return ( 0 );
    }
    
    
    
    

    Kindly suggest on this server pseudo code
    And please help me with client handler TX 100 bytes code for this server.

    Thanks,

    Ubaid

  • Hello Ubaid,

    I haven't had the time to test this, but it looks good. 

    For transmitting, if you are using the chat example as a starting point, you could:

    - Edit the shell commands in SHELL_STATIC_SUBCMD_SET_CREATE to create one for starting your transfer.

    - Make a shell command function similar to cmd_message, that also split your file into chunks of a 100 Bytes.

    - Make a version of bt_mesh_chat_cli_message_send that uses your own opcodes to send the message.

    Regards,

    Elfving

Related