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

Method call_open

src/board_controller/neuromd/brainbit_bled.cpp:89–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89int BrainBitBLED::call_open ()
90{
91 if (dll_loader == NULL)
92 {
93 return (int)BrainFlowExitCodes::BOARD_NOT_READY_ERROR;
94 }
95 int res = (int)BrainFlowExitCodes::GENERAL_ERROR;
96 if (use_mac_addr)
97 {
98 int (*func) (void *) = (int (*) (void *))dll_loader->get_address ("open_device_mac_addr");
99 if (func == NULL)
100 {
101 safe_logger (
102 spdlog::level::err, "failed to get function address for open_device_mac_addr");
103 return (int)BrainFlowExitCodes::GENERAL_ERROR;
104 }
105 safe_logger (spdlog::level::info, "search for {}", params.mac_address.c_str ());
106 res = func (const_cast<char *> (params.mac_address.c_str ()));
107 }
108 else
109 {
110 int (*func) (void *) = (int (*) (void *))dll_loader->get_address ("open_device");
111 if (func == NULL)
112 {
113 safe_logger (spdlog::level::err, "failed to get function address for open_device");
114 return (int)BrainFlowExitCodes::GENERAL_ERROR;
115 }
116 safe_logger (
117 spdlog::level::info, "mac address is not specified, try to find brainbit without it");
118 res = func (NULL);
119 }
120 return res;
121}

Callers

nothing calls this directly

Calls 1

get_addressMethod · 0.45

Tested by

no test coverage detected