Lines Matching refs:internal_

529 Server::Server() : internal_(nullptr) {}  in Server()
534 internal_.reset(new ServerInternals); in Initialize()
535 if (!internal_) { in Initialize()
539 g_internal = internal_.get(); in Initialize()
541 std::unique_lock<std::mutex> lock(internal_->lock); in Initialize()
542 int status = internal_->Initialize(); in Initialize()
550 bt_status_t btstat = internal_->gatt->server->register_server(&uuid); in Initialize()
556 internal_->api_synchronize.wait(lock); in Initialize()
558 if (internal_->server_if == 0) { in Initialize()
563 *gatt_pipe = internal_->pipefd[kPipeReadEnd]; in Initialize()
581 std::lock_guard<std::mutex> lock(internal_->lock); in SetAdvertisement()
584 internal_->gatt->advertiser->SetData(0, false, /* beacon, not scan response */ in SetAdvertisement()
607 std::lock_guard<std::mutex> lock(internal_->lock); in SetScanResponse()
610 internal_->gatt->advertiser->SetData(0, true, /* scan response */ in SetScanResponse()
624 std::unique_lock<std::mutex> lock(internal_->lock); in AddCharacteristic()
626 internal_->AddCharacteristic(id, properties, permissions); in AddCharacteristic()
629 internal_->service_handle); in AddCharacteristic()
632 internal_->api_synchronize.wait(lock); in AddCharacteristic()
633 const int handle = internal_->uuid_to_attribute[id]; in AddCharacteristic()
634 internal_->characteristics[handle].notify = properties & kPropertyNotify; in AddCharacteristic()
640 std::unique_lock<std::mutex> lock(internal_->lock); in AddBlob()
644 internal_->AddCharacteristic(id, properties, permissions); in AddBlob()
655 internal_->AddCharacteristic(control_id, kPropertyRead | kPropertyWrite, in AddBlob()
662 std::unique_lock<std::mutex> lock(internal_->lock); in Start()
663 bt_status_t btstat = internal_->gatt->server->add_service( in Start()
664 internal_->server_if, pending_svc_decl); in Start()
667 internal_->service_handle); in Start()
670 internal_->api_synchronize.wait(lock); in Start()
675 std::unique_lock<std::mutex> lock(internal_->lock); in Stop()
676 bt_status_t btstat = internal_->gatt->server->stop_service( in Stop()
677 internal_->server_if, internal_->service_handle); in Stop()
680 internal_->service_handle); in Stop()
683 internal_->api_synchronize.wait(lock); in Stop()
688 internal_->gatt->scanner->Scan(true); in ScanEnable()
693 internal_->gatt->scanner->Scan(false); in ScanDisable()
698 std::lock_guard<std::mutex> lock(internal_->lock); in GetScanResults()
699 *results = internal_->scan_results; in GetScanResults()
705 std::lock_guard<std::mutex> lock(internal_->lock); in SetCharacteristicValue()
706 const int attribute_id = internal_->uuid_to_attribute[id]; in SetCharacteristicValue()
707 Characteristic& ch = internal_->characteristics[attribute_id]; in SetCharacteristicValue()
713 for (auto connection : internal_->connections) { in SetCharacteristicValue()
714 internal_->gatt->server->send_indication(internal_->server_if, attribute_id, in SetCharacteristicValue()
722 std::lock_guard<std::mutex> lock(internal_->lock); in GetCharacteristicValue()
723 const int attribute_id = internal_->uuid_to_attribute[id]; in GetCharacteristicValue()
724 *value = internal_->characteristics[attribute_id].blob; in GetCharacteristicValue()