Topic

FAQ
Login Register
I have a question about TLSR825x.
Dec 20, 2022 09:46

/

A

/A

hello~.
I have a question about TLSR825x. Please reply.


1) Is "device address" and "slave_p_mac" different?

2) The value of "slave_p_mac" changes each time a program is written.
    How do I not change this?

4) Is the "device address" unique for every device?

/////////////////// set and get mac by mesh  //////////////////////
u8get_mac_en = 1;      // no use in library

intdev_addr_with_mac_flag(u8 *params)
{
    return (DEV_ADDR_PAR_WITH_MAC == params[2]);
}

intdev_addr_with_mac_match(u8 *params)
{
    if((params[0] == 0xff)&&(params[1] == 0xff)){   // get
        returnget_mac_en;
    }else{                                          // set
        return (!memcmp(params+4, slave_p_mac, 6));
    }
}

intdev_addr_with_mac_rsp(u8 *params, u8 *par_rsp)
{
    if(dev_addr_with_mac_match(params)){
        dual_mode_set_adv_provisoning_flag();
       
        memcpy(par_rsp, &device_address, 2);
        memcpy(par_rsp + 2, slave_p_mac, 6);
        memcpy(par_rsp + 8, &adv_rsp_pri_data.ProductUUID, 2);
        return1;
    }
    return0;
}


1 replies
TL_Soyo Dec 20, 2022 11:37
0
/A

Hi,

  1、device address is used for communication between each node,slave_p_mac is mac address

  2、If you dont erase ,the mac wont change

  3、device address is unique in one mesh network.