ตัวเลข UUID แบ่งการใช้งานได้ออกเป็น 4 กลุ่มใหญ่ๆ คือ
Version 1 เป็นกลุ่มที่พบได้ในงานทางเครือข่ายทั่วไป โดยตัวเลขจะถูกสร้างขึ้นจาก MAC address รวมกับค่า timestamp ซึ่งเป็นตัวเลขในหน่วยนาโนวินาที (nanosecond) จำนวน 100 หลักเพื่อให้ได้ตัวเลขที่มีเอกลักษณ์ ส่วนใหญ่ถูกใช้ในการระบุ transaction
Version 3 และ 5 เป็นการใช้ UUID ในรูปแบบของการทำ hash function เช่น MD5 และ SHA-1
Version 4 ใช้เป็นเลขสุ่ม
แล้วมันเกี่ยวอะไรกับ Bluetooth Protocol
กลุ่ม Bluetooth ได้ให้มาตรฐานในการติดต่อบนเครือข่าย Bluetooth โดยใช้ UUID ในกระบวนการทำ Service Discovery Protocol (SDP) และการเชื่อมต่อ โดยจองตัวเลขขนาด 32 bit แรกเอาไว้ แต่ที่ใช้ตอนนี้ใช้แค่เพียง 16 bit หลังสำหรับระบุโปรโตคอลก่อน ซึ่งตัวเลขเหล่านี้ใช้ในการระบุมาตรฐานในการเชื่อมต่อ เช่น Protocol Identifiers, profile ใน BluetoothProfileDescriptorList เป็นต้น และต่อด้วยเลข UUID ฐานดังตารางที่ 1
ตารางที่ 1
| UUID Name | UUID |
|---|---|
| BASE_UUID | 0000XXXX-0000-1000-8000-00805F9B34FB |
จากนั้นแทนค่า XXXX ด้วยค่า 16 bit ( 4 hexadecimal charactor) ดังยกตัวอย่างบางส่วนมาในตารางที่ 2
ตารางที่ 2
| Service Class Name | UUID | Specification | Allowed Usage |
|---|---|---|---|
| ServiceDiscoveryServerServiceClassID | 0x1000 | Bluetooth Core Specification | Service Class |
| BrowseGroupDescriptorServiceClassID | 0x1001 | Bluetooth Core Specification | Service Class |
| SerialPort | 0x1101 | Serial Port Profile (SPP) NOTE: The example SDP record in SPP v1.0 does not include a BluetoothProfileDescriptorList attribute, but some implementations may also use this UUID for the Profile Identifier. | Service Class/ Profile |
| LANAccessUsingPPP | 0x1102 | LAN Access Profile [DEPRECATED] NOTE: Used as both Service Class Identifier and Profile Identifier. | Service Class/ Profile |
| ... | ... | ... | .... |
link : https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery, http://www.avetana-gmbh.de/avetana-gmbh/produkte/doc/javax/bluetooth/UUID.html, http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html#createRfcommSocketToServiceRecord%28java.util.UUID%29
No comments:
Post a Comment