Lines Matching refs:error
154 static void ot_joiner_start_handler(otError error, void *context) in ot_joiner_start_handler() argument
158 if (error != OT_ERROR_NONE) { in ot_joiner_start_handler()
159 LOG_ERR("Join failed [%d]", error); in ot_joiner_start_handler()
162 error = otThreadSetEnabled(openthread_instance, true); in ot_joiner_start_handler()
163 if (error != OT_ERROR_NONE) { in ot_joiner_start_handler()
164 LOG_ERR("Failed to start the OpenThread network [%d]", error); in ot_joiner_start_handler()
173 otError error = OT_ERROR_NONE; in ot_setup_default_configuration() local
175 error = otThreadSetNetworkName(openthread_instance, OT_NETWORK_NAME); in ot_setup_default_configuration()
176 if (error != OT_ERROR_NONE) { in ot_setup_default_configuration()
177 LOG_ERR("Failed to set %s [%d]", "network name", error); in ot_setup_default_configuration()
181 error = otLinkSetChannel(openthread_instance, OT_CHANNEL); in ot_setup_default_configuration()
182 if (error != OT_ERROR_NONE) { in ot_setup_default_configuration()
183 LOG_ERR("Failed to set %s [%d]", "channel", error); in ot_setup_default_configuration()
187 error = otLinkSetPanId(openthread_instance, OT_PANID); in ot_setup_default_configuration()
188 if (error != OT_ERROR_NONE) { in ot_setup_default_configuration()
189 LOG_ERR("Failed to set %s [%d]", "PAN ID", error); in ot_setup_default_configuration()
197 error = otThreadSetExtendedPanId(openthread_instance, &xpanid); in ot_setup_default_configuration()
198 if (error != OT_ERROR_NONE) { in ot_setup_default_configuration()
199 LOG_ERR("Failed to set %s [%d]", "ext PAN ID", error); in ot_setup_default_configuration()
209 error = otThreadSetNetworkKey(openthread_instance, &networkKey); in ot_setup_default_configuration()
210 if (error != OT_ERROR_NONE) { in ot_setup_default_configuration()
211 LOG_ERR("Failed to set %s [%d]", "network key", error); in ot_setup_default_configuration()
242 int error = k_work_submit_to_queue(&openthread_work_q, &openthread_work); in otTaskletsSignalPending() local
244 if (error < 0) { in otTaskletsSignalPending()
245 LOG_ERR("Failed to submit work to queue, error: %d", error); in otTaskletsSignalPending()
298 otError error = OT_ERROR_NONE; in openthread_init() local
325 error = otPlatUartEnable(); in openthread_init()
326 if (error != OT_ERROR_NONE) { in openthread_init()
327 LOG_ERR("Failed to enable UART: [%d]", error); in openthread_init()
350 error = otSetStateChangedCallback(openthread_instance, &ot_state_changed_handler, in openthread_init()
352 if (error != OT_ERROR_NONE) { in openthread_init()
353 LOG_ERR("Could not set state changed callback: %d", error); in openthread_init()
366 return error == OT_ERROR_NONE ? 0 : -EIO; in openthread_init()
372 otError error = OT_ERROR_NONE; in openthread_run() local
381 error = otIp6SetEnabled(openthread_instance, true); in openthread_run()
382 if (error != OT_ERROR_NONE) { in openthread_run()
383 LOG_ERR("Failed to set %s [%d]", "IPv6 support", error); in openthread_run()
396 error = otThreadSetLinkMode(openthread_instance, ot_mode); in openthread_run()
397 if (error != OT_ERROR_NONE) { in openthread_run()
398 LOG_ERR("Failed to set %s [%d]", "link mode", error); in openthread_run()
402 error = otLinkSetPollPeriod(openthread_instance, OT_POLL_PERIOD); in openthread_run()
403 if (error != OT_ERROR_NONE) { in openthread_run()
404 LOG_ERR("Failed to set %s [%d]", "poll period", error); in openthread_run()
425 error = otJoinerStart(openthread_instance, OT_JOINER_PSKD, NULL, in openthread_run()
429 if (error != OT_ERROR_NONE) { in openthread_run()
430 LOG_ERR("Failed to start joiner [%d]", error); in openthread_run()
446 error = otThreadSetEnabled(openthread_instance, true); in openthread_run()
447 if (error != OT_ERROR_NONE) { in openthread_run()
448 LOG_ERR("Failed to start the OpenThread network [%d]", error); in openthread_run()
455 return error == OT_ERROR_NONE ? 0 : -EIO; in openthread_run()
460 otError error = OT_ERROR_NONE; in openthread_stop() local
468 error = otThreadSetEnabled(openthread_instance, false); in openthread_stop()
469 if (error == OT_ERROR_INVALID_STATE) { in openthread_stop()
470 LOG_DBG("Openthread interface was not up [%d]", error); in openthread_stop()
513 int error = openthread_init(); in openthread_sys_init() local
515 if (error == 0) { in openthread_sys_init()
517 error = openthread_run(); in openthread_sys_init()
521 return error; in openthread_sys_init()