forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
device_hub.m
31 lines (30 loc) · 1.18 KB
/
device_hub.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
% Wraps librealsense2 device_hub class
classdef device_hub < handle
properties (SetAccess = private, Hidden = true)
objectHandle;
end
methods
% Constructor
function this = device_hub(context)
narginchk(1, 1);
validateattributes(context, {'realsense.context'}, {'scalar'});
this.objectHandle = realsense.librealsense_mex('rs2::device_hub', 'new', context.objectHandle);
end
% Destructor
function delete(this)
if (this.objectHandle ~= 0)
realsense.librealsense_mex('rs2::device_hub', 'delete', this.objectHandle);
end
end
% Functions
function device = wait_for_device(this)
out = realsense.librealsense_mex('rs2::device_hub', 'wait_for_device', this.objectHandle);
device = realsense.device(out(1), out(2));
end
function value = is_connected(this, dev)
narginchk(2, 2);
validateattributes(dev, {'realsense.device'}, {'scalar'}, '', 'dev', 2);
value = realsense.librealsense_mex('rs2::device_hub', 'is_connected', this.objectHandle, dev.objectHandle);
end
end
end