| 444 | } |
| 445 | |
| 446 | int MuseAthena::stop_stream () |
| 447 | { |
| 448 | if (muse_peripheral == NULL) |
| 449 | { |
| 450 | return (int)BrainFlowExitCodes::BOARD_NOT_CREATED_ERROR; |
| 451 | } |
| 452 | int res = (int)BrainFlowExitCodes::STATUS_OK; |
| 453 | if (is_streaming) |
| 454 | { |
| 455 | res = config_board ("h"); |
| 456 | if (res != (int)BrainFlowExitCodes::STATUS_OK) |
| 457 | { |
| 458 | bool is_connected = false; |
| 459 | if ((simpleble_peripheral_is_connected (muse_peripheral, &is_connected) == |
| 460 | SIMPLEBLE_SUCCESS) && |
| 461 | (!is_connected)) |
| 462 | { |
| 463 | safe_logger (spdlog::level::warn, |
| 464 | "MuseAthena device is already disconnected during stop_stream"); |
| 465 | res = (int)BrainFlowExitCodes::STATUS_OK; |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | else |
| 470 | { |
| 471 | res = (int)BrainFlowExitCodes::STREAM_ALREADY_RUN_ERROR; |
| 472 | } |
| 473 | is_streaming = false; |
| 474 | reset_timestamps (); |
| 475 | return res; |
| 476 | } |
| 477 | |
| 478 | int MuseAthena::release_session () |
| 479 | { |
nothing calls this directly
no test coverage detected