mgmt-api.txt 148 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912
  1. Bluetooth Management API
  2. *************************
  3. Copyright (C) 2008-2009 Marcel Holtmann <marcel@holtmann.org>
  4. Overview
  5. ========
  6. This document describes the format of data used for communicating with
  7. the kernel using a so-called Bluetooth Management sockets. These sockets
  8. are available starting with Linux kernel version 3.4
  9. The following kernel versions introduced new commands, new events or
  10. important fixes to the Bluetooth Management API:
  11. Linux kernel v3.4 Version 1.0
  12. Linux kernel v3.5 Version 1.1
  13. Linux kernel v3.7 Version 1.2
  14. Linux kernel v3.9 Version 1.3
  15. Linux kernel v3.13 Version 1.4
  16. Linux kernel v3.15 Version 1.5
  17. Linux kernel v3.16 Version 1.6
  18. Linux kernel v3.17 Version 1.7
  19. Linux kernel v3.19 Version 1.8
  20. Linux kernel v4.1 Version 1.9
  21. Linux kernel v4.2 Version 1.10
  22. Linux kernel v4.5 Version 1.11
  23. Linux kernel v4.6 Version 1.12
  24. Linux kernel v4.8 Version 1.13
  25. Linux kernel v4.9 Version 1.14
  26. Linux kernel v5.5 Version 1.15
  27. Linux kernel v5.6 Version 1.16
  28. Linux kernel v5.7 Version 1.17
  29. Linux kernel v5.8 Version 1.18 (not yet released)
  30. Version 1.1 introduces Set Device ID command.
  31. Version 1.2 introduces Passkey Notify event.
  32. Version 1.3 does not introduce any new command or event.
  33. Version 1.4 introduces Set Advertising, Set BR/EDR, Set Static Address
  34. and Set Scan Parameters commands. The existing Set Discoverable command
  35. gained an extra setting for limited discoverable mode. The device name
  36. is now provided in the scan response data for Low Energy.
  37. Version 1.5 introduces Set Secure Connections, Set Debug Keys, Set Privacy
  38. and Load Identity Resolving Keys commands. It also introduces New Identity
  39. Resolving Key and New Signature Resolving Key events.
  40. Version 1.6 introduces Get Connection Information command. It also updates
  41. the Device Found event to combine advertising data and scan response data
  42. into a single event.
  43. Version 1.7 introduces Get Clock Information, Add Device, Remove Device,
  44. Load Connection Parameters, Read Unconfigured Index List, Read Controller
  45. Configuration Information, Set External Configuration and Set Public Address
  46. commands. It also introduces Device Added, Device Removed, New Connection
  47. Parameter, Unconfigured Index Added, Unconfigured Index Removed and New
  48. Configuration Options events. The existing Set Debug Keys command gained
  49. an extra setting for enabling SSP debug mode.
  50. Version 1.8 introduces Start Service Discovery command. It also adds new
  51. Long Term Key types for LE Secure Connection feature.
  52. Version 1.9 introduces Read Local Out Of Band Extended, Data, Read Extended
  53. Controller Index List, Read Advertising Features, Add Advertising and Remove
  54. Advertising commands. It also introduces Extended Index Added, Extended Index
  55. Removed, Local Out Of Band Extended Data Updated, Advertising Added and
  56. Advertising Removed events. The existing Set Advertising command gained an
  57. extra setting for enabling undirected connectable advertising. It provides
  58. support for a new static address setting and allows the usage of Set Fast
  59. Connectable when controller is powered off.
  60. Version 1.10 does not introduce any new command or event. It extends the
  61. advertising feature to support 5 parallel advertising instances.
  62. Version 1.11 introduces Get Advertising Size Information and Start Limited
  63. Discovery commands.
  64. Version 1.12 introduces a new limited privacy mode (value 0x02 passed to
  65. the Set Privacy command).
  66. Version 1.13 introduces a new authentication failure reason code for the
  67. Device Disconnected event.
  68. Version 1.14 introduces Read Extended Controller Information command and
  69. Extended Controller Information Changed event. It also adds Set Appearance
  70. command. The advertising flags Appearance and Local Name for adding scan
  71. response information are now supported.
  72. Version 1.15 introduces Get PHY Configuration, Set PHY Configuration and
  73. Load Blocked Keys commands.
  74. Version 1.16 introduces Wideband Speech setting and its corresponding
  75. Set Wideband Speech command.
  76. Version 1.17 introduces Read Security Information command, Read Experimental
  77. Features Information command, Set Experimental Feature command and the
  78. Experimental Feature Changed event.
  79. Version 1.18 introduces Read Default System Configuration command, Set
  80. Default System Configuration command, Default System Configuration Changed
  81. event, Read Default Runtime Configuration command, Set Default Runtime
  82. Configuration command, Default Runtime Configuration Changed event, Get
  83. Device Flags command, Set Device Flags command, Device Flags Changed event,
  84. Read Advertisement Monitor Features command, Add Advertisement Patterns
  85. Monitor command, Remove Advertisement Monitor command, Advertisement Monitor
  86. Added event and Advertisement Monitor Removed event.
  87. Example
  88. =======
  89. The Bluetooth management sockets can be created by setting the hci_channel
  90. member of struct sockaddr_hci to HCI_CHANNEL_CONTROL (3) when creating a
  91. raw HCI socket. In C the needed code would look something like the following:
  92. int mgmt_create(void)
  93. {
  94. struct sockaddr_hci addr;
  95. int fd;
  96. fd = socket(PF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
  97. BTPROTO_HCI);
  98. if (fd < 0)
  99. return -errno;
  100. memset(&addr, 0, sizeof(addr));
  101. addr.hci_family = AF_BLUETOOTH;
  102. addr.hci_dev = HCI_DEV_NONE;
  103. addr.hci_channel = HCI_CHANNEL_CONTROL;
  104. if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
  105. int err = -errno;
  106. close(fd);
  107. return err;
  108. }
  109. return fd;
  110. }
  111. The process creating the mgmt socket is required to have the
  112. CAP_NET_ADMIN capability (e.g. root would have this).
  113. Packet Structures
  114. =================
  115. Commands:
  116. 0 4 8 12 16 22 24 28 31 35 39 43 47
  117. +-------------------+-------------------+-------------------+
  118. | Command Code | Controller Index | Parameter Length |
  119. +-------------------+-------------------+-------------------+
  120. | |
  121. Events:
  122. 0 4 8 12 16 22 24 28 31 35 39 43 47
  123. +-------------------+-------------------+-------------------+
  124. | Event Code | Controller Index | Parameter Length |
  125. +-------------------+-------------------+-------------------+
  126. | |
  127. All fields are in little-endian byte order (least significant byte first).
  128. Controller Index can have a special value <non-controller> to indicate that
  129. command or event is not related to any controller. Possible values:
  130. <controller id> 0x0000 to 0xFFFE
  131. <non-controller> 0xFFFF
  132. Error Codes
  133. ===========
  134. The following values have been defined for use with the Command Status
  135. and Command Complete events:
  136. 0x00 Success
  137. 0x01 Unknown Command
  138. 0x02 Not Connected
  139. 0x03 Failed
  140. 0x04 Connect Failed
  141. 0x05 Authentication Failed
  142. 0x06 Not Paired
  143. 0x07 No Resources
  144. 0x08 Timeout
  145. 0x09 Already Connected
  146. 0x0A Busy
  147. 0x0B Rejected
  148. 0x0C Not Supported
  149. 0x0D Invalid Parameters
  150. 0x0E Disconnected
  151. 0x0F Not Powered
  152. 0x10 Cancelled
  153. 0x11 Invalid Index
  154. 0x12 RFKilled
  155. 0x13 Already Paired
  156. 0x14 Permission Denied
  157. As a general rule all commands generate the events as specified below,
  158. however invalid lengths or unknown commands will always generate a
  159. Command Status response (with Unknown Command or Invalid Parameters
  160. status). Sending a command with an invalid Controller Index value will
  161. also always generate a Command Status event with the Invalid Index
  162. status code.
  163. Read Management Version Information Command
  164. ===========================================
  165. Command Code: 0x0001
  166. Controller Index: <non-controller>
  167. Command Parameters:
  168. Return Parameters: Version (1 Octets)
  169. Revision (2 Octets)
  170. This command returns the Management version and revision.
  171. Besides, being informational the information can be used to
  172. determine whether certain behavior has changed or bugs fixed
  173. when interacting with the kernel.
  174. This command generates a Command Complete event on success or
  175. a Command Status event on failure.
  176. Read Management Supported Commands Command
  177. ==========================================
  178. Command Code: 0x0002
  179. Controller Index: <non-controller>
  180. Command Parameters:
  181. Return Parameters: Num_Of_Commands (2 Octets)
  182. Num_Of_Events (2 Octets)
  183. Command1 (2 Octets)
  184. Command2 (2 Octets)
  185. ...
  186. Event1 (2 Octets)
  187. Event2 (2 Octets)
  188. ...
  189. This command returns the list of supported Management commands
  190. and events.
  191. The commands Read Management Version Information and Read
  192. management Supported Commands are not included in this list.
  193. Both commands are always supported and mandatory.
  194. The events Command Status and Command Complete are not included
  195. in this list. Both are implicit and mandatory.
  196. This command generates a Command Complete event on success or
  197. a Command Status event on failure.
  198. Read Controller Index List Command
  199. ==================================
  200. Command Code: 0x0003
  201. Controller Index: <non-controller>
  202. Command Parameters:
  203. Return Parameters: Num_Controllers (2 Octets)
  204. Controller_Index[i] (2 Octets)
  205. This command returns the list of currently known controllers.
  206. Controllers added or removed after calling this command can be
  207. monitored using the Index Added and Index Removed events.
  208. This command generates a Command Complete event on success or
  209. a Command Status event on failure.
  210. Read Controller Information Command
  211. ===================================
  212. Command Code: 0x0004
  213. Controller Index: <controller id>
  214. Command Parameters:
  215. Return Parameters: Address (6 Octets)
  216. Bluetooth_Version (1 Octet)
  217. Manufacturer (2 Octets)
  218. Supported_Settings (4 Octets)
  219. Current_Settings (4 Octets)
  220. Class_Of_Device (3 Octets)
  221. Name (249 Octets)
  222. Short_Name (11 Octets)
  223. This command is used to retrieve the current state and basic
  224. information of a controller. It is typically used right after
  225. getting the response to the Read Controller Index List command
  226. or an Index Added event.
  227. The Address parameter describes the controllers public address
  228. and it can be expected that it is set. However in case of single
  229. mode Low Energy only controllers it can be 00:00:00:00:00:00. To
  230. power on the controller in this case, it is required to configure
  231. a static address using Set Static Address command first.
  232. If the public address is set, then it will be used as identity
  233. address for the controller. If no public address is available,
  234. then the configured static address will be used as identity
  235. address.
  236. In the case of a dual-mode controller with public address that
  237. is configured as Low Energy only device (BR/EDR switched off),
  238. the static address is used when set and public address otherwise.
  239. If no short name is set the Short_Name parameter will be empty
  240. (begin with a nul byte).
  241. Current_Settings and Supported_Settings is a bitmask with
  242. currently the following available bits:
  243. 0 Powered
  244. 1 Connectable
  245. 2 Fast Connectable
  246. 3 Discoverable
  247. 4 Bondable
  248. 5 Link Level Security (Sec. mode 3)
  249. 6 Secure Simple Pairing
  250. 7 Basic Rate/Enhanced Data Rate
  251. 8 High Speed
  252. 9 Low Energy
  253. 10 Advertising
  254. 11 Secure Connections
  255. 12 Debug Keys
  256. 13 Privacy
  257. 14 Controller Configuration
  258. 15 Static Address
  259. 16 PHY Configuration
  260. 17 Wideband Speech
  261. This command generates a Command Complete event on success or
  262. a Command Status event on failure.
  263. Possible errors: Invalid Parameters
  264. Invalid Index
  265. Set Powered Command
  266. ===================
  267. Command Code: 0x0005
  268. Controller Index: <controller id>
  269. Command Parameters: Powered (1 Octet)
  270. Return Parameters: Current_Settings (4 Octets)
  271. This command is used to power on or off a controller. The
  272. allowed Powered command parameter values are 0x00 and 0x01. All
  273. other values will return Invalid Parameters.
  274. If discoverable setting is activated with a timeout, then
  275. switching the controller off will expire this timeout and
  276. disable discoverable.
  277. Settings programmed via Set Advertising and Add/Remove
  278. Advertising while the controller was powered off will be activated
  279. when powering the controller on.
  280. Switching the controller off will permanently cancel and remove
  281. all advertising instances with a timeout set, i.e. time limited
  282. advertising instances are not being remembered across power cycles.
  283. Advertising Removed events will be issued accordingly.
  284. This command generates a Command Complete event on success or
  285. a Command Status event on failure.
  286. Possible errors: Busy
  287. Invalid Parameters
  288. Invalid Index
  289. Set Discoverable Command
  290. ========================
  291. Command Code: 0x0006
  292. Controller Index: <controller id>
  293. Command Parameters: Discoverable (1 Octet)
  294. Timeout (2 Octets)
  295. Return Parameters: Current_Settings (4 Octets)
  296. This command is used to set the discoverable property of a
  297. controller. The allowed Discoverable command parameter values
  298. are 0x00, 0x01 and 0x02. All other values will return Invalid
  299. Parameters.
  300. Timeout is the time in seconds and is only meaningful when
  301. Discoverable is set to 0x01 or 0x02. Providing a timeout
  302. with 0x00 return Invalid Parameters. For 0x02, the timeout
  303. value is required.
  304. The value 0x00 disables discoverable, the value 0x01 enables
  305. general discoverable and the value 0x02 enables limited
  306. discoverable.
  307. This command is only available for BR/EDR capable controllers
  308. (e.g. not for single-mode LE ones). It will return Not Supported
  309. otherwise.
  310. This command can be used when the controller is not powered and
  311. all settings will be programmed once powered.
  312. However using a timeout when the controller is not powered will
  313. return Not Powered error.
  314. When switching discoverable on and the connectable setting is
  315. off it will return Rejected error.
  316. This command generates a Command Complete event on success or
  317. a Command Status event on failure.
  318. Possible errors: Busy
  319. Rejected
  320. Not Supported
  321. Invalid Parameters
  322. Not Powered
  323. Invalid Index
  324. Set Connectable Command
  325. =======================
  326. Command Code: 0x0007
  327. Controller Index: <controller id>
  328. Command Parameters: Connectable (1 Octet)
  329. Return Parameters: Current_Settings (4 Octets)
  330. This command is used to set the connectable property of a
  331. controller. The allowed Connectable command parameter values are
  332. 0x00 and 0x01. All other values will return Invalid Parameters.
  333. This command is available for BR/EDR, LE-only and also dual
  334. mode controllers. For BR/EDR is changes the page scan setting
  335. and for LE controllers it changes the advertising type. For
  336. dual mode controllers it affects both settings.
  337. For LE capable controllers the connectable setting takes effect
  338. when advertising is enabled (peripheral) or when directed
  339. advertising events are received (central).
  340. This command can be used when the controller is not powered and
  341. all settings will be programmed once powered.
  342. When switching connectable off, it will also switch off the
  343. discoverable setting. Switching connectable back on will not
  344. restore a previous discoverable. It will stay off and needs
  345. to be manually switched back on.
  346. When switching connectable off, it will expire a discoverable
  347. setting with a timeout.
  348. This setting does not affect known devices from Add Device
  349. command. These devices are always allowed to connect.
  350. This command generates a Command Complete event on success or
  351. a Command Status event on failure.
  352. Possible errors: Busy
  353. Not Supported
  354. Invalid Parameters
  355. Invalid Index
  356. Set Fast Connectable Command
  357. ============================
  358. Command Code: 0x0008
  359. Controller Index: <controller id>
  360. Command Parameters: Enable (1 Octet)
  361. Return Parameters: Current_Settings (4 Octets)
  362. This command is used to set the controller into a connectable
  363. state where the page scan parameters have been set in a way to
  364. favor faster connect times with the expense of higher power
  365. consumption.
  366. The allowed values of the Enable command parameter are 0x00 and
  367. 0x01. All other values will return Invalid Parameters.
  368. This command is only available for BR/EDR capable controllers
  369. (e.g. not for single-mode LE ones). It will return Not Supported
  370. otherwise.
  371. This command can be used when the controller is not powered and
  372. all settings will be programmed once powered.
  373. The setting will be remembered during power down/up toggles.
  374. This command generates a Command Complete event on success or
  375. a Command Status event on failure.
  376. Possible errors: Failed
  377. Busy
  378. Not Supported
  379. Invalid Parameters
  380. Invalid Index
  381. Set Bondable Command
  382. ====================
  383. Command Code: 0x0009
  384. Controller Index: <controller id>
  385. Command Parameters: Bondable (1 Octet)
  386. Return Parameters: Current_Settings (4 Octets)
  387. This command is used to set the bondable property of an
  388. controller. The allowed values for the Bondable command
  389. parameter are 0x00 and 0x01. All other values will return
  390. Invalid Parameters.
  391. This command can be used when the controller is not powered and
  392. all settings will be programmed once powered.
  393. Turning bondable on will not automatically switch the controller
  394. into connectable mode. That needs to be done separately.
  395. The setting will be remembered during power down/up toggles.
  396. This command generates a Command Complete event on success or
  397. a Command Status event on failure.
  398. Possible errors: Invalid Parameters
  399. Invalid Index
  400. Set Link Security Command
  401. =========================
  402. Command Code: 0x000A
  403. Controller Index: <controller id>
  404. Command Parameters: Link_Security (1 Octet)
  405. Return Parameters: Current_Settings (4 Octets)
  406. This command is used to either enable or disable link level
  407. security for an controller (also known as Security Mode 3). The
  408. allowed values for the Link_Security command parameter are 0x00
  409. and 0x01. All other values will return Invalid Parameters.
  410. This command is only available for BR/EDR capable controllers
  411. (e.g. not for single-mode LE ones). It will return Not Supported
  412. otherwise.
  413. This command can be used when the controller is not powered and
  414. all settings will be programmed once powered.
  415. This command generates a Command Complete event on success or
  416. a Command Status event on failure.
  417. Possible errors: Busy
  418. Not Supported
  419. Invalid Parameters
  420. Invalid Index
  421. Set Secure Simple Pairing Command
  422. =================================
  423. Command Code: 0x000B
  424. Controller Index: <controller id>
  425. Command Parameters: Secure_Simple_Pairing (1 Octet)
  426. Return Parameters: Current_Settings (4 Octets)
  427. This command is used to enable/disable Secure Simple Pairing
  428. support for a controller. The allowed values for the
  429. Secure_Simple_Pairing command parameter are 0x00 and 0x01. All
  430. other values will return Invalid Parameters.
  431. This command is only available for BR/EDR capable controllers
  432. supporting the core specification version 2.1 or greater
  433. (e.g. not for single-mode LE controllers or pre-2.1 ones).
  434. This command can be used when the controller is not powered and
  435. all settings will be programmed once powered.
  436. In case the controller does not support Secure Simple Pairing,
  437. the command will fail regardless with Not Supported error.
  438. This command generates a Command Complete event on success or
  439. a Command Status event on failure.
  440. Possible errors: Busy
  441. Not Supported
  442. Invalid Parameters
  443. Invalid Index
  444. Set High Speed Command
  445. ======================
  446. Command Code: 0x000C
  447. Controller Index: <controller id>
  448. Command Parameters: High_Speed (1 Octet)
  449. Return Parameters: Current_Settings (4 Octets)
  450. This command is used to enable/disable Bluetooth High Speed
  451. support for a controller. The allowed values for the High_Speed
  452. command parameter are 0x00 and 0x01. All other values will
  453. return Invalid Parameters.
  454. This command is only available for BR/EDR capable controllers
  455. (e.g. not for single-mode LE ones).
  456. This command can be used when the controller is not powered and
  457. all settings will be programmed once powered.
  458. To enable High Speed support, it is required that Secure Simple
  459. Pairing support is enabled first. High Speed support is not
  460. possible for connections without Secure Simple Pairing.
  461. When switching Secure Simple Pairing off, the support for High
  462. Speed will be switched off as well. Switching Secure Simple
  463. Pairing back on, will not re-enable High Speed support. That
  464. needs to be done manually.
  465. This command generates a Command Complete event on success or
  466. a Command Status event on failure.
  467. Possible errors: Not Supported
  468. Invalid Parameters
  469. Invalid Index
  470. Set Low Energy Command
  471. ======================
  472. Command Code: 0x000D
  473. Controller Index: <controller id>
  474. Command Parameters: Low_Energy (1 Octet)
  475. Return Parameters: Current_Settings (4 Octets)
  476. This command is used to enable/disable Low Energy support for a
  477. controller. The allowed values of the Low_Energy command
  478. parameter are 0x00 and 0x01. All other values will return
  479. Invalid Parameters.
  480. This command is only available for LE capable controllers and
  481. will yield in a Not Supported error otherwise.
  482. This command can be used when the controller is not powered and
  483. all settings will be programmed once powered.
  484. In case the kernel subsystem does not support Low Energy or the
  485. controller does not either, the command will fail regardless.
  486. Disabling LE support will permanently disable and remove all
  487. advertising instances configured with the Add Advertising
  488. command. Advertising Removed events will be issued accordingly.
  489. This command generates a Command Complete event on success or
  490. a Command Status event on failure.
  491. Possible errors: Busy
  492. Not Supported
  493. Invalid Parameters
  494. Invalid Index
  495. Set Device Class Command
  496. ========================
  497. Command Code: 0x000E
  498. Controller Index: <controller id>
  499. Command Parameters: Major_Class (1 Octet)
  500. Minor_Class (1 Octet)
  501. Return Parameters: Class_Of_Device (3 Octets)
  502. This command is used to set the major and minor device class for
  503. BR/EDR capable controllers.
  504. This command will also implicitly disable caching of pending CoD
  505. and EIR updates.
  506. This command is only available for BR/EDR capable controllers
  507. (e.g. not for single-mode LE ones).
  508. This command can be used when the controller is not powered and
  509. all settings will be programmed once powered.
  510. In case the controller is powered off, 0x000000 will be returned
  511. for the class of device parameter. And after power on the new
  512. value will be announced via class of device changed event.
  513. This command generates a Command Complete event on success or
  514. a Command Status event on failure.
  515. Possible errors: Busy
  516. Not Supported
  517. Invalid Parameters
  518. Invalid Index
  519. Set Local Name Command
  520. ======================
  521. Command Code: 0x000F
  522. Controller Index: <controller id>
  523. Command Parameters: Name (249 Octets)
  524. Short_Name (11 Octets)
  525. Return Parameters: Name (249 Octets)
  526. Short_Name (11 Octets)
  527. This command is used to set the local name of a controller. The
  528. command parameters also include a short name which will be used
  529. in case the full name doesn't fit within EIR/AD data.
  530. The name parameters need to always end with a null byte (failure
  531. to do so will cause the command to fail).
  532. This command can be used when the controller is not powered and
  533. all settings will be programmed once powered.
  534. The values of name and short name will be remembered when
  535. switching the controller off and back on again. So the name
  536. and short name only have to be set once when a new controller
  537. is found and will stay until removed.
  538. This command generates a Command Complete event on success or
  539. a Command Status event on failure.
  540. Possible errors: Invalid Parameters
  541. Invalid Index
  542. Add UUID Command
  543. ================
  544. Command Code: 0x0010
  545. Controller Index: <controller id>
  546. Command Parameters: UUID (16 Octets)
  547. SVC_Hint (1 Octet)
  548. Return Parameters: Class_Of_Device (3 Octets)
  549. This command is used to add a UUID to be published in EIR data.
  550. The accompanied SVC_Hint parameter is used to tell the kernel
  551. whether the service class bits of the Class of Device value need
  552. modifying due to this UUID.
  553. This command can be used when the controller is not powered and
  554. all settings will be programmed once powered.
  555. In case the controller is powered off, 0x000000 will be returned
  556. for the class of device parameter. And after power on the new
  557. value will be announced via class of device changed event.
  558. This command generates a Command Complete event on success or
  559. a Command Status event on failure.
  560. Possible errors: Busy
  561. Invalid Parameters
  562. Invalid Index
  563. Remove UUID Command
  564. ===================
  565. Command Code: 0x0011
  566. Controller Index: <controller id>
  567. Command Parameters: UUID (16 Octets)
  568. Return Parameters: Class_Of_Device (3 Octets)
  569. This command is used to remove a UUID previously added using the
  570. Add UUID command.
  571. When the UUID parameter is an empty UUID (16 x 0x00), then all
  572. previously loaded UUIDs will be removed.
  573. This command can be used when the controller is not powered and
  574. all settings will be programmed once powered.
  575. In case the controller is powered off, 0x000000 will be returned
  576. for the class of device parameter. And after power on the new
  577. value will be announced via class of device changed event.
  578. This command generates a Command Complete event on success or
  579. a Command Status event on failure.
  580. Possible errors: Busy
  581. Invalid Parameters
  582. Invalid Index
  583. Load Link Keys Command
  584. ======================
  585. Command Code: 0x0012
  586. Controller Index: <controller id>
  587. Command Parameters: Debug_Keys (1 Octet)
  588. Key_Count (2 Octets)
  589. Key1 {
  590. Address (6 Octets)
  591. Address_Type (1 Octet)
  592. Key_Type (1 Octet)
  593. Value (16 Octets)
  594. PIN_Length (1 Octet)
  595. }
  596. Key2 { }
  597. ...
  598. Return Parameters:
  599. This command is used to feed the kernel with currently known
  600. link keys. The command does not need to be called again upon the
  601. receipt of New Link Key events since the kernel updates its list
  602. automatically.
  603. The Debug_Keys parameter is used to tell the kernel whether to
  604. accept the usage of debug keys or not. The allowed values for
  605. this parameter are 0x00 and 0x01. All other values will return
  606. an Invalid Parameters response.
  607. Usage of the Debug_Keys parameter is deprecated and has been
  608. replaced with the Set Debug Keys command. When setting the
  609. Debug_Keys option via Load Link Keys command it has the same
  610. affect as setting it via Set Debug Keys and applies to all
  611. keys in the system.
  612. Possible values for the Address_Type parameter:
  613. 0 BR/EDR
  614. 1 Reserved (not in use)
  615. 2 Reserved (not in use)
  616. Public and random LE addresses are not valid and will be rejected.
  617. Currently defined Key_Type values are:
  618. 0x00 Combination key
  619. 0x01 Local Unit key
  620. 0x02 Remote Unit key
  621. 0x03 Debug Combination key
  622. 0x04 Unauthenticated Combination key from P-192
  623. 0x05 Authenticated Combination key from P-192
  624. 0x06 Changed Combination key
  625. 0x07 Unauthenticated Combination key from P-256
  626. 0x08 Authenticated Combination key from P-256
  627. This command can be used when the controller is not powered.
  628. This command generates a Command Complete event on success or
  629. a Command Status event on failure.
  630. Possible errors: Invalid Parameters
  631. Invalid Index
  632. Load Long Term Keys Command
  633. ===========================
  634. Command Code: 0x0013
  635. Controller Index: <controller id>
  636. Command Parameters: Key_Count (2 Octets)
  637. Key1 {
  638. Address (6 Octets)
  639. Address_Type (1 Octet)
  640. Key_Type (1 Octet)
  641. Central (1 Octet)
  642. Encryption_Size (1 Octet)
  643. Encryption_Diversifier (2 Octets)
  644. Random_Number (8 Octets)
  645. Value (16 Octets)
  646. }
  647. Key2 { }
  648. ...
  649. Return Parameters:
  650. This command is used to feed the kernel with currently known
  651. (SMP) Long Term Keys. The command does not need to be called
  652. again upon the receipt of New Long Term Key events since the
  653. kernel updates its list automatically.
  654. Possible values for the Address_Type parameter:
  655. 0 Reserved (not in use)
  656. 1 LE Public
  657. 2 LE Random
  658. The provided Address and Address_Type are the identity of
  659. a device. So either its public address or static random address.
  660. Unresolvable random addresses and resolvable random addresses are
  661. not valid and will be rejected.
  662. Currently defined Key_Type values are:
  663. 0x00 Unauthenticated key
  664. 0x01 Authenticated key
  665. This command can be used when the controller is not powered.
  666. This command generates a Command Complete event on success or
  667. a Command Status event on failure.
  668. Possible errors: Invalid Parameters
  669. Invalid Index
  670. Disconnect Command
  671. ==================
  672. Command Code: 0x0014
  673. Controller Index: <controller id>
  674. Command Parameters: Address (6 Octets)
  675. Address_Type (1 Octet)
  676. Return Parameters: Address (6 Octets)
  677. Address_Type (1 Octet)
  678. This command is used to force the disconnection of a currently
  679. connected device.
  680. Possible values for the Address_Type parameter:
  681. 0 BR/EDR
  682. 1 LE Public
  683. 2 LE Random
  684. This command can only be used when the controller is powered.
  685. This command generates a Command Complete event on success
  686. or failure.
  687. Possible errors: Not Connected
  688. Busy
  689. Invalid Parameters
  690. Not Powered
  691. Invalid Index
  692. Get Connections Command
  693. =======================
  694. Command Code: 0x0015
  695. Controller Index: <controller id>
  696. Command Parameters:
  697. Return Parameters: Connection_Count (2 Octets)
  698. Address1 {
  699. Address (6 Octets)
  700. Address_Type (1 Octet)
  701. }
  702. Address2 { }
  703. ...
  704. This command is used to retrieve a list of currently connected
  705. devices.
  706. Possible values for the Address_Type parameter:
  707. 0 BR/EDR
  708. 1 LE Public
  709. 2 LE Random
  710. For devices using resolvable random addresses with a known
  711. identity resolving key, the Address and Address_Type will
  712. contain the identity information.
  713. This command can only be used when the controller is powered.
  714. This command generates a Command Complete event on success or
  715. a Command Status event on failure.
  716. Possible errors: Invalid Parameters
  717. Not Powered
  718. Invalid Index
  719. PIN Code Reply Command
  720. =======================
  721. Command Code: 0x0016
  722. Controller Index: <controller id>
  723. Command Parameters: Address (6 Octets)
  724. Address_Type (1 Octet)
  725. PIN_Length (1 Octet)
  726. PIN_Code (16 Octets)
  727. Return Parameters: Address (6 Octets)
  728. Address_Type (1 Octet)
  729. This command is used to respond to a PIN Code request event.
  730. Possible values for the Address_Type parameter:
  731. 0 BR/EDR
  732. 1 LE Public
  733. 2 LE Random
  734. This command can only be used when the controller is powered.
  735. This command generates a Command Complete event on success
  736. or failure.
  737. Possible errors: Not Connected
  738. Invalid Parameters
  739. Not Powered
  740. Invalid Index
  741. PIN Code Negative Reply Command
  742. ===============================
  743. Command Code: 0x0017
  744. Controller Index: <controller id>
  745. Command Parameters: Address (6 Octets)
  746. Address_Type (1 Octet)
  747. Return Parameters: Address (6 Octets)
  748. Address_Type (1 Octet)
  749. This command is used to return a negative response to a PIN Code
  750. Request event.
  751. Possible values for the Address_Type parameter:
  752. 0 BR/EDR
  753. 1 LE Public
  754. 2 LE Random
  755. This command can only be used when the controller is powered.
  756. This command generates a Command Complete event on success
  757. or failure.
  758. Possible errors: Not Connected
  759. Invalid Parameters
  760. Not Powered
  761. Invalid Index
  762. Set IO Capability Command
  763. =========================
  764. Command Code: 0x0018
  765. Controller Index: <controller id>
  766. Command Parameters: IO_Capability (1 Octet)
  767. Return Parameters:
  768. This command is used to set the IO Capability used for pairing.
  769. The command accepts both SSP and SMP values.
  770. Possible values for the IO_Capability parameter:
  771. 0 DisplayOnly
  772. 1 DisplayYesNo
  773. 2 KeyboardOnly
  774. 3 NoInputNoOutput
  775. 4 KeyboardDisplay
  776. Passing a value 4 (KeyboardDisplay) will cause the kernel to
  777. convert it to 1 (DisplayYesNo) in the case of a BR/EDR
  778. connection (as KeyboardDisplay is specific to SMP).
  779. This command can be used when the controller is not powered.
  780. This command generates a Command Complete event on success or
  781. a Command Status event on failure.
  782. Possible errors: Invalid Parameters
  783. Invalid Index
  784. Pair Device Command
  785. ===================
  786. Command Code: 0x0019
  787. Controller Index: <controller id>
  788. Command Parameters: Address (6 Octets)
  789. Address_Type (1 Octet)
  790. IO_Capability (1 Octet)
  791. Return Parameters: Address (6 Octets)
  792. Address_Type (1 Octet)
  793. This command is used to trigger pairing with a remote device.
  794. The IO_Capability command parameter is used to temporarily (for
  795. this pairing event only) override the global IO Capability (set
  796. using the Set IO Capability command).
  797. Possible values for the Address_Type parameter:
  798. 0 BR/EDR
  799. 1 LE Public
  800. 2 LE Random
  801. Possible values for the IO_Capability parameter:
  802. 0 DisplayOnly
  803. 1 DisplayYesNo
  804. 2 KeyboardOnly
  805. 3 NoInputNoOutput
  806. 4 KeyboardDisplay
  807. Passing a value 4 (KeyboardDisplay) will cause the kernel to
  808. convert it to 1 (DisplayYesNo) in the case of a BR/EDR
  809. connection (as KeyboardDisplay is specific to SMP).
  810. The Address and Address_Type of the return parameters will
  811. return the identity address if known. In case of resolvable
  812. random address given as command parameters and the remote
  813. provides an identity resolving key, the return parameters
  814. will provide the resolved address.
  815. To allow tracking of which resolvable random address changed
  816. into which identity address, the New Identity Resolving Key
  817. event will be sent before receiving Command Complete event
  818. for this command.
  819. This command can only be used when the controller is powered.
  820. This command generates a Command Complete event on success
  821. or failure.
  822. Reject status is used when requested transport is not enabled.
  823. Not Supported status is used if controller is not capable with
  824. requested transport.
  825. Possible errors: Rejected
  826. Not Supported
  827. Connect Failed
  828. Busy
  829. Invalid Parameters
  830. Not Powered
  831. Invalid Index
  832. Already Paired
  833. Cancel Pair Device Command
  834. ==========================
  835. Command Code: 0x001A
  836. Controller Index: <controller id>
  837. Command Parameters: Address (6 Octets)
  838. Address_Type (1 Octet)
  839. Return Parameters: Address (6 Octets)
  840. Address_Type (1 Octet)
  841. The Address and Address_Type parameters should match what was
  842. given to a preceding Pair Device command.
  843. Possible values for the Address_Type parameter:
  844. 0 BR/EDR
  845. 1 LE Public
  846. 2 LE Random
  847. This command can only be used when the controller is powered.
  848. This command generates a Command Complete event on success
  849. or failure.
  850. Possible errors: Invalid Parameters
  851. Not Powered
  852. Invalid Index
  853. Unpair Device Command
  854. =====================
  855. Command Code: 0x001B
  856. Controller Index: <controller id>
  857. Command Parameters: Address (6 Octets)
  858. Address_Type (1 Octet)
  859. Disconnect (1 Octet)
  860. Return Parameters: Address (6 Octets)
  861. Address_Type (1 Octet)
  862. Removes all keys associated with the remote device.
  863. Possible values for the Address_Type parameter:
  864. 0 BR/EDR
  865. 1 LE Public
  866. 2 LE Random
  867. The Disconnect parameter tells the kernel whether to forcefully
  868. disconnect any existing connections to the device. It should in
  869. practice always be 1 except for some special GAP qualification
  870. test-cases where a key removal without disconnecting is needed.
  871. When unpairing a device its link key, long term key and if
  872. provided identity resolving key will be purged.
  873. For devices using resolvable random addresses where the identity
  874. resolving key was available, after this command they will now no
  875. longer be resolved. The device will essentially become private
  876. again.
  877. This command can only be used when the controller is powered.
  878. This command generates a Command Complete event on success
  879. or failure.
  880. Possible errors: Not Paired
  881. Invalid Parameters
  882. Not Powered
  883. Invalid Index
  884. User Confirmation Reply Command
  885. ===============================
  886. Command Code: 0x001C
  887. Controller Index: <controller id>
  888. Command Parameters: Address (6 Octets)
  889. Address_Type (1 Octet)
  890. Return Parameters: Address (6 Octets)
  891. Address_Type (1 Octet)
  892. This command is used to respond to a User Confirmation Request
  893. event.
  894. Possible values for the Address_Type parameter:
  895. 0 BR/EDR
  896. 1 LE Public
  897. 2 LE Random
  898. This command can only be used when the controller is powered.
  899. This command generates a Command Complete event on success
  900. or failure.
  901. Possible errors: Not Connected
  902. Invalid Parameters
  903. Not Powered
  904. Invalid Index
  905. User Confirmation Negative Reply Command
  906. ========================================
  907. Command Code: 0x001D
  908. Controller Index: <controller id>
  909. Command Parameters: Address (6 Octets)
  910. Address_Type (1 Octet)
  911. Return Parameters: Address (6 Octets)
  912. Address_Type (1 Octet)
  913. This command is used to return a negative response to a User
  914. Confirmation Request event.
  915. Possible values for the Address_Type parameter:
  916. 0 BR/EDR
  917. 1 LE Public
  918. 2 LE Random
  919. This command can only be used when the controller is powered.
  920. This command generates a Command Complete event on success
  921. or failure.
  922. Possible errors: Not Connected
  923. Invalid Parameters
  924. Not Powered
  925. Invalid Index
  926. User Passkey Reply Command
  927. ==========================
  928. Command Code: 0x001E
  929. Controller Index: <controller id>
  930. Command Parameters: Address (6 Octets)
  931. Address_Type (1 Octet)
  932. Passkey (4 Octets)
  933. Return Parameters: Address (6 Octets)
  934. Address_Type (1 Octet)
  935. This command is used to respond to a User Confirmation Passkey
  936. Request event.
  937. Possible values for the Address_Type parameter:
  938. 0 BR/EDR
  939. 1 LE Public
  940. 2 LE Random
  941. This command can only be used when the controller is powered.
  942. This command generates a Command Complete event on success
  943. or failure.
  944. Possible errors: Not Connected
  945. Invalid Parameters
  946. Not Powered
  947. Invalid Index
  948. User Passkey Negative Reply Command
  949. ===================================
  950. Command Code: 0x001F
  951. Controller Index: <controller id>
  952. Command Parameters: Address (6 Octets)
  953. Address_Type (1 Octet)
  954. Return Parameters: Address (6 Octets)
  955. Address_Type (1 Octet)
  956. This command is used to return a negative response to a User
  957. Passkey Request event.
  958. Possible values for the Address_Type parameter:
  959. 0 BR/EDR
  960. 1 LE Public
  961. 2 LE Random
  962. This command can only be used when the controller is powered.
  963. This command generates a Command Complete event on success
  964. or failure.
  965. Possible errors: Not Connected
  966. Invalid Parameters
  967. Not Powered
  968. Invalid Index
  969. Read Local Out Of Band Data Command
  970. ===================================
  971. Command Code: 0x0020
  972. Controller Index: <controller id>
  973. Command Parameters:
  974. Return Parameters: Hash_192 (16 Octets)
  975. Randomizer_192 (16 Octets)
  976. Hash_256 (16 Octets, Optional)
  977. Randomizer_256 (16 Octets, Optional)
  978. This command is used to read the local Out of Band data.
  979. This command can only be used when the controller is powered.
  980. If Secure Connections support is enabled, then this command
  981. will return P-192 versions of hash and randomizer as well as
  982. P-256 versions of both.
  983. Values returned by this command become invalid when the controller
  984. is powered down. After each power-cycle it is required to call
  985. this command again to get updated values.
  986. This command generates a Command Complete event on success or
  987. a Command Status event on failure.
  988. Possible errors: Not Supported
  989. Busy
  990. Invalid Parameters
  991. Not Powered
  992. Invalid Index
  993. Add Remote Out Of Band Data Command
  994. ===================================
  995. Command Code: 0x0021
  996. Controller Index: <controller id>
  997. Command Parameters: Address (6 Octets)
  998. Address_Type (1 Octet)
  999. Hash_192 (16 Octets)
  1000. Randomizer_192 (16 Octets)
  1001. Hash_256 (16 Octets, Optional)
  1002. Randomizer_256 (16 Octets, Optional)
  1003. Return Parameters: Address (6 Octets)
  1004. Address_Type (1 Octet)
  1005. This command is used to provide Out of Band data for a remote
  1006. device.
  1007. Possible values for the Address_Type parameter:
  1008. 0 BR/EDR
  1009. 1 LE Public
  1010. 2 LE Random
  1011. Provided Out Of Band data is persistent over power down/up toggles.
  1012. This command also accept optional P-256 versions of hash and
  1013. randomizer. If they are not provided, then they are set to
  1014. zero value.
  1015. The P-256 versions of both can also be provided when the
  1016. support for Secure Connections is not enabled. However in
  1017. that case they will never be used.
  1018. To only provide the P-256 versions of hash and randomizer,
  1019. it is valid to leave both P-192 fields as zero values. If
  1020. Secure Connections is disabled, then of course this is the
  1021. same as not providing any data at all.
  1022. When providing data for remote LE devices, then the Hash_192 and
  1023. and Randomizer_192 fields are not used and shell be set to zero.
  1024. The Hash_256 and Randomizer_256 fields can be used for LE secure
  1025. connections Out Of Band data. If only LE secure connections data
  1026. is provided the Hash_P192 and Randomizer_P192 fields can be set
  1027. to zero. Currently there is no support for providing the Security
  1028. Manager TK Value for LE legacy pairing.
  1029. If Secure Connections Only mode has been enabled, then providing
  1030. Hash_P192 and Randomizer_P192 is not allowed. They are required
  1031. to be set to zero values.
  1032. This command can be used when the controller is not powered and
  1033. all settings will be programmed once powered.
  1034. This command generates a Command Complete event on success
  1035. or failure.
  1036. Possible errors: Failed
  1037. Invalid Parameters
  1038. Not Powered
  1039. Invalid Index
  1040. Remove Remote Out Of Band Data Command
  1041. ======================================
  1042. Command Code: 0x0022
  1043. Controller Index: <controller id>
  1044. Command Parameters: Address (6 Octets)
  1045. Address_Type (1 Octet)
  1046. Return Parameters: Address (6 Octets)
  1047. Address_Type (1 Octet)
  1048. This command is used to remove data added using the Add Remote
  1049. Out Of Band Data command.
  1050. Possible values for the Address_Type parameter:
  1051. 0 BR/EDR
  1052. 1 LE Public
  1053. 2 LE Random
  1054. When the Address parameter is 00:00:00:00:00:00, then all
  1055. previously added data will be removed.
  1056. This command can be used when the controller is not powered and
  1057. all settings will be programmed once powered.
  1058. This command generates a Command Complete event on success
  1059. or failure.
  1060. Possible errors: Invalid Parameters
  1061. Not Powered
  1062. Invalid Index
  1063. Start Discovery Command
  1064. =======================
  1065. Command Code: 0x0023
  1066. Controller Index: <controller id>
  1067. Command Parameters: Address_Type (1 Octet)
  1068. Return Parameters: Address_Type (1 Octet)
  1069. This command is used to start the process of discovering remote
  1070. devices. A Device Found event will be sent for each discovered
  1071. device.
  1072. Possible values for the Address_Type parameter are a bit-wise or
  1073. of the following bits:
  1074. 0 BR/EDR
  1075. 1 LE Public
  1076. 2 LE Random
  1077. By combining these e.g. the following values are possible:
  1078. 1 BR/EDR
  1079. 6 LE (public & random)
  1080. 7 BR/EDR/LE (interleaved discovery)
  1081. This command can only be used when the controller is powered.
  1082. This command generates a Command Complete event on success
  1083. or failure.
  1084. Possible errors: Busy
  1085. Not Supported
  1086. Invalid Parameters
  1087. Not Powered
  1088. Invalid Index
  1089. Stop Discovery Command
  1090. ======================
  1091. Command Code: 0x0024
  1092. Controller Index: <controller id>
  1093. Command Parameters: Address_Type (1 Octet)
  1094. Return Parameters: Address_Type (1 Octet)
  1095. This command is used to stop the discovery process started using
  1096. the Start Discovery command.
  1097. This command can only be used when the controller is powered.
  1098. This command generates a Command Complete event on success
  1099. or failure.
  1100. Possible errors: Rejected
  1101. Invalid Parameters
  1102. Invalid Index
  1103. Confirm Name Command
  1104. ====================
  1105. Command Code: 0x0025
  1106. Controller Index: <controller id>
  1107. Command Parameters: Address (6 Octets)
  1108. Address_Type (1 Octet)
  1109. Name_Known (1 Octet)
  1110. Return Parameters: Address (6 Octets)
  1111. Address_Type (1 Octet)
  1112. This command is only valid during device discovery and is
  1113. expected for each Device Found event with the Confirm Name
  1114. flag set.
  1115. Possible values for the Address_Type parameter:
  1116. 0 BR/EDR
  1117. 1 LE Public
  1118. 2 LE Random
  1119. The Name_Known parameter should be set to 0x01 if user space
  1120. knows the name for the device and 0x00 if it doesn't. If set to
  1121. 0x00 the kernel will perform a name resolving procedure for the
  1122. device in question.
  1123. This command can only be used when the controller is powered.
  1124. This command generates a Command Complete event on success
  1125. or failure.
  1126. Possible errors: Failed
  1127. Invalid Parameters
  1128. Invalid Index
  1129. Block Device Command
  1130. ====================
  1131. Command Code: 0x0026
  1132. Controller Index: <controller id>
  1133. Command Parameters: Address (6 Octets)
  1134. Address_Type (1 Octet)
  1135. Return Parameters: Address (6 Octets)
  1136. Address_Type (1 Octet)
  1137. This command is used to add a device to the list of devices
  1138. which should be blocked from being connected to the local
  1139. controller.
  1140. Possible values for the Address_Type parameter:
  1141. 0 BR/EDR
  1142. 1 LE Public
  1143. 2 LE Random
  1144. For Low Energy devices, the blocking of a device takes precedence
  1145. over auto-connection actions provided by Add Device. Blocked
  1146. devices will not be auto-connected or even reported when found
  1147. during background scanning. If the controller is connectable
  1148. direct advertising from blocked devices will also be ignored.
  1149. Connections created from advertising of the controller will
  1150. be dropped if the device is blocked.
  1151. This command can be used when the controller is not powered.
  1152. This command generates a Command Complete event on success
  1153. or failure.
  1154. Possible errors: Failed
  1155. Invalid Parameters
  1156. Invalid Index
  1157. Unblock Device Command
  1158. ======================
  1159. Command Code: 0x0027
  1160. Controller Index: <controller id>
  1161. Command Parameters: Address (6 Octets)
  1162. Address_Type (1 Octet)
  1163. Return Parameters: Address (6 Octets)
  1164. Address_Type (1 Octet)
  1165. This command is used to remove a device from the list of blocked
  1166. devices (where it was added to using the Block Device command).
  1167. Possible values for the Address_Type parameter:
  1168. 0 BR/EDR
  1169. 1 LE Public
  1170. 2 LE Random
  1171. When the Address parameter is 00:00:00:00:00:00, then all
  1172. previously blocked devices will be unblocked.
  1173. This command can be used when the controller is not powered.
  1174. This command generates a Command Complete event on success
  1175. or failure.
  1176. Possible errors: Invalid Parameters
  1177. Invalid Index
  1178. Set Device ID Command
  1179. =====================
  1180. Command Code: 0x0028
  1181. Controller Index: <controller id>
  1182. Command Parameters: Source (2 Octets)
  1183. Vendor (2 Octets)
  1184. Product (2 Octets)
  1185. Version (2 Octets)
  1186. Return Parameters:
  1187. This command can be used when the controller is not powered and
  1188. all settings will be programmed once powered.
  1189. The Source parameter selects the organization that assigned the
  1190. Vendor parameter:
  1191. 0x0000 Disable Device ID
  1192. 0x0001 Bluetooth SIG
  1193. 0x0002 USB Implementer's Forum
  1194. The information is put into the EIR data. If the controller does
  1195. not support EIR or if SSP is disabled, this command will still
  1196. succeed. The information is stored for later use and will survive
  1197. toggling SSP on and off.
  1198. This command generates a Command Complete event on success or
  1199. a Command Status event on failure.
  1200. Possible errors: Invalid Parameters
  1201. Invalid Index
  1202. Set Advertising Command
  1203. =======================
  1204. Command Code: 0x0029
  1205. Controller Index: <controller id>
  1206. Command Parameters: Advertising (1 Octet)
  1207. Return Parameters: Current_Settings (4 Octets)
  1208. This command is used to enable LE advertising on a controller
  1209. that supports it. The allowed values for the Advertising command
  1210. parameter are 0x00, 0x01 and 0x02. All other values will return
  1211. Invalid Parameters.
  1212. The value 0x00 disables advertising, the value 0x01 enables
  1213. advertising with considering of connectable setting and the
  1214. value 0x02 enables advertising in connectable mode.
  1215. Using value 0x01 means that when connectable setting is disabled,
  1216. the advertising happens with undirected non-connectable advertising
  1217. packets and a non-resolvable random address is used. If connectable
  1218. setting is enabled, then undirected connectable advertising packets
  1219. and the identity address or resolvable private address are used.
  1220. LE Devices configured via Add Device command with Action 0x01
  1221. have no effect when using Advertising value 0x01 since only the
  1222. connectable setting is taken into account.
  1223. To utilize undirected connectable advertising without changing the
  1224. connectable setting, the value 0x02 can be utilized. It makes the
  1225. device connectable via LE without the requirement for being
  1226. connectable on BR/EDR (and/or LE).
  1227. The value 0x02 should be the preferred mode of operation when
  1228. implementing peripheral mode.
  1229. Using this command will temporarily deactivate any configuration
  1230. made by the Add Advertising command. This command takes precedence.
  1231. Once a Set Advertising command with value 0x00 is issued any
  1232. previously made configurations via Add/Remove Advertising, including
  1233. such changes made while Set Advertising was active, will be re-
  1234. enabled.
  1235. A pre-requisite is that LE is already enabled, otherwise this
  1236. command will return a "rejected" response.
  1237. This command generates a Command Complete event on success or a
  1238. Command Status event on failure.
  1239. Possible errors: Busy
  1240. Rejected
  1241. Not Supported
  1242. Invalid Parameters
  1243. Invalid Index
  1244. Set BR/EDR Command
  1245. ==================
  1246. Command Code: 0x002A
  1247. Controller Index: <controller id>
  1248. Command Parameters: BR/EDR (1 Octet)
  1249. Return Parameters: Current_Settings (4 Octets)
  1250. This command is used to enable or disable BR/EDR support
  1251. on a dual-mode controller. The allowed values for the Advertising
  1252. command parameter are 0x00 and 0x01. All other values will
  1253. return Invalid Parameters.
  1254. A pre-requisite is that LE is already enabled, otherwise
  1255. this command will return a "rejected" response. Enabling BR/EDR
  1256. can be done both when powered on and powered off, however
  1257. disabling it can only be done when powered off (otherwise the
  1258. command will again return "rejected"). Disabling BR/EDR will
  1259. automatically disable all other BR/EDR related settings.
  1260. This command generates a Command Complete event on success or a
  1261. Command Status event on failure.
  1262. Possible errors: Busy
  1263. Rejected
  1264. Not Supported
  1265. Invalid Parameters
  1266. Invalid Index
  1267. Set Static Address Command
  1268. ==========================
  1269. Command Code: 0x002B
  1270. Controller Index: <controller id>
  1271. Command Parameters: Address (6 Octets)
  1272. Return Parameters: Current_Settings (4 Octets)
  1273. This command allows for setting the static random address. It is
  1274. only supported on controllers with LE support. The static random
  1275. address is suppose to be valid for the lifetime of the
  1276. controller or at least until the next power cycle. To ensure
  1277. such behavior, setting of the address is limited to when the
  1278. controller is powered off.
  1279. The special BDADDR_ANY address (00:00:00:00:00:00) can be used
  1280. to disable the static address.
  1281. When a controller has a public address (which is required for
  1282. all dual-mode controllers), this address is not used. If a dual-mode
  1283. controller is configured as Low Energy only devices (BR/EDR has
  1284. been switched off), then the static address is used. Only when
  1285. the controller information reports BDADDR_ANY (00:00:00:00:00:00),
  1286. it is required to configure a static address first.
  1287. If privacy mode is enabled and the controller is single mode
  1288. LE only without a public address, the static random address is
  1289. used as identity address.
  1290. The Static Address flag from the current settings can also be used
  1291. to determine if the configured static address is in use or not.
  1292. This command generates a Command Complete event on success or a
  1293. Command Status event on failure.
  1294. Possible errors: Rejected
  1295. Not Supported
  1296. Invalid Parameters
  1297. Invalid Index
  1298. Set Scan Parameters Command
  1299. ===========================
  1300. Command Code: 0x002C
  1301. Controller Index: <controller id>
  1302. Command Parameters: Interval (2 Octets)
  1303. Window (2 Octets)
  1304. Return Parameters:
  1305. This command allows for setting the Low Energy scan parameters
  1306. used for connection establishment and passive scanning. It is
  1307. only supported on controllers with LE support.
  1308. This command generates a Command Complete event on success or a
  1309. Command Status event on failure.
  1310. Possible errors: Rejected
  1311. Not Supported
  1312. Invalid Parameters
  1313. Invalid Index
  1314. Set Secure Connections Command
  1315. ==============================
  1316. Command Code: 0x002D
  1317. Controller Index: <controller id>
  1318. Command Parameters: Secure_Connections (1 Octet)
  1319. Return Parameters: Current_Settings (4 Octets)
  1320. This command is used to enable/disable Secure Connections
  1321. support for a controller. The allowed values for the
  1322. Secure_Connections command parameter are 0x00, 0x01 and 0x02.
  1323. All other values will return Invalid Parameters.
  1324. The value 0x00 disables Secure Connections, the value 0x01
  1325. enables Secure Connections and the value 0x02 enables Secure
  1326. Connections Only mode.
  1327. This command is only available for LE capable controllers as
  1328. well as controllers supporting the core specification version
  1329. 4.1 or greater.
  1330. This command can be used when the controller is not powered and
  1331. all settings will be programmed once powered.
  1332. In case the controller does not support Secure Connections
  1333. the command will fail regardless with Not Supported error.
  1334. This command generates a Command Complete event on success or
  1335. a Command Status event on failure.
  1336. Possible errors: Busy
  1337. Not Supported
  1338. Invalid Parameters
  1339. Invalid Index
  1340. Set Debug Keys Command
  1341. ======================
  1342. Command Code: 0x002E
  1343. Controller Index: <controller id>
  1344. Command Parameters: Debug_Keys (1 Octet)
  1345. Return Parameters: Current_Settings (4 Octets)
  1346. This command is used to tell the kernel whether to accept the
  1347. usage of debug keys or not. The allowed values for this parameter
  1348. are 0x00, 0x01 and 0x02. All other values will return an Invalid
  1349. Parameters response.
  1350. With a value of 0x00 any generated debug key will be discarded
  1351. as soon as the connection terminates.
  1352. With a value of 0x01 generated debug keys will be kept and can
  1353. be used for future connections. However debug keys are always
  1354. marked as non persistent and should not be stored. This means
  1355. a reboot or changing the value back to 0x00 will delete them.
  1356. With a value of 0x02 generated debug keys will be kept and can
  1357. be used for future connections. This has the same affect as
  1358. with value 0x01. However in addition this value will also
  1359. enter the controller mode to generate debug keys for each
  1360. new pairing. Changing the value back to 0x01 or 0x00 will
  1361. disable the controller mode for generating debug keys.
  1362. This command generates a Command Complete event on success or
  1363. a Command Status event on failure.
  1364. Possible errors: Busy
  1365. Not Supported
  1366. Invalid Parameters
  1367. Invalid Index
  1368. Set Privacy Command
  1369. ===================
  1370. Command Code: 0x002F
  1371. Controller Index: <controller id>
  1372. Command Parameters: Privacy (1 Octet)
  1373. Identity_Resolving_Key (16 Octets)
  1374. Return Parameters: Current_Settings (4 Octets)
  1375. This command is used to enable Low Energy Privacy feature using
  1376. resolvable private addresses.
  1377. The value 0x00 disables privacy mode, the values 0x01 and 0x02
  1378. enable privacy mode.
  1379. With value 0x01 the kernel will always use the privacy mode. This
  1380. means resolvable private address is used when the controller is
  1381. discoverable and also when pairing is initiated.
  1382. With value 0x02 the kernel will use a limited privacy mode with a
  1383. resolvable private address except when the controller is bondable
  1384. and discoverable, in which case the identity address is used.
  1385. Exposing the identity address when bondable and discoverable or
  1386. during initiated pairing can be a privacy issue. For dual-mode
  1387. controllers this can be neglected since its public address will
  1388. be exposed over BR/EDR anyway. The benefit of exposing the
  1389. identity address for pairing purposes is that it makes matching
  1390. up devices with dual-mode topology during device discovery now
  1391. possible.
  1392. If the privacy value 0x02 is used, then also the GATT database
  1393. should expose the Privacy Characteristic so that remote devices
  1394. can determine if the privacy feature is in use or not.
  1395. When the controller has a public address (mandatory for dual-mode
  1396. controllers) it is used as identity address. In case the controller
  1397. is single mode LE only without a public address, it is required
  1398. to configure a static random address first. The privacy mode can
  1399. only be enabled when an identity address is available.
  1400. The Identity_Resolving_Key is the local key assigned for the local
  1401. resolvable private address.
  1402. Possible errors: Busy
  1403. Not Supported
  1404. Invalid Parameters
  1405. Invalid Index
  1406. Load Identity Resolving Keys Command
  1407. ====================================
  1408. Command Code: 0x0030
  1409. Controller Index: <controller id>
  1410. Command Parameters: Key_Count (2 Octets)
  1411. Key1 {
  1412. Address (6 Octets)
  1413. Address_Type (1 Octet)
  1414. Value (16 Octets)
  1415. }
  1416. Key2 { }
  1417. ...
  1418. Return Parameters:
  1419. This command is used to feed the kernel with currently known
  1420. identity resolving keys. The command does not need to be called
  1421. again upon the receipt of New Identity Resolving Key events
  1422. since the kernel updates its list automatically.
  1423. Possible values for the Address_Type parameter:
  1424. 0 Reserved (not in use)
  1425. 1 LE Public
  1426. 2 LE Random
  1427. The provided Address and Address_Type are the identity of
  1428. a device. So either its public address or static random address.
  1429. Unresolvable random addresses and resolvable random addresses are
  1430. not valid and will be rejected.
  1431. This command can be used when the controller is not powered.
  1432. This command generates a Command Complete event on success or
  1433. a Command Status event on failure.
  1434. Possible errors: Invalid Parameters
  1435. Invalid Index
  1436. Get Connection Information Command
  1437. ==================================
  1438. Command Code: 0x0031
  1439. Controller Index: <controller id>
  1440. Command Parameters: Address (6 Octets)
  1441. Address_Type (1 Octet)
  1442. Return Parameters: Address (6 Octets)
  1443. Address_Type (1 Octet)
  1444. RSSI (1 Octet)
  1445. TX_Power (1 Octet)
  1446. Max_TX_Power (1 Octet)
  1447. This command is used to get connection information.
  1448. Possible values for the Address_Type parameter:
  1449. 0 BR/EDR
  1450. 1 LE Public
  1451. 2 LE Random
  1452. TX_Power and Max_TX_Power can be set to 127 if values are invalid or
  1453. unknown. A value of 127 for RSSI indicates that it is not available.
  1454. This command generates a Command Complete event on success and
  1455. on failure. In case of failure only Address and Address_Type fields
  1456. are valid and values of remaining parameters are considered invalid
  1457. and shall be ignored.
  1458. Possible errors: Not Connected
  1459. Not Powered
  1460. Invalid Parameters
  1461. Invalid Index
  1462. Get Clock Information Command
  1463. =============================
  1464. Command Code: 0x0032
  1465. Controller Index: <controller id>
  1466. Command Parameters: Address (6 Octets)
  1467. Address_Type (1 Octet)
  1468. Return Parameters: Address (6 Octets)
  1469. Address_Type (1 Octet)
  1470. Local_Clock (4 Octets)
  1471. Piconet_Clock (4 Octets)
  1472. Accuracy (2 Octets)
  1473. This command is used to get local and piconet clock information.
  1474. Possible values for the Address_Type parameter:
  1475. 0 BR/EDR
  1476. 1 Reserved (not in use)
  1477. 2 Reserved (not in use)
  1478. The Accuracy can be set to 0xffff which means the value is unknown.
  1479. If the Address is set to 00:00:00:00:00:00, then only the
  1480. Local_Clock field has a valid value. The Piconet_Clock and
  1481. Accuracy fields are invalid and shall be ignored.
  1482. This command generates a Command Complete event on success and
  1483. on failure. In case of failure only Address and Address_Type fields
  1484. are valid and values of remaining parameters are considered invalid
  1485. and shall be ignored.
  1486. Possible errors: Not Connected
  1487. Not Powered
  1488. Invalid Parameters
  1489. Invalid Index
  1490. Add Device Command
  1491. ==================
  1492. Command Code: 0x0033
  1493. Controller Index: <controller id>
  1494. Command Parameters: Address (6 Octets)
  1495. Address_Type (1 Octet)
  1496. Action (1 Octet)
  1497. Return Parameters: Address (6 Octets)
  1498. Address_Type (1 Octet)
  1499. This command is used to add a device to the action list. The
  1500. action list allows scanning for devices and enables incoming
  1501. connections from known devices.
  1502. Possible values for the Address_Type parameter:
  1503. 0 BR/EDR
  1504. 1 LE Public
  1505. 2 LE Random
  1506. Possible values for the Action parameter:
  1507. 0 Background scan for device
  1508. 1 Allow incoming connection
  1509. 2 Auto-connect remote device
  1510. With the Action 0, when the device is found, a new Device Found
  1511. event will be sent indicating this device is available. This
  1512. action is only valid for LE Public and LE Random address types.
  1513. With the Action 1, the device is allowed to connect. For BR/EDR
  1514. address type this means an incoming connection. For LE Public
  1515. and LE Random address types, a connection will be established
  1516. to devices using directed advertising. If successful a Device
  1517. Connected event will be sent.
  1518. With the Action 2, when the device is found, it will be connected
  1519. and if successful a Device Connected event will be sent. This
  1520. action is only valid for LE Public and LE Random address types.
  1521. When a device is blocked using Block Device command, then it is
  1522. valid to add the device here, but all actions will be ignored
  1523. until the device is unblocked.
  1524. Devices added with Action 1 are allowed to connect even if the
  1525. connectable setting is off. This acts as list of known trusted
  1526. devices.
  1527. This command can be used when the controller is not powered and
  1528. all settings will be programmed once powered.
  1529. This command generates a Command Complete event on success
  1530. or failure.
  1531. Possible errors: Failed
  1532. Invalid Parameters
  1533. Invalid Index
  1534. Remove Device Command
  1535. =====================
  1536. Command Code: 0x0034
  1537. Controller Index: <controller id>
  1538. Command Parameters: Address (6 Octets)
  1539. Address_Type (1 Octet)
  1540. Return Parameters: Address (6 Octets)
  1541. Address_Type (1 Octet)
  1542. This command is used to remove a device from the action list
  1543. previously added by using the Add Device command.
  1544. Possible values for the Address_Type parameter:
  1545. 0 BR/EDR
  1546. 1 LE Public
  1547. 2 LE Random
  1548. When the Address parameter is 00:00:00:00:00:00, then all
  1549. previously added devices will be removed.
  1550. This command can be used when the controller is not powered and
  1551. all settings will be programmed once powered.
  1552. This command generates a Command Complete event on success
  1553. or failure.
  1554. Possible errors: Invalid Parameters
  1555. Invalid Index
  1556. Load Connection Parameters Command
  1557. ==================================
  1558. Command Code: 0x0035
  1559. Controller Index: <controller id>
  1560. Command Parameters: Param_Count (2 Octets)
  1561. Param1 {
  1562. Address (6 Octets)
  1563. Address_Type (1 Octet)
  1564. Min_Connection_Interval (2 Octets)
  1565. Max_Connection_Interval (2 Octets)
  1566. Connection_Latency (2 Octets)
  1567. Supervision_Timeout (2 Octets)
  1568. }
  1569. Param2 { }
  1570. ...
  1571. Return Parameters:
  1572. This command is used to load connection parameters from several
  1573. devices into kernel. Currently this is only supported on controllers
  1574. with Low Energy support.
  1575. Possible values for the Address_Type parameter:
  1576. 0 Reserved (not in use)
  1577. 1 LE Public
  1578. 2 LE Random
  1579. The provided Address and Address_Type are the identity of
  1580. a device. So either its public address or static random address.
  1581. The Min_Connection_Interval, Max_Connection_Interval,
  1582. Connection_Latency and Supervision_Timeout parameters should
  1583. be configured as described in Core 4.1 spec, Vol 2, 7.8.12.
  1584. This command can be used when the controller is not powered.
  1585. This command generates a Command Complete event on success or
  1586. a Command Status event on failure.
  1587. Possible errors: Invalid Parameters
  1588. Invalid Index
  1589. Not Supported
  1590. Read Unconfigured Controller Index List Command
  1591. ===============================================
  1592. Command Code: 0x0036
  1593. Controller Index: <non-controller>
  1594. Command Parameters:
  1595. Return Parameters: Num_Controllers (2 Octets)
  1596. Controller_Index[i] (2 Octets)
  1597. This command returns the list of currently unconfigured controllers.
  1598. Unconfigured controllers added after calling this command can be
  1599. monitored using the Unconfigured Index Added event.
  1600. An unconfigured controller can either move to a configured state
  1601. by indicating Unconfigured Index Removed event followed by an
  1602. Index Added event; or it can be removed from the system which
  1603. would be indicated by the Unconfigured Index Removed event.
  1604. Only controllers that require configuration will be listed with
  1605. this command. A controller that is fully configured will not
  1606. be listed even if it supports configuration changes.
  1607. This command generates a Command Complete event on success or
  1608. a Command Status event on failure.
  1609. Read Controller Configuration Information Command
  1610. =================================================
  1611. Command Code: 0x0037
  1612. Controller Index: <controller id>
  1613. Command Parameters:
  1614. Return Parameters: Manufacturer (2 Octets)
  1615. Supported_Options (4 Octets)
  1616. Missing_Options (4 Octets)
  1617. This command is used to retrieve the supported configuration
  1618. options of a controller and the missing configuration options.
  1619. The missing options are required to be configured before the
  1620. controller is considered fully configured and ready for standard
  1621. operation. The command is typically used right after getting the
  1622. response to Read Unconfigured Controller Index List command or
  1623. Unconfigured Index Added event.
  1624. Supported_Options and Missing_Options is a bitmask with currently
  1625. the following available bits:
  1626. 0 External configuration
  1627. 1 Bluetooth public address configuration
  1628. It is valid to call this command on controllers that do not
  1629. require any configuration. It is possible that a fully configured
  1630. controller offers additional support for configuration.
  1631. For example a controller may contain a valid Bluetooth public
  1632. device address, but also allows to configure it from the host
  1633. stack. In this case the general support for configurations will
  1634. be indicated by the Controller Configuration settings. For
  1635. controllers where no configuration options are available that
  1636. setting option will not be present.
  1637. When all configurations have been completed and as a result the
  1638. Missing_Options mask would become empty, then the now ready
  1639. controller will be announced via Index Added event.
  1640. This command generates a Command Complete event on success or
  1641. a Command Status event on failure.
  1642. Possible errors: Invalid Parameters
  1643. Invalid Index
  1644. Set External Configuration Command
  1645. ==================================
  1646. Command Code: 0x0038
  1647. Controller Index: <controller id>
  1648. Command Parameters: Configuration (1 Octet)
  1649. Return Parameters: Missing_Options (4 Octets)
  1650. This command allows to change external configuration option to
  1651. indicate that a controller is now configured or unconfigured.
  1652. The value 0x00 sets unconfigured state and the value 0x01 sets
  1653. configured state of the controller.
  1654. It is not mandatory that this configuration option is provided
  1655. by a controller. If it is provided, the configuration has to
  1656. happen externally using user channel operation or via vendor
  1657. specific methods.
  1658. Setting this option and when Missing_Options returns zero, this
  1659. means that the controller will switch to configured state and it
  1660. can be expected that it will be announced via Index Added event.
  1661. Wrongly configured controllers might still cause an error when
  1662. trying to power them via Set Powered command.
  1663. This command generates a Command Complete event on success or a
  1664. Command Status event on failure.
  1665. Possible errors: Rejected
  1666. Not Supported
  1667. Invalid Parameters
  1668. Invalid Index
  1669. Set Public Address Command
  1670. ==========================
  1671. Command Code: 0x0039
  1672. Controller Index: <controller id>
  1673. Command Parameters: Address (6 Octets)
  1674. Return Parameters: Missing_Options (4 Octets)
  1675. This command allows configuration of public address. Since a vendor
  1676. specific procedure is required, this command might not be supported
  1677. by all controllers. Actually most likely only a handful embedded
  1678. controllers will offer support for this command.
  1679. When the support for Bluetooth public address configuration is
  1680. indicated in the supported options mask, then this command
  1681. can be used to configure the public address.
  1682. It is only possible to configure the public address when the
  1683. controller is powered off.
  1684. For an unconfigured controller and when Missing_Options returns
  1685. an empty mask, this means that a Index Added event for the now
  1686. fully configured controller can be expected.
  1687. For a fully configured controller, the current controller index
  1688. will become invalid and an Unconfigured Index Removed event will
  1689. be sent. Once the address has been successfully changed an Index
  1690. Added event will be sent. There is no guarantee that the controller
  1691. index stays the same.
  1692. All previous configured parameters and settings are lost when
  1693. this command succeeds. The controller has to be treated as new
  1694. one. Use this command for a fully configured controller only when
  1695. you really know what you are doing.
  1696. This command generates a Command Complete event on success or a
  1697. Command Status event on failure.
  1698. Possible errors: Rejected
  1699. Not Supported
  1700. Invalid Parameters
  1701. Invalid Index
  1702. Start Service Discovery Command
  1703. ===============================
  1704. Command Code: 0x003a
  1705. Controller Index: <controller id>
  1706. Command Parameters: Address_Type (1 Octet)
  1707. RSSI_Threshold (1 Octet)
  1708. UUID_Count (2 Octets)
  1709. UUID[i] (16 Octets)
  1710. Return Parameters: Address_Type (1 Octet)
  1711. This command is used to start the process of discovering remote
  1712. devices with a specific UUID. A Device Found event will be sent
  1713. for each discovered device.
  1714. Possible values for the Address_Type parameter are a bit-wise or
  1715. of the following bits:
  1716. 0 BR/EDR
  1717. 1 LE Public
  1718. 2 LE Random
  1719. By combining these e.g. the following values are possible:
  1720. 1 BR/EDR
  1721. 6 LE (public & random)
  1722. 7 BR/EDR/LE (interleaved discovery)
  1723. The service discovery uses active scanning for Low Energy scanning
  1724. and will search for UUID in both advertising data and scan response
  1725. data.
  1726. Found devices that have a RSSI value smaller than RSSI_Threshold
  1727. are not reported via DeviceFound event. Setting a value of 127
  1728. will cause all devices to be reported.
  1729. The list of UUIDs identifies a logical OR. Only one of the UUIDs
  1730. have to match to cause a DeviceFound event. Providing an empty
  1731. list of UUIDs with Num_UUID set to 0 which means that DeviceFound
  1732. events are send out for all devices above the RSSI_Threshold.
  1733. In case RSSI_Threshold is set to 127 and UUID_Count is 0, then
  1734. this command behaves exactly the same as Start Discovery.
  1735. When the discovery procedure starts the Discovery event will
  1736. notify this similar to Start Discovery.
  1737. This command can only be used when the controller is powered.
  1738. This command generates a Command Complete event on success
  1739. or failure.
  1740. Possible errors: Busy
  1741. Not Supported
  1742. Invalid Parameters
  1743. Not Powered
  1744. Invalid Index
  1745. Read Local Out Of Band Extended Data Command
  1746. ============================================
  1747. Command Code: 0x003b
  1748. Controller Index: <controller id>
  1749. Command Parameters: Address_Type (1 Octet)
  1750. Return Parameters: Address_Type (1 Octet)
  1751. EIR_Data_Length (2 Octets)
  1752. EIR_Data (0-65535 Octets)
  1753. This command is used to read the local Out of Band data
  1754. information and provide them encoded as extended inquiry
  1755. response information or advertising data.
  1756. Possible values for the Address_Type parameter are a bit-wise or
  1757. of the following bits:
  1758. 0 BR/EDR
  1759. 1 LE Public
  1760. 2 LE Random
  1761. By combining these e.g. the following values are possible:
  1762. 1 BR/EDR
  1763. 6 LE (public & random)
  1764. 7 Reserved (not in use)
  1765. For BR/EDR controller (Address_Type 1) the returned information
  1766. will contain the following information:
  1767. Class of Device
  1768. Simple Pairing Hash C-192 (optional)
  1769. Simple Pairing Randomizer R-192 (optional)
  1770. Simple Pairing Hash C-256 (optional)
  1771. Simple Pairing Randomizer R-256 (optional)
  1772. Service Class UUID (optional)
  1773. Bluetooth Local Name (optional)
  1774. The Simple Pairing Hash C-256 and Simple Pairing Randomizer R-256
  1775. fields are only included when secure connections has been enabled.
  1776. The Device Address (BD_ADDR) is not included in the EIR_Data and
  1777. needs to be taken from controller information.
  1778. For LE controller (Address_Type 6) the returned information
  1779. will contain the following information:
  1780. LE Bluetooth Device Address
  1781. LE Role
  1782. LE Secure Connections Confirmation Value (optional)
  1783. LE Secure Connections Random Value (optional)
  1784. Appearance (optional)
  1785. Local Name (optional)
  1786. Flags
  1787. The LE Secure Connections Confirmation Value and LE Secure Connections
  1788. Random Value fields are only included when secure connections has been
  1789. enabled.
  1790. The Security Manager TK Value from the Bluetooth specification can
  1791. not be provided by this command. The Out Of Band information here are
  1792. for asymmetric exchanges based on Diffie-Hellman key exchange. The
  1793. Security Manager TK Value is a symmetric random number that has to
  1794. be acquired and agreed upon differently.
  1795. The returned information from BR/EDR controller and LE controller
  1796. types are not related to each other. Once they have been used
  1797. over an Out Of Band link, a new set of information shall be
  1798. requested.
  1799. When Secure Connections Only mode has been enabled, then the fields
  1800. for Simple Pairing Hash C-192 and Simple Pairing Randomizer R-192
  1801. are not returned. Only the fields for the strong secure connections
  1802. pairing are included.
  1803. This command can only be used when the controller is powered.
  1804. Values returned by this command become invalid when the controller
  1805. is powered down. After each power-cycle it is required to call
  1806. this command again to get updated information.
  1807. This command generates a Command Complete event on success or
  1808. a Command Status event on failure.
  1809. Possible errors: Not Supported
  1810. Busy
  1811. Invalid Parameters
  1812. Not Powered
  1813. Invalid Index
  1814. Read Extended Controller Index List Command
  1815. ===========================================
  1816. Command Code: 0x003c
  1817. Controller Index: <non-controller>
  1818. Command Parameters:
  1819. Return Parameters: Num_Controllers (2 Octets)
  1820. Controller_Index[i] (2 Octets)
  1821. Controller_Type[i] (1 Octet)
  1822. Controller_Bus[i] (1 Octet)
  1823. This command returns the list of currently known controllers. It
  1824. includes configured, unconfigured and alternate controllers.
  1825. Controllers added or removed after calling this command can be
  1826. be monitored using the Extended Index Added and Extended Index
  1827. Removed events.
  1828. The existing Index Added, Index Removed, Unconfigured Index Added
  1829. and Unconfigured Index Removed are no longer sent after this command
  1830. has been used at least once.
  1831. Instead of calling Read Controller Index List and Read Unconfigured
  1832. Controller Index List, this command combines all the information
  1833. and can be used to retrieve the controller list.
  1834. The Controller_Type parameter has these values:
  1835. 0x00 Primary Controller (BR/EDR and/or LE)
  1836. 0x01 Unconfigured Controller (BR/EDR and/or LE)
  1837. 0x02 Alternate MAC/PHY Controller (AMP)
  1838. The 0x00 and 0x01 types indicate a primary BR/EDR and/or LE
  1839. controller. The difference is just if they need extra configuration
  1840. or if they are fully configured.
  1841. Controllers in configured state will be listed as 0x00 and controllers
  1842. in unconfigured state will be listed as 0x01. A controller that is
  1843. fully configured and supports configuration changes will be listed
  1844. as 0x00.
  1845. Alternate MAC/PHY controllers will be listed as 0x02. They do not
  1846. support the difference between configured and unconfigured state.
  1847. The Controller_Bus parameter has these values:
  1848. 0x00 Virtual
  1849. 0x01 USB
  1850. 0x02 PCMCIA
  1851. 0x03 UART
  1852. 0x04 RS232
  1853. 0x05 PCI
  1854. 0x06 SDIO
  1855. 0x07 SPI
  1856. 0x08 I2C
  1857. 0x09 SMD
  1858. 0x0A VIRTIO
  1859. Controllers marked as RAW only operation are currently not listed
  1860. by this command.
  1861. This command generates a Command Complete event on success or
  1862. a Command Status event on failure.
  1863. Read Advertising Features Command
  1864. =================================
  1865. Command Code: 0x003d
  1866. Controller Index: <controller id>
  1867. Command Parameters:
  1868. Return Parameters: Supported_Flags (4 Octets)
  1869. Max_Adv_Data_Len (1 Octet)
  1870. Max_Scan_Rsp_Len (1 Octet)
  1871. Max_Instances (1 Octet)
  1872. Num_Instances (1 Octet)
  1873. Instance[i] (1 Octet)
  1874. This command is used to read the advertising features supported
  1875. by the controller and stack.
  1876. With the Supported_Flags field the possible values for the Flags
  1877. field in Add Advertising command provided:
  1878. 0 Switch into Connectable mode
  1879. 1 Advertise as Discoverable
  1880. 2 Advertise as Limited Discoverable
  1881. 3 Add Flags field to Adv_Data
  1882. 4 Add TX Power field to Adv_Data
  1883. 5 Add Appearance field to Scan_Rsp
  1884. 6 Add Local Name in Scan_Rsp
  1885. 7 Secondary Channel with LE 1M
  1886. 8 Secondary Channel with LE 2M
  1887. 9 Secondary Channel with LE Coded
  1888. The Flags bit 0 indicates support for connectable advertising
  1889. and for switching to connectable advertising independent of the
  1890. connectable global setting. When this flag is not supported, then
  1891. the global connectable setting determines if undirected connectable,
  1892. undirected scannable or undirected non-connectable advertising is
  1893. used. It also determines the use of non-resolvable random address
  1894. versus identity address or resolvable private address.
  1895. The Flags bit 1 indicates support for advertising with discoverable
  1896. mode enabled. Users of this flag will decrease the Max_Adv_Data_Len
  1897. by 3 octets. In this case the advertising data flags are managed
  1898. and added in front of the provided advertising data.
  1899. The Flags bit 2 indicates support for advertising with limited
  1900. discoverable mode enabled. Users of this flag will decrease the
  1901. Max_Adv_Data_Len by 3 octets. In this case the advertising data
  1902. flags are managed and added in front of the provided advertising
  1903. data.
  1904. The Flags bit 3 indicates support for automatically keeping the
  1905. Flags field of the advertising data updated. Users of this flag
  1906. will decrease the Max_Adv_Data_Len by 3 octets and need to keep
  1907. that in mind. The Flags field will be added in front of the
  1908. advertising data provided by the user. Note that with Flags bit 1
  1909. and Flags bit 2, this one will be implicitly used even if it is
  1910. not marked as supported.
  1911. The Flags bit 4 indicates support for automatically adding the
  1912. TX Power value to the advertising data. Users of this flag will
  1913. decrease the Max_Adv_Data_Len by 3 octets. The TX Power field will
  1914. be added at the end of the user provided advertising data. If the
  1915. controller does not support TX Power information, then this bit will
  1916. not be set.
  1917. The Flags bit 5 indicates support for automatically adding the
  1918. Appearance value to the scan response data. Users of this flag
  1919. will decrease the Max_Scan_Rsp_len by 4 octets. The Appearance
  1920. field will be added in front of the scan response data provided
  1921. by the user. If the appearance value is not supported, then this
  1922. bit will not be set.
  1923. The Flags bit 6 indicates support for automatically adding the
  1924. Local Name value to the scan response data. This flag indicates
  1925. an opportunistic approach for the Local Name. If enough space
  1926. in the scan response data is available, it will be added. If the
  1927. space is limited a short version or no name information. The
  1928. Local Name will be added at the end of the scan response data.
  1929. The Flags bit 7 indicates support for advertising in secondary
  1930. channel in LE 1M PHY.
  1931. The Flags bit 8 indicates support for advertising in secondary
  1932. channel in LE 2M PHY. Primary channel would be on 1M.
  1933. The Flags bit 9 indicates support for advertising in secondary
  1934. channel in LE CODED PHY.
  1935. The valid range for Instance identifiers is 1-254. The value 0
  1936. is reserved for internal use and the value 255 is reserved for
  1937. future extensions. However the Max_Instances value for indicating
  1938. the number of supported Instances can be also 0 if the controller
  1939. does not support any advertising.
  1940. The Max_Adv_Data_Len and Max_Scan_Rsp_Len provides extra
  1941. information about the maximum length of the data fields. For
  1942. now this will always return the value 31. Different flags
  1943. however might decrease the actual available length in these
  1944. data fields.
  1945. With Num_Instances and Instance array the currently occupied
  1946. Instance identifiers can be retrieved.
  1947. This command generates a Command Complete event on success or
  1948. a Command Status event on failure.
  1949. Possible errors: Invalid Parameters
  1950. Invalid Index
  1951. Add Advertising Command
  1952. =======================
  1953. Command Code: 0x003e
  1954. Controller Index: <controller id>
  1955. Command Parameters: Instance (1 Octet)
  1956. Flags (4 Octets)
  1957. Duration (2 Octets)
  1958. Timeout (2 Octets)
  1959. Adv_Data_Len (1 Octet)
  1960. Scan_Rsp_Len (1 Octet)
  1961. Adv_Data (0-255 Octets)
  1962. Scan_Rsp (0-255 Octets)
  1963. Return Parameters: Instance (1 Octet)
  1964. This command is used to configure an advertising instance that
  1965. can be used to switch a Bluetooth Low Energy controller into
  1966. advertising mode.
  1967. Added advertising information with this command will not be visible
  1968. immediately if advertising is enabled via the Set Advertising
  1969. command. The usage of the Set Advertising command takes precedence
  1970. over this command. Instance information is stored and will be
  1971. advertised once advertising via Set Advertising has been disabled.
  1972. The Instance identifier is a value between 1 and the number of
  1973. supported instances. The value 0 is reserved.
  1974. With the Flags value the type of advertising is controlled and
  1975. the following flags are defined:
  1976. 0 Switch into Connectable mode
  1977. 1 Advertise as Discoverable
  1978. 2 Advertise as Limited Discoverable
  1979. 3 Add Flags field to Adv_Data
  1980. 4 Add TX Power field to Adv_Data
  1981. 5 Add Appearance field to Scan_Rsp
  1982. 6 Add Local Name in Scan_Rsp
  1983. 7 Secondary Channel with LE 1M
  1984. 8 Secondary Channel with LE 2M
  1985. 9 Secondary Channel with LE Coded
  1986. When the connectable flag is set, then the controller will use
  1987. undirected connectable advertising. The value of the connectable
  1988. setting can be overwritten this way. This is useful to switch a
  1989. controller into connectable mode only for LE operation. This is
  1990. similar to the mode 0x02 from the Set Advertising command.
  1991. When the connectable flag is not set, then the controller will
  1992. use advertising based on the connectable setting. When using
  1993. non-connectable or scannable advertising, the controller will
  1994. be programmed with a non-resolvable random address. When the
  1995. system is connectable, then the identity address or resolvable
  1996. private address will be used.
  1997. Using the connectable flag is useful for peripheral mode support
  1998. where BR/EDR (and/or LE) is controlled by Add Device. This allows
  1999. making the peripheral connectable without having to interfere
  2000. with the global connectable setting.
  2001. If Scan_Rsp_Len is zero and connectable flag is not set and
  2002. the global connectable setting is off, then non-connectable
  2003. advertising is used. If Scan_Rsp_Len is larger than zero and
  2004. connectable flag is not set and the global advertising is off,
  2005. then scannable advertising is used. This small difference is
  2006. supported to provide less air traffic for devices implementing
  2007. broadcaster role.
  2008. Secondary channel flags can be used to advertise in secondary
  2009. channel with the corresponding PHYs. These flag bits are mutually
  2010. exclusive and setting multiple will result in Invalid Parameter
  2011. error. Choosing either LE 1M or LE 2M will result in using
  2012. extended advertising on the primary channel with LE 1M and the
  2013. respectively LE 1M or LE 2M on the secondary channel. Choosing
  2014. LE Coded will result in using extended advertising on the primary
  2015. and secondary channels with LE Coded. Choosing none of these flags
  2016. will result in legacy advertising.
  2017. The Duration parameter configures the length of an Instance. The
  2018. value is in seconds.
  2019. A value of 0 indicates a default value is chosen for the
  2020. Duration. The default is 2 seconds.
  2021. If only one advertising Instance has been added, then the Duration
  2022. value will be ignored. It only applies for the case where multiple
  2023. Instances are configured. In that case every Instance will be
  2024. available for the Duration time and after that it switches to
  2025. the next one. This is a simple round-robin based approach.
  2026. The Timeout parameter configures the life-time of an Instance. In
  2027. case the value 0 is used it indicates no expiration time. If a
  2028. timeout value is provided, then the advertising Instance will be
  2029. automatically removed when the timeout passes. The value for the
  2030. timeout is in seconds. Powering down a controller will invalidate
  2031. all advertising Instances and it is not possible to add a new
  2032. Instance with a timeout when the controller is powered down.
  2033. When a Timeout is provided, then the Duration subtracts from
  2034. the actual Timeout value of that Instance. For example an Instance
  2035. with Timeout of 5 and Duration of 2 will be scheduled exactly 3
  2036. times, twice with 2 seconds and once with one second. Other
  2037. Instances have no influence on the Timeout.
  2038. Re-adding an already existing instance (i.e. issuing the Add
  2039. Advertising command with an Instance identifier of an existing
  2040. instance) will update that instance's configuration.
  2041. An instance being added or changed while another instance is
  2042. being advertised will not be visible immediately but only when
  2043. the new/changed instance is being scheduled by the round robin
  2044. advertising algorithm.
  2045. Changes to an instance that is currently being advertised will
  2046. cancel that instance and switch to the next instance. The changes
  2047. will be visible the next time the instance is scheduled for
  2048. advertising. In case a single instance is active, this means
  2049. that changes will be visible right away.
  2050. A pre-requisite is that LE is already enabled, otherwise this
  2051. command will return a "rejected" response.
  2052. This command can be used when the controller is not powered and
  2053. all settings will be programmed once powered.
  2054. This command generates a Command Complete event on success or a
  2055. Command Status event on failure.
  2056. Possible errors: Failed
  2057. Rejected
  2058. Not Supported
  2059. Invalid Parameters
  2060. Invalid Index
  2061. Remove Advertising Command
  2062. ==========================
  2063. Command Code: 0x003f
  2064. Controller Index: <controller id>
  2065. Command Parameters: Instance (1 Octet)
  2066. Return Parameters: Instance (1 Octet)
  2067. This command is used to remove an advertising instance that
  2068. can be used to switch a Bluetooth Low Energy controller into
  2069. advertising mode.
  2070. When the Instance parameter is zero, then all previously added
  2071. advertising Instances will be removed.
  2072. Removing advertising information with this command will not be
  2073. visible as long as advertising is enabled via the Set Advertising
  2074. command. The usage of the Set Advertising command takes precedence
  2075. over this command. Changes to Instance information are stored and
  2076. will be advertised once advertising via Set Advertising has been
  2077. disabled.
  2078. Removing an instance while it is being advertised will immediately
  2079. cancel the instance, even when it has been advertised less then its
  2080. configured Timeout or Duration.
  2081. This command can be used when the controller is not powered and
  2082. all settings will be programmed once powered.
  2083. This command generates a Command Complete event on success or
  2084. a Command Status event on failure.
  2085. Possible errors: Invalid Parameters
  2086. Invalid Index
  2087. Get Advertising Size Information Command
  2088. ========================================
  2089. Command Code: 0x0040
  2090. Controller Index: <controller id>
  2091. Command Parameters: Instance (1 Octet)
  2092. Flags (4 Octets)
  2093. Return Parameters: Instance (1 Octet)
  2094. Flags (4 Octets)
  2095. Max_Adv_Data_Len (1 Octet)
  2096. Max_Scan_Rsp_Len (1 Octet)
  2097. The Read Advertising Features command returns the overall maximum
  2098. size of advertising data and scan response data fields. That size is
  2099. valid when no Flags are used. However when certain Flags are used,
  2100. then the size might decrease. This command can be used to request
  2101. detailed information about the maximum available size.
  2102. The following Flags values are defined:
  2103. 0 Switch into Connectable mode
  2104. 1 Advertise as Discoverable
  2105. 2 Advertise as Limited Discoverable
  2106. 3 Add Flags field to Adv_Data
  2107. 4 Add TX Power field to Adv_Data
  2108. 5 Add Appearance field to Scan_Rsp
  2109. 6 Add Local Name in Scan_Rsp
  2110. To get accurate information about the available size, the same Flags
  2111. values should be used with the Add Advertising command.
  2112. The Max_Adv_Data_Len and Max_Scan_Rsp_Len fields provide information
  2113. about the maximum length of the data fields for the given Flags
  2114. values. When the Flags field is zero, then these fields would contain
  2115. the same values as Read Advertising Features.
  2116. Possible errors: Invalid Parameters
  2117. Invalid Index
  2118. Start Limited Discovery Command
  2119. ===============================
  2120. Command Code: 0x0041
  2121. Controller Index: <controller id>
  2122. Command Parameters: Address_Type (1 Octet)
  2123. Return Parameters: Address_Type (1 Octet)
  2124. This command is used to start the process of discovering remote
  2125. devices using the limited discovery procedure. A Device Found event
  2126. will be sent for each discovered device.
  2127. Possible values for the Address_Type parameter are a bit-wise or
  2128. of the following bits:
  2129. 0 BR/EDR
  2130. 1 LE Public
  2131. 2 LE Random
  2132. By combining these e.g. the following values are possible:
  2133. 1 BR/EDR
  2134. 6 LE (public & random)
  2135. 7 BR/EDR/LE (interleaved discovery)
  2136. The limited discovery uses active scanning for Low Energy scanning
  2137. and will search for devices with the limited discoverability flag
  2138. configured. On BR/EDR it uses LIAC and filters on the limited
  2139. discoverability flag of the class of device.
  2140. When the discovery procedure starts the Discovery event will
  2141. notify this similar to Start Discovery.
  2142. This command can only be used when the controller is powered.
  2143. This command generates a Command Complete event on success
  2144. or failure.
  2145. Possible errors: Busy
  2146. Not Supported
  2147. Invalid Parameters
  2148. Not Powered
  2149. Invalid Index
  2150. Read Extended Controller Information Command
  2151. ============================================
  2152. Command Code: 0x0042
  2153. Controller Index: <controller id>
  2154. Command Parameters:
  2155. Return Parameters: Address (6 Octets)
  2156. Bluetooth_Version (1 Octet)
  2157. Manufacturer (2 Octets)
  2158. Supported_Settings (4 Octets)
  2159. Current_Settings (4 Octets)
  2160. EIR_Data_Length (2 Octets)
  2161. EIR_Data (0-65535 Octets)
  2162. This command is used to retrieve the current state and basic
  2163. information of a controller. It is typically used right after
  2164. getting the response to the Read Controller Index List command
  2165. or an Index Added event (or its extended counterparts).
  2166. The Address parameter describes the controllers public address
  2167. and it can be expected that it is set. However in case of single
  2168. mode Low Energy only controllers it can be 00:00:00:00:00:00. To
  2169. power on the controller in this case, it is required to configure
  2170. a static address using Set Static Address command first.
  2171. If the public address is set, then it will be used as identity
  2172. address for the controller. If no public address is available,
  2173. then the configured static address will be used as identity
  2174. address.
  2175. In the case of a dual-mode controller with public address that
  2176. is configured as Low Energy only device (BR/EDR switched off),
  2177. the static address is used when set and public address otherwise.
  2178. Current_Settings and Supported_Settings is a bitmask with
  2179. currently the following available bits:
  2180. 0 Powered
  2181. 1 Connectable
  2182. 2 Fast Connectable
  2183. 3 Discoverable
  2184. 4 Bondable
  2185. 5 Link Level Security (Sec. mode 3)
  2186. 6 Secure Simple Pairing
  2187. 7 Basic Rate/Enhanced Data Rate
  2188. 8 High Speed
  2189. 9 Low Energy
  2190. 10 Advertising
  2191. 11 Secure Connections
  2192. 12 Debug Keys
  2193. 13 Privacy
  2194. 14 Controller Configuration
  2195. 15 Static Address
  2196. 16 PHY Configuration
  2197. 17 Wideband Speech
  2198. The EIR_Data field contains information about class of device,
  2199. local name and other values. Not all of them might be present. For
  2200. example a Low Energy only device does not contain class of device
  2201. information.
  2202. When any of the values in the EIR_Data field changes, the event
  2203. Extended Controller Information Changed will be used to inform
  2204. clients about the updated information.
  2205. This command generates a Command Complete event on success or
  2206. a Command Status event on failure.
  2207. Possible errors: Invalid Parameters
  2208. Invalid Index
  2209. Set Appearance Command
  2210. ======================
  2211. Command Code: 0x0043
  2212. Controller Index: <controller id>
  2213. Command Parameters: Appearance (2 Octets)
  2214. Return Parameters:
  2215. This command is used to set the appearance value of a controller.
  2216. This command can be used when the controller is not
  2217. powered and all settings will be programmed once powered.
  2218. The value of appearance will be remembered when switching
  2219. the controller off and back on again. So the appearance only
  2220. have to be set once when a new controller is found and will
  2221. stay until removed.
  2222. This command generates a Command Complete event on success
  2223. or a Command Status event on failure.
  2224. This command is only available for LE capable controllers.
  2225. It will return Not Supported otherwise.
  2226. Possible errors: Not Supported
  2227. Invalid Parameters
  2228. Invalid Index
  2229. Get PHY Configuration Command
  2230. =============================
  2231. Command Code: 0x0044
  2232. Controller Index: <controller id>
  2233. Command Parameters:
  2234. Return Parameters: Supported_PHYs (4 Octet)
  2235. Configurable_PHYs (4 Octets)
  2236. Selected_PHYs (4 Octet)
  2237. The PHYs parameters are a bitmask with currently the
  2238. following available bits:
  2239. 0 BR 1M 1-Slot
  2240. 1 BR 1M 3-Slot
  2241. 2 BR 1M 5-Slot
  2242. 3 EDR 2M 1-Slot
  2243. 4 EDR 2M 3-Slot
  2244. 5 EDR 2M 5-Slot
  2245. 6 EDR 3M 1-Slot
  2246. 7 EDR 3M 3-Slot
  2247. 8 EDR 3M 5-Slot
  2248. 9 LE 1M TX
  2249. 10 LE 1M RX
  2250. 11 LE 2M TX
  2251. 12 LE 2M RX
  2252. 13 LE Coded TX
  2253. 14 LE Coded RX
  2254. If BR/EDR is supported, then BR 1M 1-Slot is supported by
  2255. default and can also not be deselected. If LE is supported,
  2256. then LE 1M TX and LE 1M RX are supported by default.
  2257. Disabling BR/EDR completely or respectively LE has no impact
  2258. on the PHY configuration. It is remembered over power cycles.
  2259. This command generates a Command Complete event on success
  2260. or a Command Status event on failure.
  2261. Possible errors: Invalid Parameters
  2262. Invalid Index
  2263. Set PHY Configuration Command
  2264. =============================
  2265. Command Code: 0x0045
  2266. Controller Index: <controller id>
  2267. Command Parameters: Selected_PHYs (4 Octet)
  2268. Return Parameters:
  2269. This command is used to set the default PHY to the controller.
  2270. This will be stored and used for all the subsequent scanning
  2271. and connection initiation.
  2272. The list of supported PHYs can be retrieved via the
  2273. Get PHY Configuration command. Selecting unsupported or
  2274. deselecting default PHYs will result in an Invalid Parameter
  2275. error.
  2276. This can be called at any point to change the Selected PHYs.
  2277. Refer Get PHY Configuration command for PHYs parameter.
  2278. This command generates a Command Complete event on success
  2279. or a Command Status event on failure.
  2280. Possible errors: Invalid Parameters
  2281. Invalid Index
  2282. Load Blocked Keys Command
  2283. ===========================
  2284. Command Code: 0x0046
  2285. Controller Index: <controller id>
  2286. Command Parameters: Key_Count (2 Octets)
  2287. Key1 {
  2288. Key_Type (1 Octet)
  2289. Value (16 Octets)
  2290. }
  2291. Key2 { }
  2292. ...
  2293. Return Parameters:
  2294. This command is used to feed the kernel a list of keys that
  2295. are known to be vulnerable.
  2296. If the pairing procedure produces any of these keys, they will be
  2297. silently dropped and any attempt to enable encryption rejected.
  2298. Currently defined Key_Type values are:
  2299. 0x00 Link Key (BR/EDR)
  2300. 0x01 Long Term Key (LE)
  2301. 0x02 Identity Resolving Key (LE)
  2302. This command can be used when the controller is not powered.
  2303. This command generates a Command Complete event on success or
  2304. a Command Status event on failure.
  2305. Possible errors: Invalid Parameters
  2306. Invalid Index
  2307. Set Wideband Speech Command
  2308. ===========================
  2309. Command Code: 0x0047
  2310. Controller Index: <controller id>
  2311. Command Parameters: Wideband_Speech (1 Octet)
  2312. Return Parameters: Current_Settings (4 Octets)
  2313. This command is used to enable/disable Wideband Speech
  2314. support for a controller. The allowed values for the
  2315. Wideband_Speech command parameter are 0x00 and 0x01.
  2316. All other values will return Invalid Parameters.
  2317. The value 0x00 disables Wideband Speech, the value 0x01
  2318. enables Wideband Speech.
  2319. This command is only available for BR/EDR capable controllers and
  2320. require controller specific support.
  2321. This command can be used when the controller is not powered and
  2322. all settings will be programmed once powered.
  2323. In case the controller does not support Wideband Speech
  2324. the command will fail regardless with Not Supported error.
  2325. This command generates a Command Complete event on success or
  2326. a Command Status event on failure.
  2327. Possible errors: Busy
  2328. Not Supported
  2329. Invalid Parameters
  2330. Invalid Index
  2331. Read Controller Capabilities Command
  2332. ====================================
  2333. Command Code: 0x0048
  2334. Controller Index: <controller id>
  2335. Command Parameters:
  2336. Return Parameters: Capabilities_Data_Length (2 Octets)
  2337. Capabilities_Data (0-65535 Octets)
  2338. This command is used to retrieve the supported capabilities
  2339. by the controller or the host stack.
  2340. The Capabilities_Data_Length and Capabilities_Data parameters provide
  2341. a list of security settings, features and information. It uses
  2342. the same format as EIR_Data, but with the namespace defined here.
  2343. Data Type Name
  2344. --------------------
  2345. 0x01 Flags
  2346. 0x02 Max Encryption Key Size (BR/EDR)
  2347. 0x03 Max Encryption Key Size (LE)
  2348. 0x04 Supported Tx Power (LE)
  2349. Flags (data type 0x01)
  2350. 0 Remote public key validation (BR/EDR)
  2351. 1 Remote public key validation (LE)
  2352. 2 Encryption key size enforcement (BR/EDR)
  2353. 3 Encryption key size enforcement (LE)
  2354. Max Encryption Key Size (data types 0x02 and 0x03)
  2355. When the field is present, then it provides 1 Octet value
  2356. indicating the max encryption key size. If the field is not
  2357. present, then it is unknown what the max encryption key
  2358. size of the controller or host is in use.
  2359. Supported LE Tx Power (data type 0x04)
  2360. When present, this 2-octet field provides the min and max
  2361. LE Tx power supported by the controller, respectively, as
  2362. reported by the LE Read Transmit Power HCI command. If this
  2363. field is not available, it indicates that the LE Read
  2364. Transmit Power HCI command was not available.
  2365. This command generates a Command Complete event on success or
  2366. a Command Status event on failure.
  2367. Possible errors: Invalid Parameters
  2368. Invalid Index
  2369. Read Experimental Features Information Command
  2370. ==============================================
  2371. Command Code: 0x0049
  2372. Controller Index: <controller id> or <non-controller>
  2373. Command Parameters:
  2374. Return Parameters: Feature_Count (2 Octets)
  2375. Feature1 {
  2376. UUID (16 Octets)
  2377. Flags (4 Octets)
  2378. }
  2379. Feature2 { }
  2380. ...
  2381. This command is used to retrieve the supported experimental features
  2382. by the host stack.
  2383. The UUID values are not defined here. They can change over time and
  2384. are on purpose not stable. Features that mature will be removed at
  2385. some point. The mapping of feature UUID to the actual functionality
  2386. of a given feature is out of scope here.
  2387. The following bits are defined for the Flags parameter:
  2388. 0 Feature active
  2389. 1 Causes change in supported settings
  2390. This command generates a Command Complete event on success or
  2391. a Command Status event on failure.
  2392. Possible errors: Invalid Parameters
  2393. Invalid Index
  2394. Set Experimental Feature Command
  2395. ================================
  2396. Command Code: 0x004a
  2397. Controller Index: <controller id> or <non-controller>
  2398. Command Parameters: UUID (16 Octets)
  2399. Action (1 Octet)
  2400. Return Parameters: UUID (16 Octets)
  2401. Flags (4 Octets)
  2402. This command is used to change the setting of an experimental feature
  2403. of the host stack.
  2404. The UUID value must be a supported value returned from the Read
  2405. Experimental Features Information command.
  2406. The Action parameter is UUID specific, but in most cases it will be
  2407. just a simple on/off toggle with these values:
  2408. 0x00 Disable feature
  2409. 0x01 Enable feature
  2410. It depends on the feature if the command can be used when the
  2411. controller is powered up. See Flags parameter of Read Experimental
  2412. Features Information command for details if the controller has
  2413. to be powered down first.
  2414. The following bits are defined for the Flags return parameter:
  2415. 0 Feature active
  2416. 1 Supported settings changed
  2417. When a feature causes the change of supported settings, then it is
  2418. a good idea to re-read the controller information.
  2419. When the UUID parameter is an empty UUID (16 x 0x00), then all
  2420. experimental features will be deactivated.
  2421. This command generates a Command Complete event on success or
  2422. a Command Status event on failure.
  2423. Possible errors: Invalid Parameters
  2424. Not Powered
  2425. Invalid Index
  2426. Read Default System Configuration Command
  2427. =========================================
  2428. Command Code: 0x004b
  2429. Controller Index: <controller id>
  2430. Command Parameters:
  2431. Return Parameters: Parameter1 {
  2432. Parameter_Type (2 Octet)
  2433. Value_Length (1 Octet)
  2434. Value (0-255 Octets)
  2435. }
  2436. Parameter2 { }
  2437. ...
  2438. This command is used to read a list of default controller parameters.
  2439. Currently defined Parameter_Type values are:
  2440. 0x0000 BR/EDR Page Scan Type
  2441. 0x0001 BR/EDR Page Scan Interval
  2442. 0x0002 BR/EDR Page Scan Window
  2443. 0x0003 BR/EDR Inquiry Scan Type
  2444. 0x0004 BR/EDR Inquiry Scan Interval
  2445. 0x0005 BR/EDR Inquiry Scan Window
  2446. 0x0006 BR/EDR Link Supervision Timeout
  2447. 0x0007 BR/EDR Page Timeout
  2448. 0x0008 BR/EDR Min Sniff Interval
  2449. 0x0009 BR/EDR Max Sniff Interval
  2450. 0x000a LE Advertisement Min Interval
  2451. 0x000b LE Advertisement Max Interval
  2452. 0x000c LE Multi Advertisement Rotation Interval
  2453. 0x000d LE Scanning Interval for auto connect
  2454. 0x000e LE Scanning Window for auto connect
  2455. 0x000f LE Scanning Interval for wake scenarios
  2456. 0x0010 LE Scanning Window for wake scenarios
  2457. 0x0011 LE Scanning Interval for discovery
  2458. 0x0012 LE Scanning Window for discovery
  2459. 0x0013 LE Scanning Interval for adv monitoring
  2460. 0x0014 LE Scanning Window for adv monitoring
  2461. 0x0015 LE Scanning Interval for connect
  2462. 0x0016 LE Scanning Window for connect
  2463. 0x0017 LE Min Connection Interval
  2464. 0x0018 LE Max Connection Interval
  2465. 0x0019 LE Connection Latency
  2466. 0x001a LE Connection Supervision Timeout
  2467. 0x001b LE Autoconnect Timeout
  2468. This command can be used at any time and will return a list of
  2469. supported default parameters as well as their current value.
  2470. This command generates a Command Complete event on success or
  2471. a Command Status event on failure.
  2472. Possible errors: Invalid Parameters
  2473. Invalid Index
  2474. Set Default System Configuration Command
  2475. ========================================
  2476. Command Code: 0x004c
  2477. Controller Index: <controller id>
  2478. Command Parameters: Parameter1 {
  2479. Parameter_Type (2 Octet)
  2480. Value_Length (1 Octet)
  2481. Value (0-255 Octets)
  2482. }
  2483. Parameter2 { }
  2484. ...
  2485. Return Parameters:
  2486. This command is used to set a list of default controller parameters.
  2487. See Read Default System Configuration command for list of supported
  2488. Parameter_Type values.
  2489. This command can be used when the controller is not powered and
  2490. all supported parameters will be programmed once powered.
  2491. When providing unsupported values or invalid values, no parameter
  2492. value will be changed and all values discarded.
  2493. This command generates a Command Complete event on success or
  2494. a Command Status event on failure.
  2495. Possible errors: Rejected
  2496. Not Supported
  2497. Invalid Parameters
  2498. Invalid Index
  2499. Read Default Runtime Configuration Command
  2500. ==========================================
  2501. Command Code: 0x004d
  2502. Controller Index: <controller id>
  2503. Command Parameters:
  2504. Return Parameters: Parameter1 {
  2505. Parameter_Type (2 Octet)
  2506. Value_Length (1 Octet)
  2507. Value (0-255 Octets)
  2508. }
  2509. Parameter2 { }
  2510. ...
  2511. This command is used to read a list of default runtime parameters.
  2512. Currently no Parameter_Type values are defined and an empty list
  2513. will be returned.
  2514. This command can be used at any time and will return a list of
  2515. supported default parameters as well as their current value.
  2516. This command generates a Command Complete event on success or
  2517. a Command Status event on failure.
  2518. Possible errors: Invalid Parameters
  2519. Invalid Index
  2520. Set Default Runtime Configuration Command
  2521. =========================================
  2522. Command Code: 0x004e
  2523. Controller Index: <controller id>
  2524. Command Parameters: Parameter1 {
  2525. Parameter_Type (2 Octet)
  2526. Value_Length (1 Octet)
  2527. Value (0-255 Octets)
  2528. }
  2529. Parameter2 { }
  2530. ...
  2531. Return Parameters:
  2532. This command is used to set a list of default runtime parameters.
  2533. See Read Default Runtime Configuration command for list of supported
  2534. Parameter_Type values.
  2535. This command can be used at any time and will change the runtime
  2536. default. Changes however will not apply to existing connections or
  2537. currently active operations.
  2538. When providing unsupported values or invalid values, no parameter
  2539. value will be changed and all values discarded.
  2540. This command generates a Command Complete event on success or
  2541. a Command Status event on failure.
  2542. Possible errors: Rejected
  2543. Not Supported
  2544. Invalid Parameters
  2545. Invalid Index
  2546. Get Device Flags Command
  2547. ========================
  2548. Command Code: 0x004f
  2549. Controller Index: <controller id>
  2550. Command Parameters: Address (6 Octets)
  2551. Address_Type (1 Octet)
  2552. Return Parameters: Address (6 Octets)
  2553. Address_Type (1 Octet)
  2554. Supported_Flags (4 Octets)
  2555. Current_Flags (4 Octets)
  2556. This command is used to retrieve additional flags and settings
  2557. for devices that are added via Add Device command.
  2558. Possible values for the Address_Type parameter:
  2559. 0 BR/EDR
  2560. 1 LE Public
  2561. 2 LE Random
  2562. The Flags parameters are a bitmask with currently the following
  2563. available bits:
  2564. 0 Remote Wakeup enabled
  2565. This command generates a Command Complete event on success
  2566. or a Command Status event on failure.
  2567. Possible errors: Invalid Parameters
  2568. Invalid Index
  2569. Set Device Flags Command
  2570. ========================
  2571. Command Code: 0x0050
  2572. Controller Index: <controller id>
  2573. Command Parameters: Address (6 Octets)
  2574. Address_Type (1 Octet)
  2575. Current_Flags (4 Octets)
  2576. Return Parameters: Address (6 Octets)
  2577. Address_Type (1 Octet)
  2578. This command is used to configure additional flags and settings
  2579. for devices that are added via Add Device command.
  2580. Possible values for the Address_Type parameter:
  2581. 0 BR/EDR
  2582. 1 LE Public
  2583. 2 LE Random
  2584. The list of supported Flags can be retrieved via the Get Device
  2585. Flags or Device Flags Changed command. Selecting unsupported flags
  2586. will result in an Invalid Parameter error;
  2587. Refer to the Get Device Flags command for a detailed description
  2588. of the Flags parameters.
  2589. This command can be used when the controller is not powered and
  2590. all settings will be programmed once powered.
  2591. This command generates a Command Complete event on success
  2592. or a Command Status event on failure.
  2593. Possible errors: Invalid Parameters
  2594. Invalid Index
  2595. Read Advertisement Monitor Features Command
  2596. ===========================================
  2597. Command Code: 0x0051
  2598. Controller Index: <controller id>
  2599. Command Parameters:
  2600. Return Parameters: Supported_Features (4 Octets)
  2601. Enabled_Features (4 Octets)
  2602. Max_Num_Handles (2 Octets)
  2603. Max_Num_Patterns (1 Octet)
  2604. Num_Handles (2 Octets)
  2605. Handle1 (2 Octets)
  2606. Handle2 (2 Octets)
  2607. ...
  2608. This command is used to read the advertisement monitor features
  2609. supported by the controller and stack. Supported_Features lists all
  2610. related features supported by the controller while Enabled_Features
  2611. lists the ones currently used by the kernel.
  2612. Supported_Features and Enabled_Features are bitmasks with currently
  2613. the following available bits:
  2614. 0 Advertisement content monitoring based on patterns with
  2615. logic OR.
  2616. Max_Num_Handles indicates the maximum number of supported
  2617. advertisement monitors. Note that the actual number of supported
  2618. ones might be less depending on the limitation of the controller.
  2619. Max_Num_Pattern indicates the maximum number of supported patterns
  2620. in an advertisement patterns monitor. Note that the actual number
  2621. of supported ones might be less depending on the limitation of the
  2622. controller.
  2623. Num_Handles indicates the number of added advertisement monitors,
  2624. and it is followed by a list of handles.
  2625. This command can be used when the controller is not powered.
  2626. Add Advertisement Patterns Monitor Command
  2627. ==========================================
  2628. Command Code: 0x0052
  2629. Controller Index: <controller id>
  2630. Command Parameters: Pattern_Count (1 Octet)
  2631. Pattern1 {
  2632. AD_Type (1 Octet)
  2633. Offset (1 Octet)
  2634. Length (1 Octet)
  2635. Value (31 Octets)
  2636. }
  2637. Pattern2 { }
  2638. ...
  2639. Return Parameters: Monitor_Handle (2 Octets)
  2640. This command is used to add an advertisement monitor whose
  2641. filtering conditions are patterns. The kernel will trigger scanning
  2642. if there is at least one monitor added. If the controller supports
  2643. advertisement filtering, the kernel would offload the content
  2644. filtering to the controller in order to reduce power consumption;
  2645. otherwise the kernel ignores the content of the monitor. Note that
  2646. if the there are more than one patterns, OR logic would applied
  2647. among patterns during filtering. In other words, any advertisement
  2648. matching at least one pattern in a given monitor would be
  2649. considered as a match.
  2650. A pattern contains the following fields.
  2651. AD_Data_Type Advertising Data Type. The possible values
  2652. are defined in Core Specification
  2653. Supplement.
  2654. Offset The start index where pattern matching
  2655. shall be performed with in the AD data.
  2656. Length The length of the pattern value in bytes.
  2657. Value The value of the pattern in bytes.
  2658. Here is an example of a pattern.
  2659. {
  2660. 0x16, // Service Data - 16-bit UUID
  2661. 0x02, // Skip the UUID part.
  2662. 0x04,
  2663. {0x11, 0x22, 0x33, 0x44},
  2664. }
  2665. This command can be used when the controller is not powered and
  2666. all settings will be programmed once powered.
  2667. Possible errors: Failed
  2668. Busy
  2669. No Resources
  2670. Invalid Parameters
  2671. Remove Advertisement Monitor Command
  2672. ====================================
  2673. Command Code: 0x0053
  2674. Controller Index: <controller id>
  2675. Command Parameters: Monitor_Handle (2 Octets)
  2676. Return Parameters: Monitor_Handle (2 Octets)
  2677. This command is used to remove advertisement monitor(s). The kernel
  2678. would remove the monitor(s) with Monitor_Handle and update the LE
  2679. scanning.
  2680. When the Monitor_Handle is set to zero, then all previously added
  2681. handles will be removed.
  2682. Removing a monitor while it is being added will be ignored.
  2683. This command can be used when the controller is not powered and
  2684. all settings will be programmed once powered.
  2685. Possible errors: Failed
  2686. Busy
  2687. Add Extended Advertising Parameters Command
  2688. ===========================================
  2689. Command Code: 0x0054
  2690. Controller Index: <controller id>
  2691. Command Parameters: Instance (1 Octet)
  2692. Flags (4 Octets)
  2693. Params (2 Octets)
  2694. Duration (2 Octets)
  2695. Timeout (2 Octets)
  2696. MinInterval (4 Octets)
  2697. MaxInterval (4 Octets)
  2698. TxPower (1 Octet)
  2699. Return Parameters: Instance (1 Octet)
  2700. TxPower (1 Octet)
  2701. MaxAdvDataLen (1 Octet)
  2702. MaxScanRspLen (1 Octet)
  2703. This command is used to configure the parameters for Bluetooth Low
  2704. Energy advertising instance. This command is expected to be followed
  2705. by an Add Extended Advertising Data command to complete and enable
  2706. the advertising instance.
  2707. Added advertising information with this command will not be visible
  2708. immediately if advertising is enabled via the Set Advertising
  2709. command. The usage of the Set Advertising command takes precedence
  2710. over this command. Instance information is stored and will be
  2711. advertised once advertising via Set Advertising has been disabled.
  2712. The Instance identifier is a value between 1 and the number of
  2713. supported instances. The value 0 is reserved.
  2714. With the Flags value the type of advertising is controlled and
  2715. the following flags are defined:
  2716. 0 Switch into Connectable mode
  2717. 1 Advertise as Discoverable
  2718. 2 Advertise as Limited Discoverable
  2719. 3 Add Flags field to Adv_Data
  2720. 4 Add TX Power field to Adv_Data
  2721. 5 Add Appearance field to Scan_Rsp
  2722. 6 Add Local Name in Scan_Rsp
  2723. 7 Secondary Channel with LE 1M
  2724. 8 Secondary Channel with LE 2M
  2725. 9 Secondary Channel with LE Coded
  2726. 12 The Duration parameter should be used
  2727. 13 The Timeout parameter should be used
  2728. 14 The Interval parameters should be used
  2729. 15 The Tx Power parameter should be used
  2730. 16 The advertisement will contain a scan response
  2731. When the connectable flag is set, then the controller will use
  2732. undirected connectable advertising. The value of the connectable
  2733. setting can be overwritten this way. This is useful to switch a
  2734. controller into connectable mode only for LE operation. This is
  2735. similar to the mode 0x02 from the Set Advertising command.
  2736. When the connectable flag is not set, then the controller will
  2737. use advertising based on the connectable setting. When using
  2738. non-connectable or scannable advertising, the controller will
  2739. be programmed with a non-resolvable random address. When the
  2740. system is connectable, then the identity address or resolvable
  2741. private address will be used.
  2742. Using the connectable flag is useful for peripheral mode support
  2743. where BR/EDR (and/or LE) is controlled by Add Device. This allows
  2744. making the peripheral connectable without having to interfere
  2745. with the global connectable setting.
  2746. Secondary channel flags can be used to advertise in secondary
  2747. channel with the corresponding PHYs. These flag bits are mutually
  2748. exclusive and setting multiple will result in Invalid Parameter
  2749. error. Choosing either LE 1M or LE 2M will result in using
  2750. extended advertising on the primary channel with LE 1M and the
  2751. respectively LE 1M or LE 2M on the secondary channel. Choosing
  2752. LE Coded will result in using extended advertising on the primary
  2753. and secondary channels with LE Coded. Choosing none of these flags
  2754. will result in legacy advertising.
  2755. To allow future parameters to be optionally extended in this structure,
  2756. the flags member has been used to specify which of the structure
  2757. fields were purposefully set by the caller. Unspecified parameters will
  2758. be given sensible defaults by the kernel before the advertisement is
  2759. registered.
  2760. The Duration parameter configures the length of an Instance. The
  2761. value is in seconds. The default is 2 seconds.
  2762. If only one advertising Instance has been added, then the Duration
  2763. value will be ignored. It only applies for the case where multiple
  2764. Instances are configured. In that case every Instance will be
  2765. available for the Duration time and after that it switches to
  2766. the next one. This is a simple round-robin based approach.
  2767. The Timeout parameter configures the life-time of an Instance. In
  2768. case the value 0 is used it indicates no expiration time. If a
  2769. timeout value is provided, then the advertising Instance will be
  2770. automatically removed when the timeout passes. The value for the
  2771. timeout is in seconds. Powering down a controller will invalidate
  2772. all advertising Instances and it is not possible to add a new
  2773. Instance with a timeout when the controller is powered down.
  2774. When a Timeout is provided, then the Duration subtracts from
  2775. the actual Timeout value of that Instance. For example an Instance
  2776. with Timeout of 5 and Duration of 2 will be scheduled exactly 3
  2777. times, twice with 2 seconds and once with one second. Other
  2778. Instances have no influence on the Timeout.
  2779. MinInterval and MaxInterval define the minimum and maximum advertising
  2780. intervals, with units as number of .625ms advertising slots. The Max
  2781. interval is expected to be greater than or equal to the Min interval,
  2782. and both must have values in the range [0x000020, 0xFFFFFF]. If either
  2783. condition is not met, the registration will fail.
  2784. The provided Tx Power parameter will only be used if the controller
  2785. supports it, which can be determined by the presence of the
  2786. CanSetTxPower member of the Read Advertising Features command.
  2787. The acceptable range for requested Tx Power is defined in the spec
  2788. (Version 5.2 | Vol 4, Part E, page 2585) to be [-127, +20] dBm, and the
  2789. controller will select a power value up to the requested one. The
  2790. transmission power selected by the controller is not guaranteed
  2791. to match the requested one, so the reply will contain the power
  2792. chosen by the controller. If the requested Tx Power is outside
  2793. the valid range, the registration will fail.
  2794. When flag bit 16 is enabled, it indicates that the subsequent request
  2795. to set advertising data will contain a scan response, and that the
  2796. parameters should set a PDU type that is scannable.
  2797. Re-adding an already existing instance (i.e. issuing the Add Extended
  2798. Advertising Parameters command with an Instance identifier of an
  2799. existing instance) will update that instance's configuration. In this
  2800. case where no new instance is added, no Advertising Added event will
  2801. be generated. However, if the update of the instance fails, the
  2802. instance will be removed, and an Advertising Removed event will be
  2803. generated.
  2804. An instance being added or changed while another instance is
  2805. being advertised will not be visible immediately but only when
  2806. the new/changed instance is being scheduled by the round robin
  2807. advertising algorithm.
  2808. Changes to an instance that is currently being advertised will
  2809. cancel that instance and switch to the next instance. The changes
  2810. will be visible the next time the instance is scheduled for
  2811. advertising. In case a single instance is active, this means
  2812. that changes will be visible right away.
  2813. The MaxAdvDataLen return parameter indicates how large the data
  2814. payload can be in the subsequent Add Extended Advertising Data
  2815. Command, as it accounts for the data required for the selected flags.
  2816. Similarly, the MaxScanRspLen return parameter indicates how large
  2817. the scan response can be.
  2818. LE must already be enabled, and the controller must be powered,
  2819. otherwise a "rejected" status will be returned.
  2820. This command generates a Command Complete event on success or a
  2821. Command Status event on failure.
  2822. Possible errors: Failed
  2823. Rejected
  2824. Not Supported
  2825. Invalid Parameters
  2826. Busy
  2827. Add Extended Advertising Data Command
  2828. =====================================
  2829. Command Code: 0x0055
  2830. Controller Index: <controller id>
  2831. Command Parameters: Instance (1 Octet)
  2832. Advertising Data Length (1 Octet)
  2833. Scan Response Length (1 Octet)
  2834. Advertising Data (0-255 Octets)
  2835. Scan Response (0-255 Octets)
  2836. Return Parameters: Instance (1 Octet)
  2837. The Add Extended Advertising Data command is used to update the
  2838. advertising data of an existing advertising instance known to the
  2839. kernel. It is expected to be called after an Add Extended Advertising
  2840. Parameters command, as part of the advertisement registration
  2841. process.
  2842. If extended advertising is available, this call will initiate HCI
  2843. commands to set the instance's advertising data, set scan response
  2844. data, and then enable the instance. If extended advertising is
  2845. unavailable, the advertising instance structure maintained in kernel
  2846. will have its advertising data and scan response updated, and the
  2847. instance will either be scheduled immediately or left in the queue
  2848. for later advertisement as part of round-robin advertisement rotation
  2849. in software.
  2850. If Scan_Rsp_Len is zero and the flags defined in Add Extended
  2851. Advertising Parameters command do not have connectable flag set and
  2852. the global connectable setting is off, then non-connectable
  2853. advertising is used. If Scan_Rsp_Len is larger than zero and
  2854. connectable flag is not set and the global advertising is off,
  2855. then scannable advertising is used. This small difference is
  2856. supported to provide less air traffic for devices implementing
  2857. broadcaster role.
  2858. If the Instance provided does not match a known instance, or if the
  2859. provided advertising data or scan response are in an unrecognized
  2860. format, an "Invalid Parameters" status will be returned.
  2861. If a "Set LE" or Advertising command is still in progress, a "Busy"
  2862. status will be returned.
  2863. If the controller is not powered, a "rejected" status will be returned.
  2864. This command generates a Command Complete event on success or a
  2865. Command Status event on failure.
  2866. Possible errors: Failed
  2867. Rejected
  2868. Invalid Parameters
  2869. Busy
  2870. Add Advertisement Patterns Monitor With RSSI Threshold Command
  2871. ==============================================================
  2872. Command Code: 0x0056
  2873. Controller Index: <controller id>
  2874. Command Parameters: RSSI_Data {
  2875. High_Threshold (1 Octet)
  2876. High_Threshold_Timer (2 Octets)
  2877. Low_Threshold (1 Octet)
  2878. Low_Threshold_Timer (2 Octets)
  2879. Sampling_Period (1 Octet)
  2880. }
  2881. Pattern_Count (1 Octet)
  2882. Pattern1 {
  2883. AD_Type (1 Octet)
  2884. Offset (1 Octet)
  2885. Length (1 Octet)
  2886. Value (31 Octets)
  2887. }
  2888. Pattern2 { }
  2889. ...
  2890. Return Parameters: Monitor_Handle (2 Octets)
  2891. This command is essentially the same as Add Advertisement Patterns
  2892. Monitor Command (0x0052), but with an additional RSSI parameters.
  2893. As such, if the kernel supports advertisement filtering, then the
  2894. advertisement data will be filtered in accordance with the set
  2895. RSSI parameters. Otherwise, it would behave exactly the same as the
  2896. Add Advertisement Patterns Monitor Command.
  2897. Devices would be considered "in-range" if the RSSI of the received adv
  2898. packets are greater than High_Threshold dBm for High_Threshold_Timer
  2899. seconds. Similarly, devices would be considered lost if no received
  2900. adv have RSSI greater than Low_Threshold dBm for Low_Threshold_Timer
  2901. seconds. Only adv packets of "in-range" device would be propagated.
  2902. The meaning of Sampling_Period is as follows:
  2903. 0x00 All adv packets from "in-range" devices would be
  2904. propagated.
  2905. 0xFF Only the first adv data of "in-range" devices would be
  2906. propagated. If the device becomes lost, then the first
  2907. data when it is found again will also be propagated.
  2908. other Advertisement data would be grouped into 100ms * N
  2909. time period. Data in the same group will only be
  2910. reported once, with the RSSI value being averaged out.
  2911. Possible errors: Failed
  2912. Busy
  2913. No Resources
  2914. Invalid Parameters
  2915. Command Complete Event
  2916. ======================
  2917. Event Code: 0x0001
  2918. Controller Index: <controller id> or <non-controller>
  2919. Event Parameters: Command_Opcode (2 Octets)
  2920. Status (1 Octet)
  2921. Return_Parameters
  2922. This event is an indication that a command has completed. The
  2923. fixed set of parameters includes the opcode to identify the
  2924. command that completed as well as a status value to indicate
  2925. success or failure. The rest of the parameters are command
  2926. specific and documented in the section for each command
  2927. separately.
  2928. Command Status Event
  2929. ====================
  2930. Event Code: 0x0002
  2931. Controller Index: <controller id> or <non-controller>
  2932. Event Parameters: Command_Opcode (2 Octets)
  2933. Status (1 Octet)
  2934. The command status event is used to indicate an early status for
  2935. a pending command. In the case that the status indicates failure
  2936. (anything else except success status) this also means that the
  2937. command has finished executing.
  2938. Controller Error Event
  2939. ======================
  2940. Event Code: 0x0003
  2941. Controller Index: <controller id>
  2942. Event Parameters: Error_Code (1 Octet)
  2943. This event maps straight to the HCI Hardware Error event and is
  2944. used to indicate something wrong with the controller hardware.
  2945. Index Added Event
  2946. =================
  2947. Event Code: 0x0004
  2948. Controller Index: <controller id>
  2949. Event Parameters:
  2950. This event indicates that a new controller has been added to the
  2951. system. It is usually followed by a Read Controller Information
  2952. command.
  2953. Once the Read Extended Controller Index List command has been
  2954. used at least once, the Extended Index Added event will be
  2955. send instead of this one.
  2956. Index Removed Event
  2957. ===================
  2958. Event Code: 0x0005
  2959. Controller Index: <controller id>
  2960. Event Parameters:
  2961. This event indicates that a controller has been removed from the
  2962. system.
  2963. Once the Read Extended Controller Index List command has been
  2964. used at least once, the Extended Index Removed event will be
  2965. send instead of this one.
  2966. New Settings Event
  2967. ==================
  2968. Event Code: 0x0006
  2969. Controller Index: <controller id>
  2970. Event Parameters: Current_Settings (4 Octets)
  2971. This event indicates that one or more of the settings for a
  2972. controller has changed.
  2973. Class Of Device Changed Event
  2974. =============================
  2975. Event Code: 0x0007
  2976. Controller Index: <controller id>
  2977. Event Parameters: Class_Of_Device (3 Octets)
  2978. This event indicates that the Class of Device value for the
  2979. controller has changed. When the controller is powered off the
  2980. Class of Device value will always be reported as zero.
  2981. Local Name Changed Event
  2982. ========================
  2983. Event Code: 0x0008
  2984. Controller Index: <controller id>
  2985. Event Parameters: Name (249 Octets)
  2986. Short_Name (11 Octets)
  2987. This event indicates that the local name of the controller has
  2988. changed.
  2989. New Link Key Event
  2990. ==================
  2991. Event Code: 0x0009
  2992. Controller Index: <controller id>
  2993. Event Parameters: Store_Hint (1 Octet)
  2994. Key {
  2995. Address (6 Octets)
  2996. Address_Type (1 Octet)
  2997. Key_Type (1 Octet)
  2998. Value (16 Octets)
  2999. PIN_Length (1 Octet)
  3000. }
  3001. This event indicates that a new link key has been generated for a
  3002. remote device.
  3003. The Store_Hint parameter indicates whether the host is expected
  3004. to store the key persistently or not (e.g. this would not be set
  3005. if the authentication requirement was "No Bonding").
  3006. Possible values for the Address_Type parameter:
  3007. 0 BR/EDR
  3008. 1 Reserved (not in use)
  3009. 2 Reserved (not in use)
  3010. Public and random LE addresses are not valid and will be rejected.
  3011. Currently defined Key_Type values are:
  3012. 0x00 Combination key
  3013. 0x01 Local Unit key
  3014. 0x02 Remote Unit key
  3015. 0x03 Debug Combination key
  3016. 0x04 Unauthenticated Combination key from P-192
  3017. 0x05 Authenticated Combination key from P-192
  3018. 0x06 Changed Combination key
  3019. 0x07 Unauthenticated Combination key from P-256
  3020. 0x08 Authenticated Combination key from P-256
  3021. Receiving this event indicates that a pairing procedure has
  3022. been completed.
  3023. New Long Term Key Event
  3024. =======================
  3025. Event Code: 0x000A
  3026. Controller Index: <controller id>
  3027. Event Parameters: Store_Hint (1 Octet)
  3028. Key {
  3029. Address (6 Octets)
  3030. Address_Type (1 Octet)
  3031. Key_Type (1 Octet)
  3032. Central (1 Octet)
  3033. Encryption Size (1 Octet)
  3034. Enc. Diversifier (2 Octets)
  3035. Random Number (8 Octets)
  3036. Value (16 Octets)
  3037. }
  3038. This event indicates that a new long term key has been generated
  3039. for a remote device.
  3040. The Store_Hint parameter indicates whether the host is expected
  3041. to store the key persistently or not (e.g. this would not be set
  3042. if the authentication requirement was "No Bonding").
  3043. Possible values for the Address_Type parameter:
  3044. 0 Reserved (not in use)
  3045. 1 LE Public
  3046. 2 LE Random
  3047. The provided Address and Address_Type are the identity of
  3048. a device. So either its public address or static random address.
  3049. For unresolvable random addresses and resolvable random addresses
  3050. without identity information and identity resolving key, the
  3051. Store_Hint will be set to not store the long term key.
  3052. Currently defined Key_Type values are:
  3053. 0x00 Unauthenticated legacy key
  3054. 0x01 Authenticated legacy key
  3055. 0x02 Unauthenticated key from P-256
  3056. 0x03 Authenticated key from P-256
  3057. 0x04 Debug key from P-256
  3058. Receiving this event indicates that a pairing procedure has
  3059. been completed.
  3060. Device Connected Event
  3061. ======================
  3062. Event Code: 0x000B
  3063. Controller Index: <controller id>
  3064. Event Parameters: Address (6 Octets)
  3065. Address_Type (1 Octet)
  3066. Flags (4 Octets)
  3067. EIR_Data_Length (2 Octets)
  3068. EIR_Data (0-65535 Octets)
  3069. This event indicates that a successful baseband connection has
  3070. been created to the remote device.
  3071. Possible values for the Address_Type parameter:
  3072. 0 BR/EDR
  3073. 1 LE Public
  3074. 2 LE Random
  3075. For devices using resolvable random addresses with a known
  3076. identity resolving key, the Address and Address_Type will
  3077. contain the identity information.
  3078. It is possible that devices get connected via its resolvable
  3079. random address and after New Identity Resolving Key event
  3080. start using its identity.
  3081. The following bits are defined for the Flags parameter:
  3082. 0 Reserved (not in use)
  3083. 1 Legacy Pairing
  3084. 2 Reserved (not in use)
  3085. 3 Initiated Connection
  3086. Device Disconnected Event
  3087. =========================
  3088. Event Code: 0x000C
  3089. Controller Index: <controller id>
  3090. Event Parameters: Address (6 Octets)
  3091. Address_Type (1 Octet)
  3092. Reason (1 Octet)
  3093. This event indicates that the baseband connection was lost to a
  3094. remote device.
  3095. Possible values for the Address_Type parameter:
  3096. 0 BR/EDR
  3097. 1 LE Public
  3098. 2 LE Random
  3099. For devices using resolvable random addresses with a known
  3100. identity resolving key, the Address and Address_Type will
  3101. contain the identity information.
  3102. Possible values for the Reason parameter:
  3103. 0 Unspecified
  3104. 1 Connection timeout
  3105. 2 Connection terminated by local host
  3106. 3 Connection terminated by remote host
  3107. 4 Connection terminated due to authentication failure
  3108. 5 Connection terminated by local host for suspend
  3109. Note that the local/remote distinction just determines which side
  3110. terminated the low-level connection, regardless of the
  3111. disconnection of the higher-level profiles.
  3112. This can sometimes be misleading and thus must be used with care.
  3113. For example, some hardware combinations would report a locally
  3114. initiated disconnection even if the user turned Bluetooth off in
  3115. the remote side.
  3116. Connect Failed Event
  3117. ====================
  3118. Event Code: 0x000D
  3119. Controller Index: <controller id>
  3120. Event Parameters: Address (6 Octets)
  3121. Address_Type (1 Octet)
  3122. Status (1 Octet)
  3123. This event indicates that a connection attempt failed to a
  3124. remote device.
  3125. Possible values for the Address_Type parameter:
  3126. 0 BR/EDR
  3127. 1 LE Public
  3128. 2 LE Random
  3129. For devices using resolvable random addresses with a known
  3130. identity resolving key, the Address and Address_Type will
  3131. contain the identity information.
  3132. PIN Code Request Event
  3133. ======================
  3134. Event Code: 0x000E
  3135. Controller Index: <controller id>
  3136. Event Parameters: Address (6 Octets)
  3137. Address_Type (1 Octet)
  3138. Secure (1 Octet)
  3139. This event is used to request a PIN Code reply from user space.
  3140. The reply should either be returned using the PIN Code Reply or
  3141. the PIN Code Negative Reply command.
  3142. Possible values for the Address_Type parameter:
  3143. 0 BR/EDR
  3144. 1 LE Public
  3145. 2 LE Random
  3146. Secure: 0x01 secure PIN code required
  3147. 0x00 secure PIN code not required
  3148. User Confirmation Request Event
  3149. ===============================
  3150. Event Code: 0x000F
  3151. Controller Index: <controller id>
  3152. Event Parameters: Address (6 Octets)
  3153. Address_Type (1 Octet)
  3154. Confirm_Hint (1 Octet)
  3155. Value (4 Octets)
  3156. This event is used to request a user confirmation request from
  3157. user space.
  3158. Possible values for the Address_Type parameter:
  3159. 0 BR/EDR
  3160. 1 LE Public
  3161. 2 LE Random
  3162. If the Confirm_Hint parameter value is 0x01 this means that
  3163. a simple "Yes/No" confirmation should be presented to the user
  3164. instead of a full numerical confirmation (in which case the
  3165. parameter value will be 0x00).
  3166. User space should respond to this command either using the User
  3167. Confirmation Reply or the User Confirmation Negative Reply
  3168. command.
  3169. User Passkey Request Event
  3170. ==========================
  3171. Event Code: 0x0010
  3172. Controller Index: <controller id>
  3173. Event Parameters: Address (6 Octets)
  3174. Address_Type (1 Octet)
  3175. This event is used to request a passkey from user space. The
  3176. response to this event should either be the User Passkey Reply
  3177. command or the User Passkey Negative Reply command.
  3178. Possible values for the Address_Type parameter:
  3179. 0 BR/EDR
  3180. 1 LE Public
  3181. 2 LE Random
  3182. Authentication Failed Event
  3183. ===========================
  3184. Event Code: 0x0011
  3185. Controller Index: <controller id>
  3186. Event Parameters: Address (6 Octets)
  3187. Address_Type (1 Octet)
  3188. Status (1 Octet)
  3189. This event indicates that there was an authentication failure
  3190. with a remote device.
  3191. Possible values for the Address_Type parameter:
  3192. 0 BR/EDR
  3193. 1 LE Public
  3194. 2 LE Random
  3195. Device Found Event
  3196. ==================
  3197. Event Code: 0x0012
  3198. Controller Index: <controller id>
  3199. Event Parameters: Address (6 Octets)
  3200. Address_Type (1 Octet)
  3201. RSSI (1 Octet)
  3202. Flags (4 Octets)
  3203. EIR_Data_Length (2 Octets)
  3204. EIR_Data (0-65535 Octets)
  3205. This event indicates that a device was found during device
  3206. discovery.
  3207. Possible values for the Address_Type parameter:
  3208. 0 BR/EDR
  3209. 1 LE Public
  3210. 2 LE Random
  3211. The following bits are defined for the Flags parameter:
  3212. 0 Confirm name
  3213. 1 Legacy Pairing
  3214. 2 Not Connectable
  3215. 3 Reserved (not in use)
  3216. For the RSSI field a value of 127 indicates that the RSSI is
  3217. not available. That can happen with Bluetooth 1.1 and earlier
  3218. controllers or with bad radio conditions.
  3219. The Confirm name flag indicates that the kernel wants to know
  3220. whether user space knows the name for this device or not. If
  3221. this flag is set user space should respond to it using the
  3222. Confirm Name command.
  3223. The Legacy Pairing flag indicates that Legacy Pairing is likely
  3224. to occur when pairing with this device. An application could use
  3225. this information to optimize the pairing process by locally
  3226. pre-generating a PIN code and thereby eliminate the risk of
  3227. local input timeout when pairing. Note that there is a risk of
  3228. false-positives for this flag so user space should be able to
  3229. handle getting something else as a PIN Request when pairing.
  3230. The Not Connectable flag indicates that the device will not
  3231. accept any connections. This can be indicated by Low Energy
  3232. devices that are in broadcaster role.
  3233. Discovering Event
  3234. =================
  3235. Event Code: 0x0013
  3236. Controller Index: <controller id>
  3237. Event Parameters: Address_Type (1 Octet)
  3238. Discovering (1 Octet)
  3239. This event indicates that the controller has started discovering
  3240. devices. This discovering state can come and go multiple times
  3241. between a Start Discovery and a Stop Discovery commands.
  3242. The Start Service Discovery command will also trigger this event.
  3243. The valid values for the Discovering parameter are 0x01
  3244. (enabled) and 0x00 (disabled).
  3245. Device Blocked Event
  3246. ====================
  3247. Event Code: 0x0014
  3248. Controller Index: <controller id>
  3249. Event Parameters: Address (6 Octets)
  3250. Address_Type (1 Octet)
  3251. This event indicates that a device has been blocked using the
  3252. Block Device command.
  3253. Possible values for the Address_Type parameter:
  3254. 0 BR/EDR
  3255. 1 LE Public
  3256. 2 LE Random
  3257. The event will only be sent to Management sockets other than the
  3258. one through which the command was sent.
  3259. Device Unblocked Event
  3260. ======================
  3261. Event Code: 0x0015
  3262. Controller Index: <controller id>
  3263. Event Parameters: Address (6 Octets)
  3264. Address_Type (1 Octet)
  3265. This event indicates that a device has been unblocked using the
  3266. Unblock Device command.
  3267. Possible values for the Address_Type parameter:
  3268. 0 BR/EDR
  3269. 1 LE Public
  3270. 2 LE Random
  3271. The event will only be sent to Management sockets other than the
  3272. one through which the command was sent.
  3273. Device Unpaired Event
  3274. =====================
  3275. Event Code: 0x0016
  3276. Controller Index: <controller id>
  3277. Event Parameters: Address (6 Octets)
  3278. Address_Type (1 Octet)
  3279. This event indicates that a device has been unpaired (i.e. all
  3280. its keys have been removed from the kernel) using the Unpair
  3281. Device command.
  3282. Possible values for the Address_Type parameter:
  3283. 0 BR/EDR
  3284. 1 LE Public
  3285. 2 LE Random
  3286. For devices using resolvable random addresses with a known
  3287. identity resolving key, the event parameters will contain
  3288. the identity. After receiving this event, the device will
  3289. become essentially private again.
  3290. The event will only be sent to Management sockets other than the
  3291. one through which the Unpair Device command was sent.
  3292. Passkey Notify Event
  3293. ====================
  3294. Event Code: 0x0017
  3295. Controller Index: <controller id>
  3296. Event Parameters: Address (6 Octets)
  3297. Address_Type (1 Octet)
  3298. Passkey (4 Octets)
  3299. Entered (1 Octet)
  3300. This event is used to request passkey notification to the user.
  3301. Unlike the other authentication events it does not need
  3302. responding to using any Management command.
  3303. Possible values for the Address_Type parameter:
  3304. 0 BR/EDR
  3305. 1 LE Public
  3306. 2 LE Random
  3307. The Passkey parameter indicates the passkey to be shown to the
  3308. user whereas the Entered parameter indicates how many characters
  3309. the user has entered on the remote side.
  3310. New Identity Resolving Key Event
  3311. ================================
  3312. Event Code: 0x0018
  3313. Controller Index: <controller id>
  3314. Event Parameters: Store_Hint (1 Octet)
  3315. Random_Address (6 Octets)
  3316. Key {
  3317. Address (6 Octets)
  3318. Address_Type (1 Octet)
  3319. Value (16 Octets)
  3320. }
  3321. This event indicates that a new identity resolving key has been
  3322. generated for a remote device.
  3323. The Store_Hint parameter indicates whether the host is expected
  3324. to store the key persistently or not.
  3325. The Random_Address provides the resolvable random address that
  3326. was resolved into an identity. A value of 00:00:00:00:00:00
  3327. indicates that the identity resolving key was provided for
  3328. a public address or static random address.
  3329. Once this event has been send for a resolvable random address,
  3330. all further events mapping this device will send out using the
  3331. identity address information.
  3332. This event also indicates that now the identity address should
  3333. be used for commands instead of the resolvable random address.
  3334. It is possible that some devices allow discovering via its
  3335. identity address, but after pairing using resolvable private
  3336. address only. In such a case Store_Hint will be 0x00 and the
  3337. Random_Address will indicate 00:00:00:00:00:00. For these devices,
  3338. the Privacy Characteristic of the remote GATT database should
  3339. be consulted to decide if the identity resolving key must be
  3340. stored persistently or not.
  3341. Devices using Set Privacy command with the option 0x02 would
  3342. be such type of device.
  3343. Possible values for the Address_Type parameter:
  3344. 0 Reserved (not in use)
  3345. 1 LE Public
  3346. 2 LE Random
  3347. The provided Address and Address_Type are the identity of
  3348. a device. So either its public address or static random address.
  3349. New Signature Resolving Key Event
  3350. =================================
  3351. Event Code: 0x0019
  3352. Controller Index: <controller id>
  3353. Event Parameters: Store_Hint (1 Octet)
  3354. Key {
  3355. Address (6 Octets)
  3356. Address_Type (1 Octet)
  3357. Type (1 Octet)
  3358. Value (16 Octets)
  3359. }
  3360. This event indicates that a new signature resolving key has been
  3361. generated for either the central or peripheral device.
  3362. The Store_Hint parameter indicates whether the host is expected
  3363. to store the key persistently or not.
  3364. The Type parameter has the following possible values:
  3365. 0x00 Unauthenticated local CSRK
  3366. 0x01 Unauthenticated remote CSRK
  3367. 0x02 Authenticated local CSRK
  3368. 0x03 Authenticated remote CSRK
  3369. The local keys are used for signing data to be sent to the
  3370. remote device, whereas the remote keys are used to verify
  3371. signatures received from the remote device.
  3372. The local signature resolving key will be generated with each
  3373. pairing request. Only after receiving this event with the Type
  3374. indicating a local key is it possible to use ATT Signed Write
  3375. procedures.
  3376. Possible values for the Address_Type parameter:
  3377. 0 Reserved (not in use)
  3378. 1 LE Public
  3379. 2 LE Random
  3380. The provided Address and Address_Type are the identity of
  3381. a device. So either its public address or static random address.
  3382. Device Added Event
  3383. ==================
  3384. Event Code: 0x001a
  3385. Controller Index: <controller id>
  3386. Event Parameters: Address (6 Octets)
  3387. Address_Type (1 Octet)
  3388. Action (1 Octet)
  3389. This event indicates that a device has been added using the
  3390. Add Device command.
  3391. Possible values for the Address_Type parameter:
  3392. 0 BR/EDR
  3393. 1 LE Public
  3394. 2 LE Random
  3395. The event will only be sent to management sockets other than the
  3396. one through which the command was sent.
  3397. Device Removed Event
  3398. ====================
  3399. Event Code: 0x001b
  3400. Controller Index: <controller id>
  3401. Event Parameters: Address (6 Octets)
  3402. Address_Type (1 Octet)
  3403. This event indicates that a device has been removed using the
  3404. Remove Device command.
  3405. Possible values for the Address_Type parameter:
  3406. 0 BR/EDR
  3407. 1 LE Public
  3408. 2 LE Random
  3409. The event will only be sent to management sockets other than the
  3410. one through which the command was sent.
  3411. New Connection Parameter Event
  3412. ==============================
  3413. Event Code: 0x001c
  3414. Controller Index: <controller id>
  3415. Event Parameters: Store_Hint (1 Octet)
  3416. Param {
  3417. Address (6 Octets)
  3418. Address_Type (1 Octet)
  3419. Min_Connection_Interval (2 Octets)
  3420. Max_Connection_Interval (2 Octets)
  3421. Connection_Latency (2 Octets)
  3422. Supervision_Timeout (2 Octets)
  3423. }
  3424. This event indicates a new set of connection parameters from
  3425. a peripheral device.
  3426. The Store_Hint parameter indicates whether the host is expected
  3427. to store this information persistently or not.
  3428. Possible values for the Address_Type parameter:
  3429. 0 Reserved (not in use)
  3430. 1 LE Public
  3431. 2 LE Random
  3432. The Min_Connection_Interval, Max_Connection_Interval,
  3433. Connection_Latency and Supervision_Timeout parameters are
  3434. encoded as described in Core 4.1 spec, Vol 2, 7.7.65.3.
  3435. Unconfigured Index Added Event
  3436. ==============================
  3437. Event Code: 0x001d
  3438. Controller Index: <controller id>
  3439. Event Parameters:
  3440. This event indicates that a new unconfigured controller has been
  3441. added to the system. It is usually followed by a Read Controller
  3442. Configuration Information command.
  3443. Only when a controller requires further configuration, it will
  3444. be announced with this event. If it supports configuration, but
  3445. does not require it, then an Index Added event will be used.
  3446. Once the Read Extended Controller Index List command has been
  3447. used at least once, the Extended Index Added event will be
  3448. send instead of this one.
  3449. Unconfigured Index Removed Event
  3450. ================================
  3451. Event Code: 0x001e
  3452. Controller Index: <controller id>
  3453. Event Parameters:
  3454. This event indicates that an unconfigured controller has been
  3455. removed from the system.
  3456. Once the Read Extended Controller Index List command has been
  3457. used at least once, the Extended Index Removed event will be
  3458. send instead of this one.
  3459. New Configuration Options Event
  3460. ===============================
  3461. Event Code: 0x001f
  3462. Controller Index: <controller id>
  3463. Event Parameters: Missing_Options (4 Octets)
  3464. This event indicates that one or more of the options for the
  3465. controller configuration has changed.
  3466. Extended Index Added Event
  3467. ==========================
  3468. Event Code: 0x0020
  3469. Controller Index: <controller id>
  3470. Event Parameters: Controller_Type (1 Octet)
  3471. Controller_Bus (1 Octet)
  3472. This event indicates that a new controller index has been
  3473. added to the system.
  3474. This event will only be used after Read Extended Controller Index
  3475. List has been used at least once. If it has not been used, then
  3476. Index Added and Unconfigured Index Added are sent instead.
  3477. Extended Index Removed Event
  3478. ============================
  3479. Event Code: 0x0021
  3480. Controller Index: <controller id>
  3481. Event Parameters: Controller_Type (1 Octet)
  3482. Controller_Bus (1 Octet)
  3483. This event indicates that an existing controller index has been
  3484. removed from the system.
  3485. This event will only be used after Read Extended Controller Index
  3486. List has been used at least once. If it has not been used, then
  3487. Index Removed and Unconfigured Index Removed are sent instead.
  3488. Local Out Of Band Extended Data Updated Event
  3489. =============================================
  3490. Event Code: 0x0022
  3491. Controller Index: <controller id>
  3492. Event Parameters: Address_Type (1 Octet)
  3493. EIR_Data_Length (2 Octets)
  3494. EIR_Data (0-65535 Octets)
  3495. This event is used when the Read Local Out Of Band Extended Data
  3496. command has been used and some other user requested a new set
  3497. of local out-of-band data. This allows for the original caller
  3498. to adjust the data.
  3499. Possible values for the Address_Type parameter are a bit-wise or
  3500. of the following bits:
  3501. 0 BR/EDR
  3502. 1 LE Public
  3503. 2 LE Random
  3504. By combining these e.g. the following values are possible:
  3505. 1 BR/EDR
  3506. 6 LE (public & random)
  3507. 7 Reserved (not in use)
  3508. The value for EIR_Data_Length and content for EIR_Data is the
  3509. same as described in Read Local Out Of Band Extended Data command.
  3510. When LE Privacy is used and LE Secure Connections out-of-band
  3511. data has been requested, then this event will be emitted every
  3512. time the Resolvable Private Address (RPA) gets changed. The new
  3513. RPA will be included in the EIR_Data.
  3514. The event will only be sent to management sockets other than the
  3515. one through which the command was sent. It will additionally also
  3516. only be sent to sockets that have used the command at least once.
  3517. Advertising Added Event
  3518. =======================
  3519. Event Code: 0x0023
  3520. Controller Index: <controller id>
  3521. Event Parameters: Instance (1 Octet)
  3522. This event indicates that an advertising instance has been added
  3523. using the Add Advertising command.
  3524. The event will only be sent to management sockets other than the
  3525. one through which the command was sent.
  3526. Advertising Removed Event
  3527. =========================
  3528. Event Code: 0x0024
  3529. Controller Index: <controller id>
  3530. Event Parameters: Instance (1 Octet)
  3531. This event indicates that an advertising instance has been removed
  3532. using the Remove Advertising command.
  3533. The event will only be sent to management sockets other than the
  3534. one through which the command was sent.
  3535. Extended Controller Information Changed Event
  3536. =============================================
  3537. Event Code: 0x0025
  3538. Controller Index: <controller id>
  3539. Event Parameters: EIR_Data_Length (2 Octets)
  3540. EIR_Data (0-65535 Octets)
  3541. This event indicates that controller information has been updated
  3542. and new values are used. This includes the local name, class of
  3543. device, device id and LE address information.
  3544. This event will only be used after Read Extended Controller
  3545. Information command has been used at least once. If it has not
  3546. been used the legacy events are used.
  3547. The event will only be sent to management sockets other than the
  3548. one through which the change was triggered.
  3549. PHY Configuration Changed Event
  3550. ===============================
  3551. Event Code: 0x0026
  3552. Controller Index: <controller id>
  3553. Event Parameters: Selected_PHYs (4 Octets)
  3554. This event indicates that default PHYs have been updated.
  3555. This event will only be used after Set PHY Configuration
  3556. command has been used at least once.
  3557. The event will only be sent to management sockets other than the
  3558. one through which the change was triggered.
  3559. Refer Get PHY Configuration command for PHYs parameter.
  3560. Experimental Feature Changed Event
  3561. ==================================
  3562. Event Code: 0x0027
  3563. Controller Index: <controller id>
  3564. Event Parameters: UUID (16 Octets)
  3565. Flags (4 Octets)
  3566. This event indicates that the status of an experimental feature
  3567. has been changed.
  3568. The event will only be sent to management sockets other than the
  3569. one through which the change was triggered.
  3570. Refer to Set Experimental Feature command for the Flags parameter.
  3571. Default System Configuration Changed Event
  3572. ==========================================
  3573. Event Code: 0x0028
  3574. Controller Index: <controller id>
  3575. Event Parameters: Parameter1 {
  3576. Parameter_Type (2 Octet)
  3577. Value_Length (1 Octet)
  3578. Value (0-255 Octets)
  3579. }
  3580. Parameter2 { }
  3581. ...
  3582. This event indicates the change of default system parameter values.
  3583. The event will only be sent to management sockets other than the
  3584. one through which the change was trigged. In addition it will
  3585. only be sent to sockets that have issues the Read Default System
  3586. Configuration command.
  3587. Refer to Read Default System configuration command for the supported
  3588. Parameter_Type values.
  3589. Default Runtime Configuration Changed Event
  3590. ===========================================
  3591. Event Code: 0x0029
  3592. Controller Index: <controller id>
  3593. Event Parameters: Parameter1 {
  3594. Parameter_Type (2 Octet)
  3595. Value_Length (1 Octet)
  3596. Value (0-255 Octets)
  3597. }
  3598. Parameter2 { }
  3599. ...
  3600. This event indicates the change of default runtime parameter values.
  3601. The event will only be sent to management sockets other than the
  3602. one through which the change was trigged. In addition it will
  3603. only be sent to sockets that have issues the Read Default Runtime
  3604. Configuration command.
  3605. Refer to Read Default Runtime configuration command for the supported
  3606. Parameter_Type values.
  3607. Device Flags Changed Event
  3608. ==========================
  3609. Event Code: 0x002a
  3610. Controller Index: <controller id>
  3611. Event Parameters: Address (6 Octets)
  3612. Address_Type (1 Octet)
  3613. Supported_Flags (4 Octets)
  3614. Current_Flags (4 Octets)
  3615. This event indicates that the device flags have been changed via
  3616. the Set Device Flags command or that a new device has been added
  3617. via the Add Device command. In the latter case it is send right
  3618. after the Device Added event.
  3619. Possible values for the Address_Type parameter:
  3620. 0 BR/EDR
  3621. 1 LE Public
  3622. 2 LE Random
  3623. The event will only be sent to management sockets other than the
  3624. one through which the command was sent.
  3625. In case this event is triggered by Add Device then it is sent to
  3626. all management sockets.
  3627. Advertisement Monitor Added Event
  3628. =================================
  3629. Event Code: 0x002b
  3630. Controller Index: <controller id>
  3631. Event Parameters: Monitor_Handle (2 Octets)
  3632. This event indicates that an advertisement monitor has been added
  3633. using the Add Advertisement Patterns Monitor command.
  3634. The event will only be sent to management sockets other than the
  3635. one through which the command was sent.
  3636. Advertisement Monitor Removed Event
  3637. ===================================
  3638. Event Code: 0x002c
  3639. Controller Index: <controller id>
  3640. Event Parameters: Monitor_Handle (2 Octets)
  3641. This event indicates that an advertisement monitor has been removed
  3642. using the Remove Advertisement Monitor command.
  3643. The event will only be sent to management sockets other than the
  3644. one through which the command was sent.
  3645. Controller Suspend Event
  3646. ========================
  3647. Event code: 0x002d
  3648. Controller Index: <controller_id>
  3649. Event Parameters: Suspend_State (1 octet)
  3650. This event indicates that the controller is suspended for host suspend.
  3651. Possible values for the Suspend_State parameter:
  3652. 0 Running (not disconnected)
  3653. 1 Disconnected and not scanning
  3654. 2 Page scanning and/or passive scanning.
  3655. The value 0 is used for the running state and may be sent if the
  3656. controller could not be configured to suspend properly.
  3657. This event will be sent to all management sockets.
  3658. Controller Resume Event
  3659. =======================
  3660. Event code: 0x002e
  3661. Controller Index: <controller_id>
  3662. Event Parameters: Wake_Reason (1 octet)
  3663. Address (6 octets)
  3664. Address_Type (1 octet)
  3665. This event indicates that the controller has resumed from suspend.
  3666. Possible values for the Wake_Reason parameter:
  3667. 0 Resume from non-Bluetooth wake source
  3668. 1 Wake due to unexpected event
  3669. 2 Remote wake due to peer device connection
  3670. Currently, we expect that only peer reconnections should wake us from
  3671. the suspended state. Any other events that occurred while the system
  3672. should have been suspended results in wake due to unexpected event.
  3673. If the Wake_Reason is Remote wake due to connection, the address of the
  3674. peer device that caused the event will be shared in Address and
  3675. Address_Type. Otherwise, Address and Address_Type will both be zero.
  3676. This event will be sent to all management sockets.