Lines Matching refs:attrs
705 int ble_stack_gatt_registe_service(gatt_service *s, gatt_attr_t attrs[], uint16_t attr_num) in ble_stack_gatt_registe_service() argument
717 if (attrs == NULL || attr_num == 0) { in ble_stack_gatt_registe_service()
722 ss->attrs = (struct bt_gatt_attr *)attrs; in ble_stack_gatt_registe_service()
725 … if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_PRIMARY) || UUID_EQUAL(attrs[i].uuid, UUID_GATT_SECONDARY) in ble_stack_gatt_registe_service()
726 || UUID_EQUAL(attrs[i].uuid, UUID_GATT_INCLUDE)) { in ble_stack_gatt_registe_service()
727 ss->attrs[i].read = bt_gatt_attr_read_service; in ble_stack_gatt_registe_service()
728 } else if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_CHRC)) { in ble_stack_gatt_registe_service()
733 ss->attrs[i].read = bt_gatt_attr_read_chrc; in ble_stack_gatt_registe_service()
734 ss->attrs[i + 1].read = gatt_read_handle; in ble_stack_gatt_registe_service()
735 ss->attrs[i + 1].write = gatt_write_handle; in ble_stack_gatt_registe_service()
737 } else if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_CCC)) { in ble_stack_gatt_registe_service()
739 val = (struct _bt_gatt_ccc *)(attrs[i].user_data); in ble_stack_gatt_registe_service()
743 ss->attrs[i].perm = GATT_PERM_READ | GATT_PERM_WRITE; in ble_stack_gatt_registe_service()
744 ss->attrs[i].read = bt_gatt_attr_read_ccc; in ble_stack_gatt_registe_service()
745 ss->attrs[i].write = bt_gatt_attr_write_ccc; in ble_stack_gatt_registe_service()
746 ss->attrs[i].user_data = val; in ble_stack_gatt_registe_service()
747 } else if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_CEP)) { in ble_stack_gatt_registe_service()
748 ss->attrs[i].read = bt_gatt_attr_read_cep; in ble_stack_gatt_registe_service()
749 } else if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_CUD)) { in ble_stack_gatt_registe_service()
750 ss->attrs[i].read = gatt_read_handle; in ble_stack_gatt_registe_service()
751 ss->attrs[i].write = gatt_write_handle; in ble_stack_gatt_registe_service()
752 } else if (UUID_EQUAL(attrs[i].uuid, UUID_GATT_CPF)) { in ble_stack_gatt_registe_service()
753 ss->attrs[i].read = bt_gatt_attr_read_cpf; in ble_stack_gatt_registe_service()
755 ss->attrs[i].read = gatt_read_handle; in ble_stack_gatt_registe_service()
756 ss->attrs[i].write = gatt_write_handle; in ble_stack_gatt_registe_service()
766 return ss->attrs[0].handle; in ble_stack_gatt_registe_service()