| 381 | } |
| 382 | |
| 383 | int AAVAAv3::send_command (std::string config) |
| 384 | { |
| 385 | if (!initialized) |
| 386 | { |
| 387 | return (int)BrainFlowExitCodes::BOARD_NOT_CREATED_ERROR; |
| 388 | } |
| 389 | if (config.empty ()) |
| 390 | { |
| 391 | return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR; |
| 392 | } |
| 393 | uint8_t *command = new uint8_t[config.size ()]; |
| 394 | memcpy (command, config.c_str (), config.size ()); |
| 395 | if (simpleble_peripheral_write_command (aavaa_peripheral, write_characteristics.first, |
| 396 | write_characteristics.second, command, config.size ()) != SIMPLEBLE_SUCCESS) |
| 397 | { |
| 398 | safe_logger (spdlog::level::err, "failed to send command {} to device", config.c_str ()); |
| 399 | delete[] command; |
| 400 | return (int)BrainFlowExitCodes::BOARD_WRITE_ERROR; |
| 401 | } |
| 402 | else |
| 403 | { |
| 404 | safe_logger ( |
| 405 | spdlog::level::trace, "successfully sent command {} to device", config.c_str ()); |
| 406 | } |
| 407 | delete[] command; |
| 408 | return (int)BrainFlowExitCodes::STATUS_OK; |
| 409 | } |
| 410 | |
| 411 | void AAVAAv3::adapter_1_on_scan_start (simpleble_adapter_t adapter) |
| 412 | { |