MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / create_data_connection

Method create_data_connection

src/board_controller/emotibit/emotibit.cpp:720–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718}
719
720int Emotibit::create_data_connection ()
721{
722 int res = (int)BrainFlowExitCodes::BOARD_NOT_READY_ERROR;
723 for (int i = 2; i < 40; i += 2)
724 {
725 data_port = WIFI_ADVERTISING_PORT + i;
726 data_socket = new SocketClientUDP (ip_address.c_str (), data_port);
727 if (data_socket->bind () == ((int)SocketClientUDPReturnCodes::STATUS_OK))
728 {
729 safe_logger (spdlog::level::info, "use port {} for data", data_port);
730 res = (int)BrainFlowExitCodes::STATUS_OK;
731 break;
732 }
733 else
734 {
735 safe_logger (spdlog::level::warn, "failed to bind to {}", data_port);
736 }
737 data_socket->close ();
738 delete data_socket;
739 data_socket = NULL;
740 }
741 return res;
742}
743
744int Emotibit::create_control_connection ()
745{

Callers

nothing calls this directly

Calls 2

bindMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected