1 | <?php |
||
12 | final class Device |
||
13 | { |
||
14 | public const PROXIMITY_IMMEDIATE = 'IMMEDIATE'; |
||
15 | public const PROXIMITY_NEAR = 'NEAR'; |
||
16 | public const PROXIMITY_FAR = 'FAR'; |
||
17 | |||
18 | public const DEVICE_TYPE_BEACON = 'BEACON'; |
||
19 | public const DEVICE_TYPE_CLOUD_BEACON = 'CLOUD_BEACON'; |
||
20 | |||
21 | public const PROFILE_IBEACON = 'IBEACON'; |
||
22 | public const PROFILE_EDDYSTONE = 'EDDYSTONE'; |
||
23 | |||
24 | public const SPECIFICATION_STANDARD = 'STANDARD'; |
||
25 | public const SPECIFICATION_SENSOR = 'SENSOR'; |
||
26 | public const SPECIFICATION_TOUGH = 'TOUGH'; |
||
27 | |||
28 | public const MODEL_CARD_BEACON = 'CARD_BEACON'; |
||
29 | public const MODEL_CLOUD_BEACON = 'CLOUD_BEACON'; |
||
30 | public const MODEL_EXTERNAL = 'EXTERNAL'; |
||
31 | public const MODEL_GATEWAY = 'GATEWAY'; |
||
32 | public const MODEL_SENSOR_BEACON = 'SENSOR_BEACON'; |
||
33 | public const MODEL_SMART_BEACON = 'SMART_BEACON'; |
||
34 | public const MODEL_USB_BEACON = 'USB_BEACON'; |
||
35 | |||
36 | /** |
||
37 | * @param string $id Device ID. |
||
38 | * @param string $uniqueId Device unique ID. |
||
39 | */ |
||
40 | public function __construct(string $id, string $uniqueId) |
||
45 | |||
46 | /** |
||
47 | * Device ID. |
||
48 | * |
||
49 | * This is an UUID. |
||
50 | * |
||
51 | * @var string |
||
52 | * |
||
53 | * @JMS\Type("string") |
||
54 | * @JMS\SerializedName("id") |
||
55 | */ |
||
56 | private $id; |
||
57 | |||
58 | /** |
||
59 | * Device unique ID. |
||
60 | * |
||
61 | * @var string |
||
62 | * |
||
63 | * @JMS\Type("string") |
||
64 | * @JMS\SerializedName("uniqueId") |
||
65 | */ |
||
66 | private $uniqueId; |
||
67 | |||
68 | /** |
||
69 | * Eddystone namespace. |
||
70 | * |
||
71 | * @var string |
||
72 | * |
||
73 | * @JMS\Type("string") |
||
74 | * @JMS\SerializedName("namespace") |
||
75 | */ |
||
76 | private $namespace; |
||
77 | |||
78 | /** |
||
79 | * Eddystone ID. |
||
80 | * |
||
81 | * @var string |
||
82 | * |
||
83 | * @JMS\Type("string") |
||
84 | * @JMS\SerializedName("instanceId") |
||
85 | */ |
||
86 | private $instanceId; |
||
87 | |||
88 | /** |
||
89 | * Device type. |
||
90 | * |
||
91 | * @var string |
||
92 | * |
||
93 | * @JMS\Type("string") |
||
94 | * @JMS\SerializedName("deviceType") |
||
95 | */ |
||
96 | private $deviceType; |
||
97 | |||
98 | /** |
||
99 | * Specification. |
||
100 | * |
||
101 | * @var string |
||
102 | * |
||
103 | * @JMS\Type("string") |
||
104 | * @JMS\SerializedName("specification") |
||
105 | */ |
||
106 | private $specification; |
||
107 | |||
108 | /** |
||
109 | * Proximity UUID. |
||
110 | * |
||
111 | * The UUID of the device. |
||
112 | * |
||
113 | * @var string |
||
114 | * |
||
115 | * @JMS\Type("string") |
||
116 | * @JMS\SerializedName("proximity") |
||
117 | */ |
||
118 | private $proximity; |
||
119 | |||
120 | /** |
||
121 | * Major. |
||
122 | * |
||
123 | * @var integer |
||
124 | * |
||
125 | * @JMS\Type("integer") |
||
126 | * @JMS\SerializedName("major") |
||
127 | */ |
||
128 | private $major; |
||
129 | |||
130 | /** |
||
131 | * Minor. |
||
132 | * |
||
133 | * @var integer |
||
134 | * |
||
135 | * @JMS\Type("integer") |
||
136 | * @JMS\SerializedName("minor") |
||
137 | */ |
||
138 | private $minor; |
||
139 | |||
140 | /** |
||
141 | * Device name. |
||
142 | * |
||
143 | * @var string |
||
144 | * |
||
145 | * @JMS\Type("string") |
||
146 | * @JMS\SerializedName("name") |
||
147 | */ |
||
148 | private $name; |
||
149 | |||
150 | /** |
||
151 | * Device alias. |
||
152 | * |
||
153 | * @var string |
||
154 | * |
||
155 | * @JMS\Type("string") |
||
156 | * @JMS\SerializedName("alias") |
||
157 | */ |
||
158 | private $alias; |
||
159 | |||
160 | /** |
||
161 | * The model. |
||
162 | * |
||
163 | * @var string |
||
164 | * |
||
165 | * @JMS\Type("string") |
||
166 | * @JMS\SerializedName("model") |
||
167 | */ |
||
168 | private $model; |
||
169 | |||
170 | /** |
||
171 | * Advertising interval range (20 - 10240 milliseconds). |
||
172 | * |
||
173 | * @var integer |
||
174 | * |
||
175 | * @JMS\Type("integer") |
||
176 | * @JMS\SerializedName("interval") |
||
177 | */ |
||
178 | private $interval; |
||
179 | |||
180 | /** |
||
181 | * Transmission power (0 - 7). |
||
182 | * |
||
183 | * @var integer |
||
184 | * |
||
185 | * @JMS\Type("integer") |
||
186 | * @JMS\SerializedName("txPower") |
||
187 | */ |
||
188 | private $txPower; |
||
189 | |||
190 | /** |
||
191 | * Device URL. |
||
192 | * |
||
193 | * @var string |
||
194 | * |
||
195 | * @JMS\Type("string") |
||
196 | * @JMS\SerializedName("url") |
||
197 | */ |
||
198 | private $url; |
||
199 | |||
200 | /** |
||
201 | * Firmware version of the device |
||
202 | * |
||
203 | * @var string |
||
204 | * |
||
205 | * @JMS\Type("string") |
||
206 | * @JMS\SerializedName("firmware") |
||
207 | */ |
||
208 | private $firmware; |
||
209 | |||
210 | /** |
||
211 | * Device profile. |
||
212 | * |
||
213 | * @var array |
||
214 | * |
||
215 | * @JMS\Type("array") |
||
216 | * @JMS\SerializedName("profiles") |
||
217 | */ |
||
218 | private $profiles; |
||
219 | |||
220 | /** |
||
221 | * Get the ID. |
||
222 | * |
||
223 | * @return string |
||
224 | */ |
||
225 | public function id() |
||
229 | |||
230 | /** |
||
231 | * Get the unique ID. |
||
232 | * |
||
233 | * @return string |
||
234 | */ |
||
235 | public function uniqueId() |
||
239 | |||
240 | /** |
||
241 | * Get the namespace. |
||
242 | * |
||
243 | * @return string |
||
244 | */ |
||
245 | public function namespace() |
||
249 | |||
250 | /** |
||
251 | * Set the namespace. |
||
252 | * |
||
253 | * @param string $namespace The namespace. |
||
254 | * @return Device |
||
255 | */ |
||
256 | public function setNamespace($namespace) |
||
262 | |||
263 | /** |
||
264 | * Get the instance ID. |
||
265 | * |
||
266 | * @return string |
||
267 | */ |
||
268 | public function instanceId() |
||
272 | |||
273 | /** |
||
274 | * Set the instance ID. |
||
275 | * |
||
276 | * @param string $instanceId The instance ID. |
||
277 | * @return Device |
||
278 | */ |
||
279 | public function setInstanceId($instanceId) |
||
285 | |||
286 | /** |
||
287 | * Get the device type. |
||
288 | * |
||
289 | * @return string |
||
290 | */ |
||
291 | public function deviceType() |
||
295 | |||
296 | /** |
||
297 | * Set the device type. |
||
298 | * |
||
299 | * @param string $deviceType The device type. |
||
300 | * @return Device |
||
301 | */ |
||
302 | public function setDeviceType($deviceType) |
||
308 | |||
309 | /** |
||
310 | * Get the specifications. |
||
311 | * |
||
312 | * @return string |
||
313 | */ |
||
314 | public function specification() |
||
318 | |||
319 | /** |
||
320 | * Set the specifications. |
||
321 | * |
||
322 | * @param string $specification The specifications. |
||
323 | * @return Device |
||
324 | */ |
||
325 | public function setSpecification($specification) |
||
331 | |||
332 | /** |
||
333 | * Get the proximity. |
||
334 | * |
||
335 | * @return string |
||
336 | */ |
||
337 | public function proximity(): string |
||
341 | |||
342 | /** |
||
343 | * Set the proximity UUID. |
||
344 | * |
||
345 | * @param string $proximity The proximity UUID. |
||
346 | * @return Device |
||
347 | */ |
||
348 | public function setProximity(string $proximity) |
||
354 | |||
355 | /** |
||
356 | * Get the major. |
||
357 | * |
||
358 | * @return integer |
||
359 | */ |
||
360 | public function major(): int |
||
364 | |||
365 | /** |
||
366 | * Set the major. |
||
367 | * |
||
368 | * @param integer $major The major. |
||
369 | * @return Device |
||
370 | */ |
||
371 | public function setMajor(int $major) |
||
377 | |||
378 | /** |
||
379 | * Get the minor. |
||
380 | * |
||
381 | * @return integer |
||
382 | */ |
||
383 | public function minor(): int |
||
387 | |||
388 | /** |
||
389 | * Set the minor. |
||
390 | * |
||
391 | * @param integer $minor The minor. |
||
392 | * @return Device |
||
393 | */ |
||
394 | public function setMinor(int $minor) |
||
400 | |||
401 | /** |
||
402 | * Get the name. |
||
403 | * |
||
404 | * @return string |
||
405 | */ |
||
406 | public function name(): string |
||
410 | |||
411 | /** |
||
412 | * Set the name. |
||
413 | * |
||
414 | * @param string $name The name. |
||
415 | * @return Device |
||
416 | */ |
||
417 | public function setName($name) |
||
423 | |||
424 | /** |
||
425 | * Get the alias. |
||
426 | * |
||
427 | * @return string |
||
428 | */ |
||
429 | public function alias(): ?string |
||
433 | |||
434 | /** |
||
435 | * Set the alias. |
||
436 | * |
||
437 | * @param string $alias The alias. |
||
438 | * @return Device |
||
439 | */ |
||
440 | public function setAlias(?string $alias) |
||
446 | |||
447 | /** |
||
448 | * Get the model. |
||
449 | * |
||
450 | * @return string |
||
451 | */ |
||
452 | public function model(): string |
||
456 | |||
457 | /** |
||
458 | * Set the model. |
||
459 | * |
||
460 | * @param string $model |
||
461 | * @return Device |
||
462 | */ |
||
463 | public function setModel(string $model): Device |
||
468 | |||
469 | /** |
||
470 | * Get the broadcast interval in milliseconds. |
||
471 | * |
||
472 | * @return integer |
||
473 | */ |
||
474 | public function interval(): int |
||
478 | |||
479 | /** |
||
480 | * Set the broadcast interval. |
||
481 | * |
||
482 | * @param integer $interval The interval in milliseconds. |
||
483 | * @return Device |
||
484 | */ |
||
485 | public function setInterval(int $interval) |
||
491 | |||
492 | /** |
||
493 | * Get the TX power. |
||
494 | * |
||
495 | * @return integer |
||
496 | */ |
||
497 | public function txPower(): int |
||
501 | |||
502 | /** |
||
503 | * Set the TX power. |
||
504 | * |
||
505 | * @param integer $txPower |
||
506 | * @return Device |
||
507 | */ |
||
508 | public function setTxPower($txPower) |
||
514 | |||
515 | /** |
||
516 | * Get the URL. |
||
517 | * |
||
518 | * @return string |
||
519 | */ |
||
520 | public function url(): ?string |
||
524 | |||
525 | /** |
||
526 | * Set the URL. |
||
527 | * |
||
528 | * @param string $url The URL. |
||
529 | * @return Device |
||
530 | */ |
||
531 | public function setUrl(?string $url) |
||
537 | |||
538 | /** |
||
539 | * Get the firmware version. |
||
540 | * |
||
541 | * @return string |
||
542 | */ |
||
543 | public function firmware(): ?string |
||
547 | |||
548 | /** |
||
549 | * Set the firmware. |
||
550 | * |
||
551 | * @param string $firmware |
||
552 | * @return Device |
||
553 | */ |
||
554 | public function setFirmware(string $firmware) |
||
559 | |||
560 | /** |
||
561 | * Get the profiles. |
||
562 | * |
||
563 | * @return array |
||
564 | */ |
||
565 | public function profiles(): ?array |
||
569 | |||
570 | /** |
||
571 | * Set the profiles. |
||
572 | * |
||
573 | * @param array|null $profiles |
||
574 | * @return Device |
||
575 | */ |
||
576 | public function setProfiles(?array $profiles) |
||
582 | } |
||
583 |