| 420 | } |
| 421 | |
| 422 | int 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 | |
| 445 | void GanglionNative::adapter_1_on_scan_start (simpleble_adapter_t adapter) |
| 446 | { |