| 173 | } |
| 174 | |
| 175 | bool EspNowService::send(const uint8_t* address, const uint8_t* buffer, size_t bufferLength) { |
| 176 | auto lock = mutex.asScopedLock(); |
| 177 | lock.lock(); |
| 178 | |
| 179 | if (!isEnabled()) { |
| 180 | return false; |
| 181 | } else { |
| 182 | return esp_now_send(address, buffer, bufferLength) == ESP_OK; |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | ReceiverSubscription EspNowService::subscribeReceiver(std::function<void(const esp_now_recv_info_t* receiveInfo, const uint8_t* data, int length)> onReceive) { |
| 187 | auto lock = mutex.asScopedLock(); |
no test coverage detected