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

Method send_command

src/board_controller/openbci/ganglion_native.cpp:422–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422int GanglionNative::send_command (std::string config)
423{
424 if (!initialized)
425 {
426 return (int)BrainFlowExitCodes::BOARD_NOT_CREATED_ERROR;
427 }
428 if (config.empty ())
429 {
430 return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
431 }
432 uint8_t *command = new uint8_t[config.size ()];
433 memcpy (command, config.c_str (), config.size ());
434 if (simpleble_peripheral_write_command (ganglion_peripheral, write_characteristics.first,
435 write_characteristics.second, command, config.size ()) != SIMPLEBLE_SUCCESS)
436 {
437 safe_logger (spdlog::level::err, "failed to send command {} to device", config.c_str ());
438 delete[] command;
439 return (int)BrainFlowExitCodes::BOARD_WRITE_ERROR;
440 }
441 delete[] command;
442 return (int)BrainFlowExitCodes::STATUS_OK;
443}
444
445void GanglionNative::adapter_1_on_scan_start (simpleble_adapter_t adapter)
446{

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected