forked from SiriusDely/Cascades-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RemoteDeviceInfoSheet.qml
128 lines (118 loc) · 4.28 KB
/
RemoteDeviceInfoSheet.qml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/* Copyright (c) 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import bb.cascades 1.0
// A sheet that shows the information about a remote bluetooth device
Sheet {
id: root
Page {
Container {
Label {
text: _btController.remoteDeviceInfo.name
horizontalAlignment: HorizontalAlignment.Center
textStyle {
base: SystemDefaults.TextStyles.TitleText
fontWeight: FontWeight.Bold
color: Color.DarkRed
}
}
Container {
horizontalAlignment: HorizontalAlignment.Left
bottomPadding: 5
leftPadding: 20
rightPadding: 20
//! [0]
LabelLabel {
label: qsTr("Address")
text: _btController.remoteDeviceInfo.address
}
LabelLabel {
label: qsTr("Class")
text: _btController.remoteDeviceInfo.deviceClass
}
//! [0]
LabelLabel {
label: qsTr("Device Type")
text: _btController.remoteDeviceInfo.deviceType
}
LabelLabel {
label: qsTr("Encrypted")
text: _btController.remoteDeviceInfo.encrypted
}
LabelLabel {
label: qsTr("Paired")
text: _btController.remoteDeviceInfo.paired
}
LabelLabel {
label: qsTr("Trusted")
text: _btController.remoteDeviceInfo.trusted
}
LabelLabel {
label: qsTr("RSSI")
text: _btController.remoteDeviceInfo.rssi
}
}
Container {
leftPadding: 20
bottomPadding: 0
bottomMargin: 0
rightPadding: 20
Label {
bottomMargin: 0
text: qsTr("Low Energy Properties:")
textStyle {
base: SystemDefaults.TextStyles.SmallText
fontWeight: FontWeight.Bold
color: Color.Blue
}
}
LabelLabel {
label: qsTr("MIN Connection Interval")
text: _btController.remoteDeviceInfo.minimumConnectionInterval
}
LabelLabel {
label: qsTr("MAX Connection Interval")
text: _btController.remoteDeviceInfo.maximumConnectionInterval
}
LabelLabel {
label: qsTr("Latency")
text: _btController.remoteDeviceInfo.latency
}
LabelLabel {
label: qsTr("Supervisory Timeout")
text: _btController.remoteDeviceInfo.supervisoryTimeout
}
LabelLabel {
label: qsTr("Appearance")
text: _btController.remoteDeviceInfo.appearance
}
LabelLabel {
label: qsTr("Flags")
text: _btController.remoteDeviceInfo.flags
}
LabelLabel {
label: qsTr("Connectable")
text: _btController.remoteDeviceInfo.connectable
}
}
Divider {
}
Button {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("Close")
onClicked: root.close()
}
}
}
}