MCPcopy Create free account
hub / github.com/ReversecLabs/C3 / DetachDevice

Method DetachDevice

Src/Core/Relay.cpp:65–81  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

63
64////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
65void FSecure::C3::Core::Relay::DetachDevice(DeviceId const& iidOfDeviceToDetach)
66{
67 // Find specified Device.
68
69 m_Devices.Remove([&iidOfDeviceToDetach](std::weak_ptr<DeviceBridge> const& c)
70 {
71 if (auto ri = c.lock(); ri && ri->GetDid() == iidOfDeviceToDetach)
72 {
73 ri->Detach();
74 return true;
75 }
76
77 return false;
78 });
79
80 RemoveChannelRoutes(iidOfDeviceToDetach);
81}
82
83////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
84std::shared_ptr<FSecure::C3::Core::DeviceBridge> FSecure::C3::Core::Relay::FindDevice(DeviceId did)

Callers 1

CloseMethod · 0.45

Calls 4

GetDidMethod · 0.80
RemoveMethod · 0.45
lockMethod · 0.45
DetachMethod · 0.45

Tested by

no test coverage detected