徐東網(wǎng)站建設(shè)公司/網(wǎng)絡(luò)銷售員每天做什么
Device UUID也可以被稱作為DeviceID。
Android 設(shè)備上掃描獲取到的 deviceId 為外圍設(shè)備的 MAC 地址,相對固定。
iOS 設(shè)備上掃描獲取到的 deviceId 是系統(tǒng)根據(jù)外圍設(shè)備 MAC 地址及發(fā)現(xiàn)設(shè)備的時間生成的 UUID,是設(shè)備上的Core Bluetooth為該設(shè)備分配的標(biāo)識符。對于已連接過的設(shè)備,UUID 會在一段時間內(nèi)保持不變(正常是15-20分鐘變化一次)。
此外,UUID 也會在某些條件下可能會發(fā)生變化(如系統(tǒng)藍(lán)牙模塊重啟、配對設(shè)備被忽略等),在不同的設(shè)備上獲取到的 UUID 也是不同的。不同手機連接同一設(shè)備的uuid不是同一個。
問題:
這樣無法確認(rèn)對應(yīng)的的設(shè)備是哪一臺,要是斷連后就不知道上一臺設(shè)備是哪一臺,由此提出一個方案就是可以在藍(lán)牙的掃描響應(yīng)包中去添加上本設(shè)備的MAC地址,這樣不管是IOS還是安卓設(shè)備這樣都可以識別到唯一設(shè)備。
SerivceId就是Service UUID。
藍(lán)牙設(shè)備的ID,通過此ID可以進行連接藍(lán)牙設(shè)備,連接成功之后可以獲取serviceId,serviceId可以有多個,每個serviceId可以看作是服務(wù),每個serviceId中可以定義多個uuid(特征值)。
Service UUID已經(jīng)有了很多特定的,也可以自己定義。
特定的:{0000xxxx-0000-1000-8000-00805F9B34FB}xxxx = 0x0000 ~ 0xFFFE
GATT Service 0x1800 Generic Access
GATT Service 0x1801 Generic Attribute
GATT Service 0x1802 Immediate Alert
GATT Service 0x1803 Link Loss
GATT Service 0x1804 Tx Power
GATT Service 0x1805 Current Time
GATT Service 0x1806 Reference Time Update?
GATT Service 0x1807 Next DST Change?
GATT Service 0x1808 Glucose
GATT Service 0x1809 Health Thermometer
GATT Service 0x180A Device Information
GATT Service 0x180D Heart Rate
GATT Service 0x180E Phone Alert Status?
GATT Service 0x180F Battery
GATT Service 0x1810 Blood Pressure
GATT Service 0x1811 Alert Notification
GATT Service 0x1812 Human Interface Device
GATT Service 0x1813 Scan Parameters
GATT Service 0x1814 Running Speed and Cadence
GATT Service 0x1815 Automation IO
GATT Service 0x1816 Cycling Speed and Cadence
GATT Service 0x1818 Cycling Power
GATT Service 0x1819 Location and Navigation
GATT Service 0x181A Environmental Sensing
GATT Service 0x181B Body Composition
GATT Service 0x181C User Data
GATT Service 0x181D Weight Scale
GATT Service 0x181E Bond Management?
GATT Service 0x181F Continuous Glucose Monitoring?
GATT Service 0x1820 Internet Protocol Support
GATT Service 0x1821 Indoor Positioning?
GATT Service 0x1822 Pulse Oximeter
GATT Service 0x1823 HTTP Proxy
GATT Service 0x1824 Transport Discovery?
GATT Service 0x1825 Object Transfer?
GATT Service 0x1826 Fitness Machine
GATT Service 0x1827 Mesh Provisioning?
GATT Service 0x1828 Mesh Proxy
GATT Service 0x1829 Reconnection Configuration?
GATT Service 0x183A Insulin Delivery?
GATT Service 0x183B Binary Sensor
GATT Service 0x183C Emergency Configuration
GATT Service 0x183E Physical Activity Monitor?
GATT Service 0x1843 Audio Input Control?
GATT Service 0x1844 Volume Control