1# Copyright 2016 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""A list of advertisements data for testing purpose.""" 6 7 8ADVERTISEMENT1 = { 9 'Path': '/org/bluez/test/advertisement1', 10 'Type': 'peripheral', 11 'ManufacturerData': {'0xff01': [0x1a, 0x1b, 0x1c, 0x1d, 0x1e]}, 12 'ServiceUUIDs': ['180D', '180F'], 13 'SolicitUUIDs': [], 14 'ServiceData': {'9991': [0x11, 0x12, 0x13, 0x14, 0x15]}, 15 'IncludeTxPower': True} 16 17 18ADVERTISEMENT2 = { 19 'Path': '/org/bluez/test/advertisement2', 20 'Type': 'peripheral', 21 'ManufacturerData': {'0xff02': [0x2a, 0x2b, 0x2c, 0x2d, 0x2e]}, 22 'ServiceUUIDs': ['1821'], 23 'SolicitUUIDs': [], 24 'ServiceData': {'9992': [0x21, 0x22, 0x23, 0x24, 0x25]}, 25 'IncludeTxPower': True} 26 27 28ADVERTISEMENT3 = { 29 'Path': '/org/bluez/test/advertisement3', 30 'Type': 'peripheral', 31 'ManufacturerData': {'0xff03': [0x3a, 0x3b, 0x3c, 0x3d, 0x3e]}, 32 'ServiceUUIDs': ['1819', '180E'], 33 'SolicitUUIDs': [], 34 'ServiceData': {'9993': [0x31, 0x32, 0x33, 0x34, 0x35]}, 35 'IncludeTxPower': True} 36 37 38ADVERTISEMENT4 = { 39 'Path': '/org/bluez/test/advertisement4', 40 'Type': 'peripheral', 41 'ManufacturerData': {'0xff04': [0x4a, 0x4b, 0x4c, 0x4d, 0x4e]}, 42 'ServiceUUIDs': ['1808', '1810'], 43 'SolicitUUIDs': [], 44 'ServiceData': {'9994': [0x41, 0x42, 0x43, 0x44, 0x45]}, 45 'IncludeTxPower': True} 46 47 48ADVERTISEMENT5 = { 49 'Path': '/org/bluez/test/advertisement5', 50 'Type': 'peripheral', 51 'ManufacturerData': {'0xff05': [0x5a, 0x5b, 0x5c, 0x5d, 0x5e]}, 52 'ServiceUUIDs': ['1818', '181B'], 53 'SolicitUUIDs': [], 54 'ServiceData': {'9995': [0x51, 0x52, 0x53, 0x54, 0x55]}, 55 'IncludeTxPower': True} 56 57 58ADVERTISEMENT6 = { 59 'Path': '/org/bluez/test/advertisement6', 60 'Type': 'peripheral', 61 'ManufacturerData': {'0xff06': [0x6a, 0x6b, 0x6c, 0x6d, 0x6e]}, 62 'ServiceUUIDs': ['1820'], 63 'SolicitUUIDs': [], 64 'ServiceData': {'9996': [0x61, 0x62, 0x63, 0x64, 0x65]}, 65 'IncludeTxPower': True} 66 67 68NEARBY_BROADCAST_ADV = { 69 'Path': '/org/bluez/test/advertisement7', 70 'Type': 'broadcast', 71 'ManufacturerData': { 72 '0xFE2C': [0x6a, 0x6b, 0x6c, 0x6d, 0x6e] 73 }, 74 'ServiceUUIDs': ['FE2C'], 75 'SolicitUUIDs': [], 76 'ServiceData': { 77 'FE2C': [0x61, 0x62, 0x63, 0x64, 0x65] 78 }, 79 'IncludeTxPower': True 80} 81 82 83# 84# Nearby Mediums Fast Advertisement requirement is to put Service UUIDs and 85# flags in advertising payload, and 20 bytes of Service data in Scan response 86# 87NEARBY_MEDIUMS_FAST_ADV = { 88 'Path': '/org/bluez/test/advertisement8', 89 'Type': 'peripheral', 90 'ServiceUUIDs': ['FEF3'], 91 'ScanResponseData': { 92 '0x16': [0xf3, 0xfe] + range(1, 21) 93 }, 94} 95 96ADVERTISEMENTS = [ADVERTISEMENT1, ADVERTISEMENT2, ADVERTISEMENT3, 97 ADVERTISEMENT4, ADVERTISEMENT5, ADVERTISEMENT6] 98