Lines Matching refs:index

96 	int index, i = 0, j = 0;  in lwm2m_gw_create()  local
99 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in lwm2m_gw_create()
100 if (inst[index].obj && inst[index].obj_inst_id == obj_inst_id) { in lwm2m_gw_create()
108 for (index = 0; index < MAX_INSTANCE_COUNT; index++) { in lwm2m_gw_create()
109 if (!inst[index].obj) { in lwm2m_gw_create()
114 if (index >= MAX_INSTANCE_COUNT) { in lwm2m_gw_create()
120 strncpy(device_table[index].device_id, CONFIG_LWM2M_GATEWAY_DEFAULT_DEVICE_ID, in lwm2m_gw_create()
122 snprintk(device_table[index].prefix, CONFIG_LWM2M_GATEWAY_PREFIX_MAX_STR_SIZE, in lwm2m_gw_create()
123 CONFIG_LWM2M_GATEWAY_DEFAULT_DEVICE_PREFIX "%u", index); in lwm2m_gw_create()
124 strncpy(device_table[index].iot_device_objects, in lwm2m_gw_create()
128 (void)memset(res[index], 0, sizeof(res[index][0]) * ARRAY_SIZE(res[index])); in lwm2m_gw_create()
129 init_res_instance(res_inst[index], ARRAY_SIZE(res_inst[index])); in lwm2m_gw_create()
132 INIT_OBJ_RES_DATA_LEN(LWM2M_GATEWAY_DEVICE_RID, res[index], i, res_inst[index], j, in lwm2m_gw_create()
133 device_table[index].device_id, in lwm2m_gw_create()
135 strlen(device_table[index].device_id) + 1); in lwm2m_gw_create()
136 INIT_OBJ_RES_LEN(LWM2M_GATEWAY_PREFIX_RID, res[index], i, res_inst[index], j, 1, false, in lwm2m_gw_create()
137 true, device_table[index].prefix, CONFIG_LWM2M_GATEWAY_PREFIX_MAX_STR_SIZE, in lwm2m_gw_create()
138 strlen(device_table[index].prefix) + 1, NULL, NULL, prefix_validation_cb, in lwm2m_gw_create()
140 INIT_OBJ_RES_DATA_LEN(LWM2M_GATEWAY_IOT_DEVICE_OBJECTS_RID, res[index], i, res_inst[index], in lwm2m_gw_create()
141 j, device_table[index].iot_device_objects, in lwm2m_gw_create()
142 sizeof(device_table[index].iot_device_objects), in lwm2m_gw_create()
143 strlen(device_table[index].iot_device_objects) + 1); in lwm2m_gw_create()
145 inst[index].resources = res[index]; in lwm2m_gw_create()
146 inst[index].resource_count = i; in lwm2m_gw_create()
148 return &inst[index]; in lwm2m_gw_create()
162 for (int index = 0; index < MAX_INSTANCE_COUNT; index++) { in lwm2m_gw_handle_req() local
164 if (!inst[index].obj) { in lwm2m_gw_handle_req()
168 char *prefix = device_table[index].prefix; in lwm2m_gw_handle_req()
178 if (gateway_msg_cb[index] == NULL) { in lwm2m_gw_handle_req()
186 return gateway_msg_cb[index](msg); in lwm2m_gw_handle_req()
193 for (int index = 0; index < MAX_INSTANCE_COUNT; index++) { in lwm2m_register_gw_callback() local
194 if (inst[index].obj_inst_id == obj_inst_id) { in lwm2m_register_gw_callback()
195 gateway_msg_cb[index] = cb; in lwm2m_register_gw_callback()