static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)

{

    struct bt_device_s *slave;

    evt_remote_name_req_complete params;

    int len;



    for (slave = hci->device.net->slave; slave; slave = slave->next)

        if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))

            break;

    if (!slave)

        return -ENODEV;



    bt_hci_event_status(hci, HCI_SUCCESS);



    params.status       = HCI_SUCCESS;

    bacpy(&params.bdaddr, &slave->bd_addr);

    len = snprintf(params.name, sizeof(params.name),

                    "%s", slave->lmp_name ?: "");

    memset(params.name + len, 0, sizeof(params.name) - len);

    bt_hci_event(hci, EVT_REMOTE_NAME_REQ_COMPLETE,

                    &params, EVT_REMOTE_NAME_REQ_COMPLETE_SIZE);



    return 0;

}

static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)

{

    struct bt_device_s *slave;

    evt_remote_name_req_complete params;

    int len;



    for (slave = hci->device.net->slave; slave; slave = slave->next)

        if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))

            break;

    if (!slave)

        return -ENODEV;



    bt_hci_event_status(hci, HCI_SUCCESS);



    params.status       = HCI_SUCCESS;

    bacpy(&params.bdaddr, &slave->bd_addr);

    len = snprintf(params.name, sizeof(params.name),

                    "%s", slave->lmp_name ?: "");

    memset(params.name + len, 0, sizeof(params.name) - len);

    bt_hci_event(hci, EVT_REMOTE_NAME_REQ_COMPLETE,

                    &params, EVT_REMOTE_NAME_REQ_COMPLETE_SIZE);



    return 0;

}

    int len;     len = snprintf(params.name, sizeof(params.name),                     "%s", slave->lmp_name ?: "");     memset(params.name + len, 0, sizeof(params.name) - len);
static int FUNC_0(struct bt_hci_s *VAR_0, bdaddr_t *VAR_1)

{

    struct bt_device_s *VAR_2;

    evt_remote_name_req_complete params;

    int VAR_3;



    for (VAR_2 = VAR_0->device.net->VAR_2; VAR_2; VAR_2 = VAR_2->next)

        if (VAR_2->page_scan && !bacmp(&VAR_2->bd_addr, VAR_1))

            break;

    if (!VAR_2)

        return -ENODEV;



    bt_hci_event_status(VAR_0, HCI_SUCCESS);



    params.status       = HCI_SUCCESS;

    bacpy(&params.VAR_1, &VAR_2->bd_addr);

    VAR_3 = snprintf(params.name, sizeof(params.name),

                    "%s", VAR_2->lmp_name ?: "");

    memset(params.name + VAR_3, 0, sizeof(params.name) - VAR_3);

    bt_hci_event(VAR_0, EVT_REMOTE_NAME_REQ_COMPLETE,

                    &params, EVT_REMOTE_NAME_REQ_COMPLETE_SIZE);



    return 0;

}

static int FUNC_0(struct bt_hci_s *VAR_0, bdaddr_t *VAR_1)
{ struct bt_device_s *VAR_2; evt_remote_name_req_complete params; int VAR_3; for (VAR_2 = VAR_0->device.net->VAR_2; VAR_2; VAR_2 = VAR_2->next) if (VAR_2->page_scan && !bacmp(&VAR_2->bd_addr, VAR_1))
break; if (!VAR_2)
return -ENODEV; bt_hci_event_status(VAR_0, HCI_SUCCESS); params.status       = HCI_SUCCESS; bacpy(&params.VAR_1, &VAR_2->bd_addr); VAR_3 = snprintf(params.name, sizeof(params.name),
"%s", VAR_2->lmp_name ?: ""); memset(params.name + VAR_3, 0, sizeof(params.name) - VAR_3); bt_hci_event(VAR_0, EVT_REMOTE_NAME_REQ_COMPLETE,
&params, EVT_REMOTE_NAME_REQ_COMPLETE_SIZE); return 0; }