hci.h 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101
  1. /**************************************************************************************************
  2. Phyplus Microelectronics Limited confidential and proprietary.
  3. All rights reserved.
  4. IMPORTANT: All rights of this software belong to Phyplus Microelectronics
  5. Limited ("Phyplus"). Your use of this Software is limited to those
  6. specific rights granted under the terms of the business contract, the
  7. confidential agreement, the non-disclosure agreement and any other forms
  8. of agreements as a customer or a partner of Phyplus. You may not use this
  9. Software unless you agree to abide by the terms of these agreements.
  10. You acknowledge that the Software may not be modified, copied,
  11. distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy
  12. (BLE) integrated circuit, either as a product or is integrated into your
  13. products. Other than for the aforementioned purposes, you may not use,
  14. reproduce, copy, prepare derivative works of, modify, distribute, perform,
  15. display or sell this Software and/or its documentation for any purposes.
  16. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  17. PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  18. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  19. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  20. PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  21. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  22. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  23. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  24. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  25. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  26. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  27. **************************************************************************************************/
  28. /*******************************************************************************
  29. Filename: hci.h
  30. Revised:
  31. Revision:
  32. Description: This file contains the Host Controller Interface (HCI) API.
  33. It provides the defines, types, and functions for all
  34. supported Bluetooth Low Energy (BLE) commands.
  35. All Bluetooth and BLE commands are based on:
  36. Bluetooth Core Specification, V4.0.0, Vol. 2, Part E.
  37. *******************************************************************************/
  38. #ifndef HCI_H
  39. #define HCI_H
  40. #ifdef __cplusplus
  41. extern "C"
  42. {
  43. #endif
  44. /*******************************************************************************
  45. * INCLUDES
  46. */
  47. #include "bcomdef.h"
  48. #include "OSAL.h"
  49. #include "ll.h"
  50. //#include "hal_assert.h"
  51. /*******************************************************************************
  52. * MACROS
  53. */
  54. /*******************************************************************************
  55. * CONSTANTS
  56. */
  57. /*
  58. ** HCI Status
  59. **
  60. ** Per the Bluetooth Core Specification, V4.0.0, Vol. 2, Part D.
  61. */
  62. #define HCI_SUCCESS 0x00
  63. #define HCI_ERROR_CODE_UNKNOWN_HCI_CMD 0x01
  64. #define HCI_ERROR_CODE_UNKNOWN_CONN_ID 0x02
  65. #define HCI_ERROR_CODE_HW_FAILURE 0x03
  66. #define HCI_ERROR_CODE_PAGE_TIMEOUT 0x04
  67. #define HCI_ERROR_CODE_AUTH_FAILURE 0x05
  68. #define HCI_ERROR_CODE_PIN_KEY_MISSING 0x06
  69. #define HCI_ERROR_CODE_MEM_CAP_EXCEEDED 0x07
  70. #define HCI_ERROR_CODE_CONN_TIMEOUT 0x08
  71. #define HCI_ERROR_CODE_CONN_LIMIT_EXCEEDED 0x09
  72. #define HCI_ERROR_CODE_SYNCH_CONN_LIMIT_EXCEEDED 0x0A
  73. #define HCI_ERROR_CODE_ACL_CONN_ALREADY_EXISTS 0x0B
  74. #define HCI_ERROR_CODE_CMD_DISALLOWED 0x0C
  75. #define HCI_ERROR_CODE_CONN_REJ_LIMITED_RESOURCES 0x0D
  76. #define HCI_ERROR_CODE_CONN_REJECTED_SECURITY_REASONS 0x0E
  77. #define HCI_ERROR_CODE_CONN_REJECTED_UNACCEPTABLE_BDADDR 0x0F
  78. #define HCI_ERROR_CODE_CONN_ACCEPT_TIMEOUT_EXCEEDED 0x10
  79. #define HCI_ERROR_CODE_UNSUPPORTED_FEATURE_PARAM_VALUE 0x11
  80. #define HCI_ERROR_CODE_INVALID_HCI_CMD_PARAMS 0x12
  81. #define HCI_ERROR_CODE_REMOTE_USER_TERM_CONN 0x13
  82. #define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES 0x14
  83. #define HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF 0x15
  84. #define HCI_ERROR_CODE_CONN_TERM_BY_LOCAL_HOST 0x16
  85. #define HCI_ERROR_CODE_REPEATED_ATTEMPTS 0x17
  86. #define HCI_ERROR_CODE_PAIRING_NOT_ALLOWED 0x18
  87. #define HCI_ERROR_CODE_UNKNOWN_LMP_PDU 0x19
  88. #define HCI_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE 0x1A
  89. #define HCI_ERROR_CODE_SCO_OFFSET_REJ 0x1B
  90. #define HCI_ERROR_CODE_SCO_INTERVAL_REJ 0x1C
  91. #define HCI_ERROR_CODE_SCO_AIR_MODE_REJ 0x1D
  92. #define HCI_ERROR_CODE_INVALID_LMP_PARAMS 0x1E
  93. #define HCI_ERROR_CODE_UNSPECIFIED_ERROR 0x1F
  94. #define HCI_ERROR_CODE_UNSUPPORTED_LMP_PARAM_VAL 0x20
  95. #define HCI_ERROR_CODE_ROLE_CHANGE_NOT_ALLOWED 0x21
  96. #define HCI_ERROR_CODE_LMP_LL_RESP_TIMEOUT 0x22
  97. #define HCI_ERROR_CODE_LMP_ERR_TRANSACTION_COLLISION 0x23
  98. #define HCI_ERROR_CODE_LMP_PDU_NOT_ALLOWED 0x24
  99. #define HCI_ERROR_CODE_ENCRYPT_MODE_NOT_ACCEPTABLE 0x25
  100. #define HCI_ERROR_CODE_LINK_KEY_CAN_NOT_BE_CHANGED 0x26
  101. #define HCI_ERROR_CODE_REQ_QOS_NOT_SUPPORTED 0x27
  102. #define HCI_ERROR_CODE_INSTANT_PASSED 0x28
  103. #define HCI_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED 0x29
  104. #define HCI_ERROR_CODE_DIFFERENT_TRANSACTION_COLLISION 0x2A
  105. #define HCI_ERROR_CODE_RESERVED1 0x2B
  106. #define HCI_ERROR_CODE_QOS_UNACCEPTABLE_PARAM 0x2C
  107. #define HCI_ERROR_CODE_QOS_REJ 0x2D
  108. #define HCI_ERROR_CODE_CHAN_ASSESSMENT_NOT_SUPPORTED 0x2E
  109. #define HCI_ERROR_CODE_INSUFFICIENT_SECURITY 0x2F
  110. #define HCI_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE 0x30
  111. #define HCI_ERROR_CODE_RESERVED2 0x31
  112. #define HCI_ERROR_CODE_ROLE_SWITCH_PENDING 0x32
  113. #define HCI_ERROR_CODE_RESERVED3 0x33
  114. #define HCI_ERROR_CODE_RESERVED_SLOT_VIOLATION 0x34
  115. #define HCI_ERROR_CODE_ROLE_SWITCH_FAILED 0x35
  116. #define HCI_ERROR_CODE_EXTENDED_INQUIRY_RESP_TOO_LARGE 0x36
  117. #define HCI_ERROR_CODE_SIMPLE_PAIRING_NOT_SUPPORTED_BY_HOST 0x37
  118. #define HCI_ERROR_CODE_HOST_BUSY_PAIRING 0x38
  119. #define HCI_ERROR_CODE_CONN_REJ_NO_SUITABLE_CHAN_FOUND 0x39
  120. #define HCI_ERROR_CODE_CONTROLLER_BUSY 0x3A
  121. #define HCI_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL 0x3B
  122. #define HCI_ERROR_CODE_DIRECTED_ADV_TIMEOUT 0x3C
  123. #define HCI_ERROR_CODE_CONN_TERM_MIC_FAILURE 0x3D
  124. #define HCI_ERROR_CODE_CONN_FAILED_TO_ESTABLISH 0x3E
  125. #define HCI_ERROR_CODE_MAC_CONN_FAILED 0x3F
  126. /*
  127. ** Max Buffers Supported
  128. */
  129. #define HCI_MAX_NUM_DATA_BUFFERS LL_MAX_NUM_DATA_BUFFERS
  130. #define HCI_MAX_NUM_CMD_BUFFERS LL_MAX_NUM_CMD_BUFFERS
  131. /*
  132. ** HCI Command API Parameters
  133. */
  134. // Send Data Packet Boundary Flags
  135. #define FIRST_PKT_HOST_TO_CTRL LL_DATA_FIRST_PKT_HOST_TO_CTRL
  136. #define CONTINUING_PKT LL_DATA_CONTINUATION_PKT
  137. #define FIRST_PKT_CTRL_TO_HOST LL_DATA_FIRST_PKT_CTRL_TO_HOST
  138. // Receive Data Packet
  139. #define HCI_RSSI_NOT_AVAILABLE LL_RSSI_NOT_AVAILABLE
  140. // Disconnect Reasons
  141. #define HCI_DISCONNECT_AUTH_FAILURE HCI_ERROR_CODE_AUTH_FAILURE
  142. #define HCI_DISCONNECT_REMOTE_USER_TERM HCI_ERROR_CODE_REMOTE_USER_TERM_CONN
  143. #define HCI_DISCONNECT_REMOTE_DEV_LOW_RESOURCES HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_LOW_RESOURCES
  144. #define HCI_DISCONNECT_REMOTE_DEV_POWER_OFF HCI_ERROR_CODE_REMOTE_DEVICE_TERM_CONN_POWER_OFF
  145. #define HCI_DISCONNECT_UNSUPPORTED_REMOTE_FEATURE HCI_ERROR_CODE_UNSUPPORTED_REMOTE_FEATURE
  146. #define HCI_DISCONNECT_KEY_PAIRING_NOT_SUPPORTED HCI_ERROR_CODE_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED
  147. #define HCI_DISCONNECT_UNACCEPTABLE_CONN_INTERVAL HCI_ERROR_CODE_UNACCEPTABLE_CONN_INTERVAL
  148. // Tx Power Types
  149. #define HCI_READ_CURRENT_TX_POWER_LEVEL LL_READ_CURRENT_TX_POWER_LEVEL
  150. #define HCI_READ_MAX_TX_POWER_LEVEL LL_READ_MAX_TX_POWER_LEVEL
  151. // Host Flow Control
  152. #define HCI_CTRL_TO_HOST_FLOW_CTRL_OFF 0
  153. #define HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_ON_SYNCH_OFF 1
  154. #define HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_OFF_SYNCH_ON 2
  155. #define HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_ON_SYNCH_ON 3
  156. // Device Address Type
  157. #define HCI_PUBLIC_DEVICE_ADDRESS LL_DEV_ADDR_TYPE_PUBLIC
  158. #define HCI_RANDOM_DEVICE_ADDRESS LL_DEV_ADDR_TYPE_RANDOM
  159. // Advertiser Events
  160. #define HCI_CONNECTABLE_UNDIRECTED_ADV LL_ADV_CONNECTABLE_UNDIRECTED_EVT
  161. #define HCI_CONNECTABLE_DIRECTED_HDC_ADV LL_ADV_CONNECTABLE_DIRECTED_HDC_EVT
  162. #define HCI_SCANNABLE_UNDIRECTED LL_ADV_SCANNABLE_UNDIRECTED_EVT
  163. #define HCI_NONCONNECTABLE_UNDIRECTED_ADV LL_ADV_NONCONNECTABLE_UNDIRECTED_EVT
  164. #define HCI_CONNECTABLE_DIRECTED_LDC_ADV LL_ADV_CONNECTABLE_DIRECTED_LDC_EVT
  165. // Advertiser Channels
  166. #define HCI_ADV_CHAN_37 LL_ADV_CHAN_37
  167. #define HCI_ADV_CHAN_38 LL_ADV_CHAN_38
  168. #define HCI_ADV_CHAN_39 LL_ADV_CHAN_39
  169. #define HCI_ADV_CHAN_ALL (LL_ADV_CHAN_37 | LL_ADV_CHAN_38 | LL_ADV_CHAN_39)
  170. // Advertiser White List Policy
  171. #define HCI_ADV_WL_POLICY_ANY_REQ LL_ADV_WL_POLICY_ANY_REQ
  172. #define HCI_ADV_WL_POLICY_WL_SCAN_REQ LL_ADV_WL_POLICY_WL_SCAN_REQ
  173. #define HCI_ADV_WL_POLICY_WL_CONNECT_REQ LL_ADV_WL_POLICY_WL_CONNECT_REQ
  174. #define HCI_ADV_WL_POLICY_WL_ALL_REQ LL_ADV_WL_POLICY_WL_ALL_REQ
  175. // Advertiser Commands
  176. #define HCI_ENABLE_ADV LL_ADV_MODE_ON
  177. #define HCI_DISABLE_ADV LL_ADV_MODE_OFF
  178. // Scan Types
  179. #define HCI_SCAN_PASSIVE LL_SCAN_PASSIVE
  180. #define HCI_SCAN_ACTIVE LL_SCAN_ACTIVE
  181. // Scan White List Policy
  182. #define HCI_SCAN_WL_POLICY_ANY_ADV_PKTS LL_SCAN_WL_POLICY_ANY_ADV_PKTS
  183. #define HCI_SCAN_WL_POLICY_USE_WHITE_LIST LL_SCAN_WL_POLICY_USE_WHITE_LIST
  184. // Scan Filtering
  185. #define HCI_FILTER_REPORTS_DISABLE LL_FILTER_REPORTS_DISABLE
  186. #define HCI_FILTER_REPORTS_ENABLE LL_FILTER_REPORTS_ENABLE
  187. // Scan Commands
  188. #define HCI_SCAN_STOP LL_SCAN_STOP
  189. #define HCI_SCAN_START LL_SCAN_START
  190. // Initiator White List Policy
  191. #define HCI_INIT_WL_POLICY_USE_PEER_ADDR LL_INIT_WL_POLICY_USE_PEER_ADDR
  192. #define HCI_INIT_WL_POLICY_USE_WHITE_LIST LL_INIT_WL_POLICY_USE_WHITE_LIST
  193. // Encryption Related
  194. #define HCI_ENCRYPTION_OFF LL_ENCRYPTION_OFF
  195. #define HCI_ENCRYPTION_ON LL_ENCRYPTION_ON
  196. // Direct Test Mode
  197. #define HCI_DTM_NUMBER_RF_CHANS LL_DIRECT_TEST_NUM_RF_CHANS
  198. #define HCI_DIRECT_TEST_MAX_PAYLOAD_LEN LL_DIRECT_TEST_MAX_PAYLOAD_LEN
  199. //
  200. #define HCI_DIRECT_TEST_PAYLOAD_PRBS9 LL_DIRECT_TEST_PAYLOAD_PRBS9
  201. #define HCI_DIRECT_TEST_PAYLOAD_0x0F LL_DIRECT_TEST_PAYLOAD_0x0F
  202. #define HCI_DIRECT_TEST_PAYLOAD_0x55 LL_DIRECT_TEST_PAYLOAD_0x55
  203. #define HCI_DIRECT_TEST_PAYLOAD_PRBS15 LL_DIRECT_TEST_PAYLOAD_PRBS15
  204. #define HCI_DIRECT_TEST_PAYLOAD_0xFF LL_DIRECT_TEST_PAYLOAD_0xFF
  205. #define HCI_DIRECT_TEST_PAYLOAD_0x00 LL_DIRECT_TEST_PAYLOAD_0x00
  206. #define HCI_DIRECT_TEST_PAYLOAD_0xF0 LL_DIRECT_TEST_PAYLOAD_0xF0
  207. #define HCI_DIRECT_TEST_PAYLOAD_0xAA LL_DIRECT_TEST_PAYLOAD_0xAA
  208. // Vendor Specific
  209. #define HCI_EXT_RX_GAIN_STD LL_EXT_RX_GAIN_STD
  210. #define HCI_EXT_RX_GAIN_HIGH LL_EXT_RX_GAIN_HIGH
  211. //
  212. #define HCI_EXT_TX_POWER_MINUS_23_DBM LL_EXT_TX_POWER_MINUS_23_DBM
  213. #define HCI_EXT_TX_POWER_MINUS_6_DBM LL_EXT_TX_POWER_MINUS_6_DBM
  214. #define HCI_EXT_TX_POWER_0_DBM LL_EXT_TX_POWER_0_DBM
  215. #define HCI_EXT_TX_POWER_4_DBM LL_EXT_TX_POWER_4_DBM
  216. //
  217. #define HCI_EXT_ENABLE_ONE_PKT_PER_EVT LL_EXT_ENABLE_ONE_PKT_PER_EVT
  218. #define HCI_EXT_DISABLE_ONE_PKT_PER_EVT LL_EXT_DISABLE_ONE_PKT_PER_EVT
  219. //
  220. #define HCI_EXT_ENABLE_CLK_DIVIDE_ON_HALT LL_EXT_ENABLE_CLK_DIVIDE_ON_HALT
  221. #define HCI_EXT_DISABLE_CLK_DIVIDE_ON_HALT LL_EXT_DISABLE_CLK_DIVIDE_ON_HALT
  222. //
  223. #define HCI_EXT_NV_IN_USE LL_EXT_NV_IN_USE
  224. #define HCI_EXT_NV_NOT_IN_USE LL_EXT_NV_NOT_IN_USE
  225. //
  226. #define HCI_EXT_ENABLE_FAST_TX_RESP_TIME LL_EXT_ENABLE_FAST_TX_RESP_TIME
  227. #define HCI_EXT_DISABLE_FAST_TX_RESP_TIME LL_EXT_DISABLE_FAST_TX_RESP_TIME
  228. //
  229. #define HCI_EXT_ENABLE_SL_OVERRIDE LL_EXT_ENABLE_SL_OVERRIDE
  230. #define HCI_EXT_DISABLE_SL_OVERRIDE LL_EXT_DISABLE_SL_OVERRIDE
  231. //
  232. #define HCI_EXT_TX_MODULATED_CARRIER LL_EXT_TX_MODULATED_CARRIER
  233. #define HCI_EXT_TX_UNMODULATED_CARRIER LL_EXT_TX_UNMODULATED_CARRIER
  234. //
  235. #define HCI_PTM_SET_FREQ_TUNE_DOWN LL_EXT_SET_FREQ_TUNE_DOWN
  236. #define HCI_PTM_SET_FREQ_TUNE_UP LL_EXT_SET_FREQ_TUNE_UP
  237. //
  238. #define HCI_EXT_PM_IO_PORT_P0 LL_EXT_PM_IO_PORT_P0
  239. #define HCI_EXT_PM_IO_PORT_P1 LL_EXT_PM_IO_PORT_P1
  240. #define HCI_EXT_PM_IO_PORT_P2 LL_EXT_PM_IO_PORT_P2
  241. #define HCI_EXT_PM_IO_PORT_NONE LL_EXT_PM_IO_PORT_NONE
  242. //
  243. #define HCI_EXT_PM_IO_PORT_PIN0 LL_EXT_PM_IO_PORT_PIN0
  244. #define HCI_EXT_PM_IO_PORT_PIN1 LL_EXT_PM_IO_PORT_PIN1
  245. #define HCI_EXT_PM_IO_PORT_PIN2 LL_EXT_PM_IO_PORT_PIN2
  246. #define HCI_EXT_PM_IO_PORT_PIN3 LL_EXT_PM_IO_PORT_PIN3
  247. #define HCI_EXT_PM_IO_PORT_PIN4 LL_EXT_PM_IO_PORT_PIN4
  248. #define HCI_EXT_PM_IO_PORT_PIN5 LL_EXT_PM_IO_PORT_PIN5
  249. #define HCI_EXT_PM_IO_PORT_PIN6 LL_EXT_PM_IO_PORT_PIN6
  250. #define HCI_EXT_PM_IO_PORT_PIN7 LL_EXT_PM_IO_PORT_PIN7
  251. //
  252. #define HCI_EXT_PER_RESET LL_EXT_PER_RESET
  253. #define HCI_EXT_PER_READ LL_EXT_PER_READ
  254. //
  255. #define HCI_EXT_HALT_DURING_RF_DISABLE LL_EXT_HALT_DURING_RF_DISABLE
  256. #define HCI_EXT_HALT_DURING_RF_ENABLE LL_EXT_HALT_DURING_RF_ENABLE
  257. //
  258. #define HCI_EXT_SET_USER_REVISION LL_EXT_SET_USER_REVISION
  259. #define HCI_EXT_READ_BUILD_REVISION LL_EXT_READ_BUILD_REVISION
  260. //
  261. #define HCI_EXT_RESET_SYSTEM_HARD LL_EXT_RESET_SYSTEM_HARD
  262. #define HCI_EXT_RESET_SYSTEM_SOFT LL_EXT_RESET_SYSTEM_SOFT
  263. //
  264. #define HCI_EXT_DISABLE_OVERLAPPED_PROCESSING LL_EXT_DISABLE_OVERLAPPED_PROCESSING
  265. #define HCI_EXT_ENABLE_OVERLAPPED_PROCESSING LL_EXT_ENABLE_OVERLAPPED_PROCESSING
  266. //
  267. #define HCI_EXT_DISABLE_NUM_COMPL_PKTS_ON_EVENT LL_EXT_DISABLE_NUM_COMPL_PKTS_ON_EVENT
  268. #define HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT LL_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT
  269. /*
  270. ** HCI Event Parameters
  271. */
  272. // HCI Link Type for Buffer Overflow
  273. #define HCI_LINK_TYPE_SCO_BUFFER_OVERFLOW 0
  274. #define HCI_LINK_TYPE_ACL_BUFFER_OVERFLOW 1
  275. /*******************************************************************************
  276. * TYPEDEFS
  277. */
  278. typedef uint8 hciStatus_t;
  279. /*
  280. ** LE Events
  281. */
  282. // LE Connection Complete Event
  283. typedef struct
  284. {
  285. osal_event_hdr_t hdr;
  286. uint8 BLEEventCode;
  287. uint8 status;
  288. uint16 connectionHandle;
  289. uint8 role;
  290. uint8 peerAddrType;
  291. uint8 peerAddr[B_ADDR_LEN];
  292. uint16 connInterval;
  293. uint16 connLatency;
  294. uint16 connTimeout;
  295. uint8 clockAccuracy;
  296. } hciEvt_BLEConnComplete_t;
  297. // LE Advertising Report Event
  298. typedef struct
  299. {
  300. uint8 eventType; // advertisment or scan response event type
  301. uint8 addrType; // public or random address type
  302. uint8 addr[B_ADDR_LEN]; // device address
  303. uint8 dataLen; // length of report data
  304. uint8 rspData[B_MAX_ADV_LEN]; // report data given by dataLen
  305. int8 rssi; // report RSSI
  306. } hciEvt_DevInfo_t;
  307. typedef struct
  308. {
  309. osal_event_hdr_t hdr;
  310. uint8 BLEEventCode;
  311. uint8 numDevices;
  312. hciEvt_DevInfo_t* devInfo; // pointer to the array of devInfo
  313. } hciEvt_BLEAdvPktReport_t;
  314. // LE Connection Update Complete Event
  315. typedef struct
  316. {
  317. osal_event_hdr_t hdr;
  318. uint8 BLEEventCode;
  319. uint8 status;
  320. uint16 connectionHandle;
  321. uint16 connInterval;
  322. uint16 connLatency;
  323. uint16 connTimeout;
  324. } hciEvt_BLEConnUpdateComplete_t;
  325. // LE Read Remote Used Features Complete Event
  326. typedef struct
  327. {
  328. osal_event_hdr_t hdr;
  329. uint8 BLEEventCode;
  330. uint8 status;
  331. uint16 connectionHandle;
  332. uint8 features[8];
  333. } hciEvt_BLEReadRemoteFeatureComplete_t;
  334. // LE Encryption Change Event
  335. typedef struct
  336. {
  337. osal_event_hdr_t hdr;
  338. uint8 BLEEventCode;
  339. uint16 connHandle;
  340. uint8 reason;
  341. uint8 encEnable;
  342. } hciEvt_EncryptChange_t;
  343. // LE Long Term Key Requested Event
  344. typedef struct
  345. {
  346. osal_event_hdr_t hdr;
  347. uint8 BLEEventCode;
  348. uint16 connHandle;
  349. uint8 random[B_RANDOM_NUM_SIZE];
  350. uint16 encryptedDiversifier;
  351. } hciEvt_BLELTKReq_t;
  352. // LE DATE LENGTH CHANGE Event
  353. typedef struct
  354. {
  355. osal_event_hdr_t hdr;
  356. uint8 BLEEventCode;
  357. uint16 connHandle;
  358. uint16 MaxTxOctets;
  359. uint16 MaxTxTime;
  360. uint16 MaxRxOctets;
  361. uint16 MaxRxTime;
  362. } hciEvt_BLEDataLenChange_t;
  363. // LE PHY UPDATE Complete Event
  364. typedef struct
  365. {
  366. osal_event_hdr_t hdr;
  367. uint8 BLEEventCode;
  368. uint8 status;
  369. uint16 connHandle;
  370. uint8 txPhy;
  371. uint8 rxPhy;
  372. } hciEvt_BLEPhyUpdateComplete_t;
  373. // LE PHY UPDATE Complete Event
  374. typedef struct
  375. {
  376. osal_event_hdr_t hdr;
  377. uint8 BLEEventCode;
  378. } hciEvt_BLEEvent_Hdr_t;
  379. // Number of Completed Packets Event
  380. typedef struct
  381. {
  382. osal_event_hdr_t hdr;
  383. uint8 numHandles;
  384. uint16 *pConnectionHandle; // pointer to the connection handle array
  385. uint16 *pNumCompletedPackets; // pointer to the number of completed packets array
  386. } hciEvt_NumCompletedPkt_t;
  387. // Command Complete Event
  388. typedef struct
  389. {
  390. osal_event_hdr_t hdr;
  391. uint8 numHciCmdPkt; // number of HCI Command Packet
  392. uint16 cmdOpcode;
  393. uint8 *pReturnParam; // pointer to the return parameter
  394. } hciEvt_CmdComplete_t;
  395. // Command Status Event
  396. typedef struct
  397. {
  398. osal_event_hdr_t hdr;
  399. uint8 cmdStatus;
  400. uint8 numHciCmdPkt;
  401. uint16 cmdOpcode;
  402. } hciEvt_CommandStatus_t;
  403. // Hardware Error Event
  404. typedef struct
  405. {
  406. osal_event_hdr_t hdr;
  407. uint8 hardwareCode;
  408. } hciEvt_HardwareError_t;
  409. // Disconnection Complete Event
  410. typedef struct
  411. {
  412. osal_event_hdr_t hdr;
  413. uint8 status;
  414. uint16 connHandle; // connection handle
  415. uint8 reason;
  416. } hciEvt_DisconnComplete_t;
  417. // Data Buffer Overflow Event
  418. typedef struct
  419. {
  420. osal_event_hdr_t hdr;
  421. uint8 linkType; // synchronous or asynchronous buffer overflow
  422. } hciEvt_BufferOverflow_t;
  423. // Data structure for HCI Command Complete Event Return Parameter
  424. typedef struct
  425. {
  426. uint8 status;
  427. uint16 dataPktLen;
  428. uint8 numDataPkts;
  429. } hciRetParam_LeReadBufSize_t;
  430. typedef struct
  431. {
  432. uint16 eventType; // advertisment or scan response event type
  433. uint8 addrType; // public or random address type
  434. uint8 addr[B_ADDR_LEN]; // device address
  435. uint8 primaryPHY;
  436. uint8 secondaryPHY;
  437. uint8 advertisingSID;
  438. uint8 txPower;
  439. int8 rssi; // report RSSI
  440. uint16 periodicAdvertisingInterval;
  441. uint8 directAddrType;
  442. uint8 directAddr[B_ADDR_LEN];
  443. uint8 dataLen; // length of report data
  444. uint8 rptData[B_MAX_EXT_ADV_LEN]; // report data given by dataLen
  445. } hciEvt_ExtAdvRptInfo_t;
  446. // Extended adv report
  447. typedef struct
  448. {
  449. osal_event_hdr_t hdr;
  450. uint8 BLEEventCode;
  451. uint8 numReports;
  452. hciEvt_ExtAdvRptInfo_t* rptInfo; // pointer to the array of devInfo
  453. } hciEvt_BLEExtAdvPktReport_t;
  454. typedef struct
  455. {
  456. osal_event_hdr_t hdr;
  457. uint8 BLEEventCode;
  458. uint8 status;
  459. uint16 syncHandle;
  460. uint8 advertisingSID;
  461. uint8 advertiserAddressType;
  462. uint8 advertiserAddress[B_ADDR_LEN];
  463. uint8 advertiserPHY;
  464. uint16 periodicAdvertisingInterval;
  465. uint8 advertiserClockAccuracy;
  466. } hciEvt_BLEPrdAdvSyncEstabPkt_t;
  467. typedef struct
  468. {
  469. osal_event_hdr_t hdr;
  470. uint8 BLEEventCode;
  471. uint16 syncHandle;
  472. } hciEvt_BLEPrdAdvSyncLostPkt_t;
  473. // 2020-01-14 LE IQ report event structure
  474. typedef struct
  475. {
  476. uint16 Handle; // syncHandle for connectionless handle , connection for connection Handle
  477. uint8 chan_idx;
  478. int16 rssi;
  479. uint8 rssi_antID;
  480. uint8 cte_type;
  481. uint8 slot_duration;
  482. uint8 packet_status;
  483. uint16 EventCnt; // paEventcounter or connEventCounter
  484. uint8 sampCnt;
  485. uint8 ISample[B_MAX_IQ_LEN];
  486. uint8 QSample[B_MAX_IQ_LEN];
  487. }hciEvt_IQReportPkt_t;
  488. // 2020-01-14 LE Connectionless IQ report event structure
  489. typedef struct
  490. {
  491. osal_event_hdr_t hdr;
  492. uint8 BLEEventCode;
  493. hciEvt_IQReportPkt_t ConnectionlessIQ;
  494. }hciEvt_BLEConnectionlessIQ_Pkt_t;
  495. // 2020-01-14 LE Connection IQ report event structure
  496. typedef struct
  497. {
  498. osal_event_hdr_t hdr;
  499. uint8 BLEEventCode;
  500. uint8 RX_PHY;
  501. hciEvt_IQReportPkt_t ConnectionIQ;
  502. }hciEvt_BLEConnectionIQ_Pkt_t;
  503. // 2020-01-14 LE Connection IQ report event structure
  504. typedef struct
  505. {
  506. osal_event_hdr_t hdr;
  507. uint8 BLEEventCode;
  508. uint8 status;
  509. uint16 connHandle;
  510. }hciEvt_BLE_CTEReport_Pkt_t;
  511. typedef struct
  512. {
  513. uint16 syncHandle;
  514. uint8 txPower;
  515. uint8 rssi;
  516. uint8 cteType;
  517. uint8 dataStatus;
  518. uint8 dataLength;
  519. uint8 data[B_MAX_PERIOD_ADV_LEN];
  520. } hciEvt_PrdAdvRptInfo_t;
  521. // Periodic adv report
  522. typedef struct
  523. {
  524. osal_event_hdr_t hdr;
  525. uint8 BLEEventCode;
  526. hciEvt_PrdAdvRptInfo_t* rptInfo; // pointer to the array of devInfo
  527. } hciEvt_BLEPrdAdvPktReport_t;
  528. typedef struct
  529. {
  530. osal_event_hdr_t hdr;
  531. uint8 *pData;
  532. } hciPacket_t;
  533. typedef struct
  534. {
  535. osal_event_hdr_t hdr;
  536. uint8 pktType;
  537. uint16 connHandle;
  538. uint8 pbFlag;
  539. uint16 pktLen;
  540. uint8 *pData;
  541. } hciDataPacket_t;
  542. // OSAL HCI_DATA_EVENT message format. This message is used to forward incoming
  543. // data messages up to an application
  544. typedef struct
  545. {
  546. osal_event_hdr_t hdr; // OSAL event header
  547. uint16 connHandle; // connection handle
  548. uint8 pbFlag; // data packet boundary flag
  549. uint16 len; // length of data packet
  550. uint8 *pData; // data packet given by len
  551. } hciDataEvent_t;
  552. /*******************************************************************************
  553. * LOCAL VARIABLES
  554. */
  555. /*******************************************************************************
  556. * GLOBAL VARIABLES
  557. */
  558. /*
  559. ** HCI Support Functions
  560. */
  561. /*******************************************************************************
  562. * @fn HCI_bm_alloc API
  563. *
  564. * @brief This API is used to allocate memory using buffer management.
  565. *
  566. * Note: This function should never be called by the application.
  567. * It is only used by HCI and L2CAP_bm_alloc.
  568. *
  569. * input parameters
  570. *
  571. * @param size - Number of bytes to allocate from the heap.
  572. *
  573. * output parameters
  574. *
  575. * @param None.
  576. *
  577. * @return Pointer to buffer, or NULL.
  578. */
  579. extern void *HCI_bm_alloc( uint16 size );
  580. /*******************************************************************************
  581. * @fn HCI_ValidConnTimeParams API
  582. *
  583. * @brief This API is used to check that the connection time parameter
  584. * ranges are valid, and that the connection time parameter
  585. * combination is valid.
  586. *
  587. * Note: Only connIntervalMax is used as part of the time parameter
  588. * combination check.
  589. *
  590. * input parameters
  591. *
  592. * @param connIntervalMin - Minimum connection interval.
  593. * @param connIntervalMax - Maximum connection interval.
  594. * @param connLatency - Connection slave latency.
  595. * @param connTimeout - Connection supervision timeout.
  596. *
  597. * output parameters
  598. *
  599. * @param None.
  600. *
  601. * @return TRUE: Connection time parameter check is valid.
  602. * FALSE: Connection time parameter check is invalid.
  603. */
  604. extern uint8 HCI_ValidConnTimeParams( uint16 connIntervalMin,
  605. uint16 connIntervalMax,
  606. uint16 connLatency,
  607. uint16 connTimeout );
  608. /*******************************************************************************
  609. * @fn HCI_TestAppTaskRegister
  610. *
  611. * @brief HCI vendor specific registration for HCI Test Application.
  612. *
  613. * input parameters
  614. *
  615. * @param taskID - The HCI Test Application OSAL task identifer.
  616. *
  617. * output parameters
  618. *
  619. * @param None.
  620. *
  621. * @return None.
  622. */
  623. extern void HCI_TestAppTaskRegister( uint8 taskID );
  624. /*******************************************************************************
  625. * @fn HCI_GAPTaskRegister
  626. *
  627. * @brief HCI vendor specific registration for Host GAP.
  628. *
  629. * input parameters
  630. *
  631. * @param taskID - The Host GAP OSAL task identifer.
  632. *
  633. * output parameters
  634. *
  635. * @param None.
  636. *
  637. * @return None.
  638. */
  639. extern void HCI_GAPTaskRegister( uint8 taskID );
  640. /*******************************************************************************
  641. *
  642. * @fn HCI_L2CAPTaskRegister
  643. *
  644. * @brief HCI vendor specific registration for Host L2CAP.
  645. *
  646. * input parameters
  647. *
  648. * @param taskID - The Host L2CAP OSAL task identifer.
  649. *
  650. * output parameters
  651. *
  652. * @param None.
  653. *
  654. * @return None.
  655. *
  656. */
  657. extern void HCI_L2CAPTaskRegister( uint8 taskID );
  658. /*******************************************************************************
  659. * @fn HCI_SMPTaskRegister
  660. *
  661. * @brief HCI vendor specific registration for Host SMP.
  662. *
  663. * input parameters
  664. *
  665. * @param taskID - The Host SMP OSAL task identifer.
  666. *
  667. * output parameters
  668. *
  669. * @param None.
  670. *
  671. * @return None.
  672. */
  673. extern void HCI_SMPTaskRegister( uint8 taskID );
  674. /*******************************************************************************
  675. * @fn HCI_ExtTaskRegister
  676. *
  677. * @brief HCI vendor specific registration for Host extended commands.
  678. *
  679. * input parameters
  680. *
  681. * @param taskID - The Host Extended Command OSAL task identifer.
  682. *
  683. * output parameters
  684. *
  685. * @param None.
  686. *
  687. * @return None.
  688. */
  689. extern void HCI_ExtTaskRegister( uint8 taskID );
  690. /*******************************************************************************
  691. * @fn HCI_SendDataPkt API
  692. *
  693. * @brief This API is used to send a ACL data packet over a connection.
  694. *
  695. * Note: Empty packets are not sent.
  696. *
  697. * Related Events: HCI_NumOfCompletedPacketsEvent
  698. *
  699. * input parameters
  700. *
  701. * @param connHandle - Connection ID (handle).
  702. * @param pbFlag - Packet Boundary Flag.
  703. * @param pktLen - Number of bytes of data to transmit.
  704. * @param *pData - Pointer to data buffer to transmit.
  705. *
  706. * output parameters
  707. *
  708. * @param None.
  709. *
  710. * @return hciStatus_t
  711. */
  712. extern hciStatus_t HCI_SendDataPkt( uint16 connHandle,
  713. uint8 pbFlag,
  714. uint16 pktLen,
  715. uint8 *pData );
  716. /*
  717. ** HCI API
  718. */
  719. /*******************************************************************************
  720. * @fn HCI_DisconnectCmd API
  721. *
  722. * @brief This BT API is used to terminate a connection.
  723. *
  724. * Related Events: HCI_CommandStatusEvent,
  725. * DisconnectEvent
  726. *
  727. * input parameters
  728. *
  729. * @param connHandle - Connection handle.
  730. * @param reason - Reason for disconnection:
  731. * HCI_DISCONNECT_AUTH_FAILURE,
  732. * HCI_DISCONNECT_REMOTE_USER_TERM,
  733. * HCI_DISCONNECT_REMOTE_DEV_POWER_OFF,
  734. * HCI_DISCONNECT_UNSUPPORTED_REMOTE_FEATURE,
  735. * HCI_DISCONNECT_KEY_PAIRING_NOT_SUPPORTED
  736. * HCI_DISCONNECT_UNACCEPTABLE_CONN_INTERVAL
  737. *
  738. * output parameters
  739. *
  740. * @param None.
  741. *
  742. * @return hciStatus_t
  743. */
  744. extern hciStatus_t HCI_DisconnectCmd( uint16 connHandle,
  745. uint8 reason );
  746. /*******************************************************************************
  747. * @fn HCI_ReadRemoteVersionInfoCmd API
  748. *
  749. * @brief This BT API is used to request version information from the
  750. * the remote device in a connection.
  751. *
  752. * Related Events: HCI_CommandStatusEvent,
  753. * ReadRemoteVersionInfoEvent
  754. *
  755. * input parameters
  756. *
  757. * @param connHandle - Connection handle.
  758. *
  759. * output parameters
  760. *
  761. * @param None.
  762. *
  763. * @return hciStatus_t
  764. */
  765. extern hciStatus_t HCI_ReadRemoteVersionInfoCmd( uint16 connHandle );
  766. /*******************************************************************************
  767. * @fn HCI_SetEventMaskCmd API
  768. *
  769. * @brief This BT API is used to set the HCI event mask, which is used to
  770. * determine which events are supported.
  771. *
  772. * Related Events: HCI_CommandCompleteEvent
  773. *
  774. * input parameters
  775. *
  776. * @param pMask - Pointer to an eight byte event mask.
  777. *
  778. * output parameters
  779. *
  780. * @param None.
  781. *
  782. * @return hciStatus_t
  783. */
  784. extern hciStatus_t HCI_SetEventMaskCmd( uint8 *pMask );
  785. /*******************************************************************************
  786. * @fn HCI_Reset API
  787. *
  788. * @brief This BT API is used to reset the Link Layer.
  789. *
  790. * Related Events: HCI_CommandCompleteEvent
  791. *
  792. * input parameters
  793. *
  794. * @param None.
  795. *
  796. * output parameters
  797. *
  798. * @param None.
  799. *
  800. * @return hciStatus_t
  801. */
  802. extern hciStatus_t HCI_ResetCmd( void );
  803. /*******************************************************************************
  804. * @fn HCI_ReadTransmitPowerLevelCmd API
  805. *
  806. * @brief This BT API is used to read the transmit power level.
  807. *
  808. * Related Events: HCI_CommandCompleteEvent
  809. *
  810. * input parameters
  811. *
  812. * @param connHandle - Connection handle.
  813. * @param txPwrType - HCI_READ_CURRENT_TX_POWER_LEVEL,
  814. * HCI_READ_MAXIMUM_TX_POWER_LEVEL
  815. *
  816. * output parameters
  817. *
  818. * @param None.
  819. *
  820. * @return hciStatus_t
  821. */
  822. extern hciStatus_t HCI_ReadTransmitPowerLevelCmd( uint16 connHandle,
  823. uint8 txPwrType );
  824. /*******************************************************************************
  825. * @fn HCI_SetControllerToHostFlowCtrlCmd API
  826. *
  827. * @brief This BT API is used by the Host to turn flow control on or off
  828. * for data sent from the Controller to Host.
  829. *
  830. * Note: This command is currently not supported.
  831. *
  832. * Related Events: HCI_CommandCompleteEvent
  833. *
  834. * input parameters
  835. *
  836. * @param flowControlEnable - HCI_CTRL_TO_HOST_FLOW_CTRL_OFF,
  837. * HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_ON_SYNCH_OFF,
  838. * HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_OFF_SYNCH_ON,
  839. * HCI_CTRL_TO_HOST_FLOW_CTRL_ACL_ON_SYNCH_ON
  840. *
  841. * output parameters
  842. *
  843. * @param None.
  844. *
  845. * @return hciStatus_t
  846. */
  847. extern hciStatus_t HCI_SetControllerToHostFlowCtrlCmd( uint8 flowControlEnable );
  848. /*******************************************************************************
  849. * @fn HCI_HostBufferSizeCmd API
  850. *
  851. * @brief This BT API is used by the Host to notify the Controller of the
  852. * maximum size ACL buffer size the Controller can send to the
  853. * Host.
  854. *
  855. * Note: This command is currently ignored by the Controller. It
  856. * is assumed that the Host can always handle the maximum
  857. * BLE data packet size.
  858. *
  859. * Related Events: HCI_CommandCompleteEvent
  860. *
  861. * input parameters
  862. *
  863. * @param hostAclPktLen - Host ACL data packet length.
  864. * @param hostSyncPktLen - Host SCO data packet length .
  865. * @param hostTotalNumAclPkts - Host total number of ACL data packets.
  866. * @param hostTotalNumSyncPkts - Host total number of SCO data packets.
  867. *
  868. * output parameters
  869. *
  870. * @param None.
  871. *
  872. * @return hciStatus_t
  873. */
  874. extern hciStatus_t HCI_HostBufferSizeCmd( uint16 hostAclPktLen,
  875. uint8 hostSyncPktLen,
  876. uint16 hostTotalNumAclPkts,
  877. uint16 hostTotalNumSyncPkts );
  878. /*******************************************************************************
  879. * @fn HCI_HostNumCompletedPktCmd API
  880. *
  881. * @brief This BT API is used by the Host to notify the Controller of the
  882. * number of HCI data packets that have been completed for each
  883. * connection handle since this command was previously sent to the
  884. * controller.
  885. *
  886. * The Host_Number_Of_Conpleted_Packets command is a special
  887. * command. No event is normally generated after the command
  888. * has completed. The command should only be issued by the
  889. * Host if flow control in the direction from controller to
  890. * the host is on and there is at least one connection, or
  891. * if the controller is in local loopback mode.
  892. *
  893. * Note: It is assumed that there will be at most only one handle.
  894. * Even if more than one handle is provided, the Controller
  895. * does not track Host buffers as a function of connection
  896. * handles (and isn't required to do so).
  897. *
  898. * Related Events: HCI_CommandCompleteEvent
  899. *
  900. * input parameters
  901. *
  902. * @param numHandles - Number of connection handles.
  903. * @param connHandles - Array of connection handles.
  904. * @param numCompletedPkts - Array of number of completed packets.
  905. *
  906. * output parameters
  907. *
  908. * @param None.
  909. *
  910. * @return hciStatus_t
  911. */
  912. extern hciStatus_t HCI_HostNumCompletedPktCmd( uint8 numHandles,
  913. uint16 *connHandles,
  914. uint16 *numCompletedPkts );
  915. /*******************************************************************************
  916. * @fn HCI_ReadLocalVersionInfoCmd API
  917. *
  918. * @brief This BT API is used to read the local version information.
  919. *
  920. * Related Events: HCI_CommandCompleteEvent
  921. *
  922. * input parameters
  923. *
  924. * @param None.
  925. *
  926. * output parameters
  927. *
  928. * @param None.
  929. *
  930. * @return hciStatus_t
  931. */
  932. extern hciStatus_t HCI_ReadLocalVersionInfoCmd( void );
  933. /*******************************************************************************
  934. * @fn HCI_ReadLocalSupportedCommandsCmd API
  935. *
  936. * @brief This BT API is used to read the locally supported commands.
  937. *
  938. * Related Events: HCI_CommandCompleteEvent
  939. *
  940. * input parameters
  941. *
  942. * @param None.
  943. *
  944. * output parameters
  945. *
  946. * @param None.
  947. *
  948. * @return hciStatus_t
  949. */
  950. extern hciStatus_t HCI_ReadLocalSupportedCommandsCmd( void );
  951. /*******************************************************************************
  952. * @fn HCI_ReadLocalSupportedFeaturesCmd API
  953. *
  954. * @brief This BT API is used to read the locally supported features.
  955. *
  956. * Related Events: HCI_CommandCompleteEvent
  957. *
  958. * input parameters
  959. *
  960. * @param None.
  961. *
  962. * output parameters
  963. *
  964. * @param None.
  965. *
  966. * @return hciStatus_t
  967. */
  968. extern hciStatus_t HCI_ReadLocalSupportedFeaturesCmd( void );
  969. /*******************************************************************************
  970. * @fn HCI_ReadBDADDRCmd API
  971. *
  972. * @brief This BT API is used to read this device's BLE address (BDADDR).
  973. *
  974. * Related Events: HCI_CommandCompleteEvent
  975. *
  976. * input parameters
  977. *
  978. * @param None.
  979. *
  980. * output parameters
  981. *
  982. * @param None.
  983. *
  984. * @return hciStatus_t
  985. */
  986. extern hciStatus_t HCI_ReadBDADDRCmd( void );
  987. /*******************************************************************************
  988. * @fn HCI_ReadRssiCmd API
  989. *
  990. * @brief This BT API is used to read the RSSI of the last packet
  991. * received on a connection given by the connection handle. If
  992. * the Receiver Modem test is running (HCI_EXT_ModemTestRx), then
  993. * the RF RSSI for the last received data will be returned. If
  994. * there is no RSSI value, then HCI_RSSI_NOT_AVAILABLE will be
  995. * returned.
  996. *
  997. * Related Events: HCI_CommandCompleteEvent
  998. *
  999. * input parameters
  1000. *
  1001. * @param connHandle - Connection handle.
  1002. *
  1003. * output parameters
  1004. *
  1005. * @param None.
  1006. *
  1007. * @return hciStatus_t
  1008. */
  1009. extern hciStatus_t HCI_ReadRssiCmd( uint16 connHandle );
  1010. /*
  1011. ** HCI Low Energy Commands
  1012. */
  1013. /*******************************************************************************
  1014. * @fn HCI_LE_SetEventMaskCmd API
  1015. *
  1016. * @brief This LE API is used to set the HCI LE event mask, which is used
  1017. * to determine which LE events are supported.
  1018. *
  1019. * Related Events: HCI_CommandCompleteEvent
  1020. *
  1021. * input parameters
  1022. *
  1023. * @param pEventMask - Pointer to LE event mask of 8 bytes.
  1024. *
  1025. * output parameters
  1026. *
  1027. * @param None.
  1028. *
  1029. * @return hciStatus_t
  1030. */
  1031. extern hciStatus_t HCI_LE_SetEventMaskCmd( uint8 *pEventMask );
  1032. /*******************************************************************************
  1033. * @fn HCI_LE_ReadBufSizeCmd API
  1034. *
  1035. * @brief This LE API is used by the Host to determine the maximum ACL
  1036. * data packet size allowed by the Controller.
  1037. *
  1038. * Related Events: HCI_CommandCompleteEvent
  1039. *
  1040. * input parameters
  1041. *
  1042. * @param None.
  1043. *
  1044. * output parameters
  1045. *
  1046. * @param None.
  1047. *
  1048. * @return hciStatus_t
  1049. */
  1050. extern hciStatus_t HCI_LE_ReadBufSizeCmd( void );
  1051. /*******************************************************************************
  1052. * @fn HCI_LE_ReadLocalSupportedFeaturesCmd API
  1053. *
  1054. * @brief This LE API is used to read the LE locally supported features.
  1055. *
  1056. * Related Events: HCI_CommandCompleteEvent
  1057. *
  1058. * input parameters
  1059. *
  1060. * @param None.
  1061. *
  1062. * output parameters
  1063. *
  1064. * @param None.
  1065. *
  1066. * @return hciStatus_t
  1067. */
  1068. extern hciStatus_t HCI_LE_ReadLocalSupportedFeaturesCmd( void );
  1069. /*******************************************************************************
  1070. * @fn HCI_LE_SetRandomAddressCmd API
  1071. *
  1072. * @brief This LE API is used to set this device's Random address.
  1073. *
  1074. * Related Events: HCI_CommandCompleteEvent
  1075. *
  1076. * input parameters
  1077. *
  1078. * @param pRandAddr - Pointer to random address.
  1079. *
  1080. * output parameters
  1081. *
  1082. * @param None.
  1083. *
  1084. * @return hciStatus_t
  1085. */
  1086. extern hciStatus_t HCI_LE_SetRandomAddressCmd( uint8 *pRandAddr );
  1087. /*******************************************************************************
  1088. * @fn HCI_LE_SetAdvParamCmd API
  1089. *
  1090. * @brief This LE API is used to set the Advertising parameters.
  1091. *
  1092. * Related Events: HCI_CommandCompleteEvent
  1093. *
  1094. * input parameters
  1095. *
  1096. * @param advIntervalMin - Minimum allowed advertising interval.
  1097. * @param advIntervalMax - Maximum allowed advertising interval.
  1098. * @param advType - HCI_CONNECTABLE_UNDIRECTED_ADV,
  1099. * HCI_CONNECTABLE_DIRECTED_HDC_ADV,
  1100. * HCI_SCANNABLE_UNDIRECTED,
  1101. * HCI_NONCONNECTABLE_UNDIRECTED_ADV
  1102. * HCI_CONNECTABLE_DIRECTED_LDC_ADV
  1103. * @param ownAddrType - HCI_PUBLIC_DEVICE_ADDRESS,
  1104. * HCI_RANDOM_DEVICE_ADDRESS
  1105. * @param directAddrType - HCI_PUBLIC_DEVICE_ADDRESS,
  1106. * HCI_RANDOM_DEVICE_ADDRESS
  1107. * @param directAddr - Pointer to address of device when using
  1108. * directed advertising.
  1109. * @param advChannelMap - HCI_ADV_CHAN_37,
  1110. * HCI_ADV_CHAN_38,
  1111. * HCI_ADV_CHAN_39,
  1112. * HCI_ADV_CHAN_37 | HCI_ADV_CHAN_38,
  1113. * HCI_ADV_CHAN_37 | HCI_ADV_CHAN_39,
  1114. * HCI_ADV_CHAN_38 | HCI_ADV_CHAN_39,
  1115. * HCI_ADV_CHAN_ALL
  1116. * @param advFilterPolicy - HCI_ADV_WL_POLICY_ANY_REQ,
  1117. * HCI_ADV_WL_POLICY_WL_SCAN_REQ,
  1118. * HCI_ADV_WL_POLICY_WL_CONNECT_REQ,
  1119. * HCI_ADV_WL_POLICY_WL_ALL_REQ
  1120. *
  1121. * output parameters
  1122. *
  1123. * @param None.
  1124. *
  1125. * @return hciStatus_t
  1126. */
  1127. extern hciStatus_t HCI_LE_SetAdvParamCmd( uint16 advIntervalMin,
  1128. uint16 advIntervalMax,
  1129. uint8 advType,
  1130. uint8 ownAddrType,
  1131. uint8 directAddrType,
  1132. uint8 *directAddr,
  1133. uint8 advChannelMap,
  1134. uint8 advFilterPolicy );
  1135. /*******************************************************************************
  1136. * @fn HCI_LE_SetAdvDataCmd API
  1137. *
  1138. * @brief This LE API is used to set the Advertising data.
  1139. *
  1140. * Related Events: HCI_CommandCompleteEvent
  1141. *
  1142. * input parameters
  1143. *
  1144. * @param dataLen - Length of Advertising data.
  1145. * @param pData - Pointer to Advertising data.
  1146. *
  1147. * output parameters
  1148. *
  1149. * @param None.
  1150. *
  1151. * @return hciStatus_t
  1152. */
  1153. extern hciStatus_t HCI_LE_SetAdvDataCmd( uint8 dataLen,
  1154. uint8 *pData );
  1155. /*******************************************************************************
  1156. * @fn HCI_LE_SetScanRspDataCmd API
  1157. *
  1158. * @brief This LE API is used to set the Advertising Scan Response data.
  1159. *
  1160. * Related Events: HCI_CommandCompleteEvent
  1161. *
  1162. * input parameters
  1163. *
  1164. * @param dataLen - Length of Scan Response data.
  1165. * @param pData - Pointer to Scan Response data.
  1166. *
  1167. * output parameters
  1168. *
  1169. * @param None.
  1170. *
  1171. * @return hciStatus_t
  1172. */
  1173. extern hciStatus_t HCI_LE_SetScanRspDataCmd( uint8 dataLen,
  1174. uint8 *pData );
  1175. /*******************************************************************************
  1176. * @fn HCI_LE_SetAdvEnableCmd API
  1177. *
  1178. * @brief This LE API is used to turn Advertising on or off.
  1179. *
  1180. * Related Events: HCI_CommandCompleteEvent
  1181. *
  1182. * input parameters
  1183. *
  1184. * @param advEnable - HCI_ENABLE_ADV, HCI_DISABLE_ADV
  1185. *
  1186. * output parameters
  1187. *
  1188. * @param None.
  1189. *
  1190. * @return hciStatus_t
  1191. */
  1192. extern hciStatus_t HCI_LE_SetAdvEnableCmd( uint8 advEnable );
  1193. /*******************************************************************************
  1194. * @fn HCI_LE_ReadAdvChanTxPowerCmd API
  1195. *
  1196. * @brief This LE API is used to read transmit power when Advertising.
  1197. *
  1198. * Related Events: HCI_CommandCompleteEvent
  1199. *
  1200. * input parameters
  1201. *
  1202. * @param None.
  1203. *
  1204. * output parameters
  1205. *
  1206. * @param None.
  1207. *
  1208. * @return hciStatus_t
  1209. */
  1210. extern hciStatus_t HCI_LE_ReadAdvChanTxPowerCmd( void );
  1211. /*******************************************************************************
  1212. * @fn HCI_LE_SetScanParamCmd API
  1213. *
  1214. * @brief This LE API is used to set the Scan parameters.
  1215. *
  1216. * Related Events: HCI_CommandCompleteEvent
  1217. *
  1218. * input parameters
  1219. *
  1220. * @param scanType - HCI_SCAN_PASSIVE, HCI_SCAN_ACTIVE
  1221. * @param scanInterval - Time between scan events.
  1222. * @param scanWindow - Time of scan before scan event ends.
  1223. * Note: When the scanWindow equals the scanInterval
  1224. * then scanning is continuous.
  1225. * @param ownAddrType - This device's address.
  1226. * @param filterPolicy - HCI_SCAN_PASSIVE, HCI_SCAN_ACTIVE
  1227. *
  1228. * output parameters
  1229. *
  1230. * @param None.
  1231. *
  1232. * @return hciStatus_t
  1233. */
  1234. extern hciStatus_t HCI_LE_SetScanParamCmd( uint8 scanType,
  1235. uint16 scanInterval,
  1236. uint16 scanWindow,
  1237. uint8 ownAddrType,
  1238. uint8 filterPolicy );
  1239. /*******************************************************************************
  1240. * @fn HCI_LE_SetScanEnableCmd API
  1241. *
  1242. * @brief This LE API is used to turn Scanning on or off.
  1243. *
  1244. * Related Events: HCI_CommandCompleteEvent,
  1245. * AdvReportEvent
  1246. *
  1247. * input parameters
  1248. *
  1249. * @param scanEnable - HCI_SCAN_START, HCI_SCAN_STOP
  1250. * @param filterDuplicates - HCI_FILTER_REPORTS_ENABLE,
  1251. * HCI_FILTER_REPORTS_DISABLE
  1252. *
  1253. * output parameters
  1254. *
  1255. * @param None.
  1256. *
  1257. * @return hciStatus_t
  1258. */
  1259. extern hciStatus_t HCI_LE_SetScanEnableCmd( uint8 scanEnable,
  1260. uint8 filterDuplicates );
  1261. /*******************************************************************************
  1262. * @fn HCI_LE_CreateConnCmd API
  1263. *
  1264. * @brief This LE API is used to create a connection.
  1265. *
  1266. * Related Events: HCI_CommandStatusEvent,
  1267. * ConnectionCompleteEvent
  1268. *
  1269. * input parameters
  1270. *
  1271. * @param scanInterval - Time between Init scan events.
  1272. * @param scanWindow - Time of scan before Init scan event ends.
  1273. * Note: When the scanWindow equals the
  1274. * scanInterval then scanning is
  1275. * continuous.
  1276. * @param initFilterPolicy - HCI_INIT_WL_POLICY_USE_PEER_ADDR,
  1277. * HCI_INIT_WL_POLICY_USE_WHITE_LIST
  1278. * @param addrTypePeer - HCI_PUBLIC_DEVICE_ADDRESS,
  1279. * HCI_RANDOM_DEVICE_ADDRESS
  1280. * @param peerAddr - Pointer to peer device's address.
  1281. * @param ownAddrType - HCI_PUBLIC_DEVICE_ADDRESS,
  1282. * HCI_RANDOM_DEVICE_ADDRESS
  1283. * @param connIntervalMin - Minimum allowed connection interval.
  1284. * @param connIntervalMax - Maximum allowed connection interval.
  1285. * @param connLatency - Number of skipped events (slave latency).
  1286. * @param connTimeout - Connection supervision timeout.
  1287. * @param minLen - Info parameter about min length of conn.
  1288. * @param maxLen - Info parameter about max length of conn.
  1289. *
  1290. * output parameters
  1291. *
  1292. * @param None.
  1293. *
  1294. * @return hciStatus_t
  1295. */
  1296. extern hciStatus_t HCI_LE_CreateConnCmd( uint16 scanInterval,
  1297. uint16 scanWindow,
  1298. uint8 initFilterPolicy,
  1299. uint8 addrTypePeer,
  1300. uint8 *peerAddr,
  1301. uint8 ownAddrType,
  1302. uint16 connIntervalMin,
  1303. uint16 connIntervalMax,
  1304. uint16 connLatency,
  1305. uint16 connTimeout,
  1306. uint16 minLen,
  1307. uint16 maxLen );
  1308. /*******************************************************************************
  1309. * @fn HCI_LE_CreateConnCancelCmd API
  1310. *
  1311. * @brief This LE API is used to cancel a create connection.
  1312. *
  1313. * Related Events: HCI_CommandCompleteEvent
  1314. *
  1315. * input parameters
  1316. *
  1317. * @param None.
  1318. *
  1319. * output parameters
  1320. *
  1321. * @param None.
  1322. *
  1323. * @return hciStatus_t
  1324. */
  1325. extern hciStatus_t HCI_LE_CreateConnCancelCmd( void );
  1326. /*******************************************************************************
  1327. * @fn HCI_LE_ReadWhiteListSizeCmd API
  1328. *
  1329. * @brief This LE API is used to read the white list.
  1330. *
  1331. * Related Events: HCI_CommandCompleteEvent
  1332. *
  1333. * input parameters
  1334. *
  1335. * @param None.
  1336. *
  1337. * output parameters
  1338. *
  1339. * @param None.
  1340. *
  1341. * @return hciStatus_t
  1342. */
  1343. extern hciStatus_t HCI_LE_ReadWhiteListSizeCmd( void );
  1344. /*******************************************************************************
  1345. * @fn HCI_LE_ClearWhiteListCmd API
  1346. *
  1347. * @brief This LE API is used to clear the white list.
  1348. *
  1349. * Related Events: HCI_CommandCompleteEvent
  1350. *
  1351. * input parameters
  1352. *
  1353. * @param None.
  1354. *
  1355. * output parameters
  1356. *
  1357. * @param None.
  1358. *
  1359. * @return hciStatus_t
  1360. */
  1361. extern hciStatus_t HCI_LE_ClearWhiteListCmd( void );
  1362. /*******************************************************************************
  1363. * @fn HCI_LE_AddWhiteListCmd API
  1364. *
  1365. * @brief This LE API is used to add a white list entry.
  1366. *
  1367. * Related Events: HCI_CommandCompleteEvent
  1368. *
  1369. * input parameters
  1370. *
  1371. * @param addrType - HCI_PUBLIC_DEVICE_ADDRESS, HCI_RANDOM_DEVICE_ADDRESS
  1372. * @param devAddr - Pointer to address of device to put in white list.
  1373. *
  1374. * output parameters
  1375. *
  1376. * @param None.
  1377. *
  1378. * @return hciStatus_t
  1379. */
  1380. extern hciStatus_t HCI_LE_AddWhiteListCmd( uint8 addrType,
  1381. uint8 *devAddr );
  1382. /*******************************************************************************
  1383. * @fn HCI_LE_RemoveWhiteListCmd API
  1384. *
  1385. * @brief This LE API is used to remove a white list entry.
  1386. *
  1387. * Related Events: HCI_CommandCompleteEvent
  1388. *
  1389. * input parameters
  1390. *
  1391. * @param addrType - HCI_PUBLIC_DEVICE_ADDRESS, HCI_RANDOM_DEVICE_ADDRESS
  1392. * @param devAddr - Pointer to address of device to remove from the
  1393. * white list.
  1394. *
  1395. * output parameters
  1396. *
  1397. * @param None.
  1398. *
  1399. * @return hciStatus_t
  1400. */
  1401. extern hciStatus_t HCI_LE_RemoveWhiteListCmd( uint8 addrType,
  1402. uint8 *devAddr );
  1403. /*******************************************************************************
  1404. * @fn HCI_LE_ConnUpdateCmd API
  1405. *
  1406. * @brief This LE API is used to update the connection parameters.
  1407. *
  1408. * Related Events: HCI_CommandStatusEvent,
  1409. * ConnectionUpdateCompleteEvent
  1410. *
  1411. * input parameters
  1412. *
  1413. * @param connHandle - Time between Init scan events.
  1414. * @param connIntervalMin - Minimum allowed connection interval.
  1415. * @param connIntervalMax - Maximum allowed connection interval.
  1416. * @param connLatency - Number of skipped events (slave latency).
  1417. * @param connTimeout - Connection supervision timeout.
  1418. * @param minLen - Info parameter about min length of conn.
  1419. * @param maxLen - Info parameter about max length of conn.
  1420. *
  1421. * output parameters
  1422. *
  1423. * @param None.
  1424. *
  1425. * @return hciStatus_t
  1426. */
  1427. extern hciStatus_t HCI_LE_ConnUpdateCmd( uint16 connHandle,
  1428. uint16 connIntervalMin,
  1429. uint16 connIntervalMax,
  1430. uint16 connLatency,
  1431. uint16 connTimeout,
  1432. uint16 minLen,
  1433. uint16 maxLen );
  1434. /*******************************************************************************
  1435. * @fn HCI_LE_SetHostChanClassificationCmd API
  1436. *
  1437. * @brief This LE API is used to update the current data channel map.
  1438. *
  1439. * Related Events: HCI_CommandCompleteEvent
  1440. *
  1441. * input parameters
  1442. *
  1443. * @param chanMap - Pointer to the new channel map.
  1444. *
  1445. * output parameters
  1446. *
  1447. * @param None.
  1448. *
  1449. * @return hciStatus_t
  1450. */
  1451. extern hciStatus_t HCI_LE_SetHostChanClassificationCmd( uint8 *chanMap );
  1452. /*******************************************************************************
  1453. * @fn HCI_LE_ReadChannelMapCmd API
  1454. *
  1455. * @brief This LE API is used to read a connection's data channel map.
  1456. *
  1457. * Related Events: HCI_CommandCompleteEvent
  1458. *
  1459. * input parameters
  1460. *
  1461. * @param connHandle - Connection handle.
  1462. *
  1463. * output parameters
  1464. *
  1465. * @param None.
  1466. *
  1467. * @return hciStatus_t
  1468. */
  1469. extern hciStatus_t HCI_LE_ReadChannelMapCmd( uint16 connHandle );
  1470. /*******************************************************************************
  1471. * @fn HCI_LE_ReadRemoteUsedFeaturesCmd API
  1472. *
  1473. * @brief This LE API is used to read the remote device's used features.
  1474. *
  1475. * Related Events: HCI_CommandStatusEvent,
  1476. * ReadRemoteUsedFeaturesCompleteEvent
  1477. *
  1478. * input parameters
  1479. *
  1480. * @param connHandle - Connection handle.
  1481. *
  1482. * output parameters
  1483. *
  1484. * @param None.
  1485. *
  1486. * @return hciStatus_t
  1487. */
  1488. extern hciStatus_t HCI_LE_ReadRemoteUsedFeaturesCmd( uint16 connHandle );
  1489. /*******************************************************************************
  1490. * @fn HCI_LE_EncryptCmd API
  1491. *
  1492. * @brief This LE API is used to perform an encryption using AES128.
  1493. *
  1494. * Note: Input parameters are ordered MSB..LSB.
  1495. *
  1496. * Related Events: HCI_CommandCompleteEvent
  1497. *
  1498. * input parameters
  1499. *
  1500. * @param key - Pointer to 16 byte encryption key.
  1501. * @param plainText - Pointer to 16 byte plaintext data.
  1502. *
  1503. * output parameters
  1504. *
  1505. * @param None.
  1506. *
  1507. * @return hciStatus_t
  1508. */
  1509. extern hciStatus_t HCI_LE_EncryptCmd( uint8 *key,
  1510. uint8 *plainText );
  1511. /*******************************************************************************
  1512. * @fn HCI_LE_RandCmd API
  1513. *
  1514. * @brief This LE API is used to generate a random number.
  1515. *
  1516. * Related Events: HCI_CommandCompleteEvent
  1517. *
  1518. * input parameters
  1519. *
  1520. * @param None.
  1521. *
  1522. * output parameters
  1523. *
  1524. * @param None.
  1525. *
  1526. * @return hciStatus_t
  1527. */
  1528. extern hciStatus_t HCI_LE_RandCmd( void );
  1529. /*******************************************************************************
  1530. * @fn HCI_LE_StartEncyptCmd API
  1531. *
  1532. * @brief This LE API is used to start encryption in a connection.
  1533. *
  1534. * Related Events: HCI_CommandStatusEvent,
  1535. * EncChangeEvent or
  1536. * EncKeyRefreshEvent
  1537. *
  1538. * input parameters
  1539. *
  1540. * @param connHandle - Connection handle.
  1541. * @param random - Pointer to eight byte Random number.
  1542. * @param encDiv - Pointer to two byte Encrypted Diversifier.
  1543. * @param ltk - Pointer to 16 byte Long Term Key.
  1544. *
  1545. * output parameters
  1546. *
  1547. * @param None.
  1548. *
  1549. * @return hciStatus_t
  1550. */
  1551. extern hciStatus_t HCI_LE_StartEncyptCmd( uint16 connHandle,
  1552. uint8 *random,
  1553. uint8 *encDiv,
  1554. uint8 *ltk );
  1555. /*******************************************************************************
  1556. * @fn HCI_LE_LtkReqReplyCmd API
  1557. *
  1558. * @brief This LE API is used by the Host to send to the Controller a
  1559. * positive LTK reply.
  1560. *
  1561. * Related Events: HCI_CommandCompleteEvent
  1562. *
  1563. * input parameters
  1564. *
  1565. * @param connHandle - Connection handle.
  1566. * @param ltk - Pointer to 16 byte Long Term Key.
  1567. *
  1568. * output parameters
  1569. *
  1570. * @param None.
  1571. *
  1572. * @return hciStatus_t
  1573. */
  1574. extern hciStatus_t HCI_LE_LtkReqReplyCmd( uint16 connHandle,
  1575. uint8 *ltk );
  1576. /*******************************************************************************
  1577. * @fn HCI_LE_LtkReqNegReplyCmd API
  1578. *
  1579. * @brief This LE API is used by the Host to send to the Controller a
  1580. * negative LTK reply.
  1581. *
  1582. * Related Events: HCI_CommandCompleteEvent
  1583. *
  1584. * input parameters
  1585. *
  1586. * @param connHandle - Connectin handle.
  1587. *
  1588. * output parameters
  1589. *
  1590. * @param None.
  1591. *
  1592. * @return hciStatus_t
  1593. */
  1594. extern hciStatus_t HCI_LE_LtkReqNegReplyCmd( uint16 connHandle );
  1595. /*******************************************************************************
  1596. * @fn HCI_LE_ReadSupportedStatesCmd API
  1597. *
  1598. * @brief This LE API is used to read the Controller's supported states.
  1599. *
  1600. * Related Events: HCI_CommandCompleteEvent
  1601. *
  1602. * input parameters
  1603. *
  1604. * @param None.
  1605. *
  1606. * output parameters
  1607. *
  1608. * @param None.
  1609. *
  1610. * @return hciStatus_t
  1611. */
  1612. extern hciStatus_t HCI_LE_ReadSupportedStatesCmd( void );
  1613. /*******************************************************************************
  1614. * @fn HCI_LE_ReceiverTestCmd API
  1615. *
  1616. * @brief This LE API is used to start the receiver Direct Test Mode test.
  1617. *
  1618. * Note: A HCI reset should be issued when done using DTM!
  1619. *
  1620. * Related Events: HCI_CommandCompleteEvent
  1621. *
  1622. * input parameters
  1623. *
  1624. * @param rxFreq - Rx RF frequency:
  1625. * k=0..HCI_DTM_NUMBER_RF_CHANS-1, where: F=2402+(k*2MHz)
  1626. *
  1627. * output parameters
  1628. *
  1629. * @param None.
  1630. *
  1631. * @return hciStatus_t
  1632. */
  1633. extern hciStatus_t HCI_LE_ReceiverTestCmd( uint8 rxFreq );
  1634. /*******************************************************************************
  1635. * @fn HCI_LE_TransmitterTestCmd API
  1636. *
  1637. * @brief This LE API is used to start the transmit Direct Test Mode test.
  1638. *
  1639. * Note: The BLE device is to transmit at maximum power!
  1640. *
  1641. * Note: A HCI reset should be issued when done using DTM!
  1642. *
  1643. * input parameters
  1644. *
  1645. * @param txFreq - Tx RF frequency:
  1646. * k=0..HCI_DTM_NUMBER_RF_CHANS-1, where:
  1647. * F=2402+(k*2MHz)
  1648. * @param dataLen - Test data length in bytes:
  1649. * 0..HCI_DIRECT_TEST_MAX_PAYLOAD_LEN
  1650. * @param payloadType - Type of packet payload, per Direct Test Mode spec:
  1651. * HCI_DIRECT_TEST_PAYLOAD_PRBS9,
  1652. * HCI_DIRECT_TEST_PAYLOAD_0x0F,
  1653. * HCI_DIRECT_TEST_PAYLOAD_0x55,
  1654. * HCI_DIRECT_TEST_PAYLOAD_PRBS15,
  1655. * HCI_DIRECT_TEST_PAYLOAD_0xFF,
  1656. * HCI_DIRECT_TEST_PAYLOAD_0x00,
  1657. * HCI_DIRECT_TEST_PAYLOAD_0xF0,
  1658. * HCI_DIRECT_TEST_PAYLOAD_0xAA
  1659. *
  1660. * output parameters
  1661. *
  1662. * @param None.
  1663. *
  1664. * @return hciStatus_t
  1665. */
  1666. extern hciStatus_t HCI_LE_TransmitterTestCmd( uint8 txFreq,
  1667. uint8 dataLen,
  1668. uint8 pktPayload );
  1669. /*******************************************************************************
  1670. * @fn HCI_LE_TestEndCmd API
  1671. *
  1672. * @brief This LE API is used to end the Direct Test Mode test.
  1673. *
  1674. * Note: A HCI reset should be issued when done using DTM!
  1675. *
  1676. * Related Events: HCI_CommandCompleteEvent
  1677. *
  1678. * input parameters
  1679. *
  1680. * @param None.
  1681. *
  1682. * output parameters
  1683. *
  1684. * @param None.
  1685. *
  1686. * @return hciStatus_t
  1687. */
  1688. extern hciStatus_t HCI_LE_TestEndCmd( void );
  1689. // BBB ROM code add
  1690. extern hciStatus_t HCI_LE_AddDevToResolvingListCmd( uint8 addrType,
  1691. uint8 *devAddr,
  1692. uint8 *peerIrk,
  1693. uint8 *localIrk);
  1694. extern hciStatus_t HCI_LE_RemoveResolvingListCmd( uint8 addrType,
  1695. uint8 *devAddr );
  1696. extern hciStatus_t HCI_LE_ClearResolvingListCmd( void );
  1697. extern hciStatus_t HCI_LE_ReadResolvingListSizeCmd( void );
  1698. extern hciStatus_t HCI_LE_SetAddressResolutionEnableCmd( uint8 enable );
  1699. extern hciStatus_t HCI_LE_SetResolvablePrivateAddressTimeoutCmd( uint16 rpaTimeout );
  1700. /*
  1701. ** HCI for Extended Adv
  1702. */
  1703. //
  1704. extern hciStatus_t HCI_LE_SetExtAdvSetRandomAddressCmd( uint8 adv_handle,
  1705. uint8* random_address);
  1706. extern hciStatus_t HCI_LE_SetExtAdvParamCmd( uint8 adv_handle,
  1707. uint16 adv_event_properties,
  1708. uint32 primary_advertising_interval_Min, // 3 octets
  1709. uint32 primary_advertising_interval_Max, // 3 octets
  1710. uint8 primary_advertising_channel_map,
  1711. uint8 own_address_type,
  1712. uint8 peer_address_type,
  1713. uint8 *peer_address,
  1714. uint8 advertising_filter_policy,
  1715. uint8 advertising_tx_power,
  1716. uint8 primary_advertising_PHY,
  1717. uint8 secondary_advertising_max_skip,
  1718. uint8 secondary_advertising_PHY,
  1719. uint8 advertising_SID,
  1720. uint8 scan_request_notification_enable
  1721. );
  1722. //
  1723. extern hciStatus_t HCI_LE_SetExtAdvDataCmd( uint8 adv_handle,
  1724. uint8 operation,
  1725. uint8 fragment_preference,
  1726. uint8 advertising_data_length,
  1727. uint8 *advertising_data
  1728. );
  1729. //
  1730. extern hciStatus_t HCI_LE_SetExtScanRspDataCmd( uint8 adv_handle,
  1731. uint8 operation,
  1732. uint8 fragment_preference,
  1733. uint8 scan_rsp_data_length,
  1734. uint8 *scan_rsp_data
  1735. );
  1736. //
  1737. extern hciStatus_t HCI_LE_SetExtAdvEnableCmd( uint8 enable,
  1738. uint8 number_of_sets,
  1739. uint8 *advertising_handle,
  1740. uint16 *duration,
  1741. uint8 *max_extended_advertising_events);
  1742. //
  1743. extern hciStatus_t HCI_LE_ReadMaximumAdvDataLengthCmd( void );
  1744. //
  1745. extern hciStatus_t HCI_LE_ReadNumberOfSupportAdvSetCmd( void );
  1746. //
  1747. extern hciStatus_t HCI_LE_RemoveAdvSetCmd( uint8 adv_handle);
  1748. //
  1749. extern hciStatus_t HCI_LE_ClearAdvSetsCmd( void);
  1750. extern hciStatus_t HCI_LE_SetExtendedScanParametersCmd(uint8 own_address_type,
  1751. uint8 scanning_filter_policy,
  1752. uint8 scanning_PHYs,
  1753. uint8 *scan_sype,
  1754. uint16 *scan_interval,
  1755. uint16 *scan_window);
  1756. extern hciStatus_t HCI_LE_SetExtendedScanEnableCmd(uint8 enable,
  1757. uint8 filter_duplicates,
  1758. uint16 duration,
  1759. uint16 period);
  1760. extern hciStatus_t HCI_LE_ExtendedCreateConnectionCmd(uint8 initiator_filter_policy,
  1761. uint8 own_address_type,
  1762. uint8 peer_address_type,
  1763. uint8* peer_address,
  1764. uint8 initiating_PHYs,
  1765. uint16 *scan_interval,
  1766. uint16 *scan_window,
  1767. uint16 *conn_interval_min,
  1768. uint16 *conn_interval_max,
  1769. uint16 *conn_latency,
  1770. uint16 *supervision_timeout,
  1771. uint16 *minimum_CE_length,
  1772. uint16 *maximum_CE_length);
  1773. //
  1774. extern hciStatus_t HCI_LE_SetPeriodicAdvParameterCmd( uint8 adv_handle,
  1775. uint16 interval_min,
  1776. uint16 interval_max,
  1777. uint16 adv_event_properties
  1778. );
  1779. extern hciStatus_t HCI_LE_SetPeriodicAdvDataCmd( uint8 adv_handle,
  1780. uint8 operation,
  1781. uint8 advertising_data_length,
  1782. uint8 *advertising_data
  1783. );
  1784. extern hciStatus_t HCI_LE_SetPeriodicAdvEnableCmd( uint8 enable,
  1785. uint8 advertising_handle);
  1786. extern hciStatus_t HCI_LE_PeriodicAdvertisingCreateSyncCmd(uint8 Options,
  1787. uint8 Advertising_SID,
  1788. uint8 Advertiser_Address_Type,
  1789. uint8 *Advertiser_Address,
  1790. uint16 Skip,
  1791. uint16 Sync_Timeout,
  1792. uint8 Sync_CTE_Type);
  1793. extern hciStatus_t HCI_LE_PeriodicAdvertisingCreateSyncCancelCmd(void);
  1794. extern hciStatus_t HCI_LE_PeriodicAdvertisingTerminateSyncCmd(uint16 sync_handle);
  1795. /******************************************************************************
  1796. * fn: HCI_LE_ConnectionlessCTE_TransmitParamcmd
  1797. *
  1798. * brief: set CTE Parameters in any periodic advertising
  1799. * 1、CTE Type
  1800. * 2、CTE Length
  1801. * 3、CTE antenna switching pattern
  1802. *
  1803. * input parameters:
  1804. * advertising handle : Identify advertising set 0x0-0xEF
  1805. * CTE_Length : CTE Length in 8us 0x2-0x14
  1806. * CTE_Type : 0:AOA CTE , 1:AoD CTE with 1us,2:AoD CTE with 2us,
  1807. * CTE_Count : how many CTE packet in each PA event 0x1-0x10
  1808. * Switch_Pattern_LEN : number of Antenna IDs in the pattern
  1809. * : AOD CTE, AOA shall be ignored
  1810. * : 0x2-0x4B
  1811. * Antenna_IDs[i] : List of Antenna IDs in the pattern
  1812. * : AOD CTE, AOA shall be ignored
  1813. *
  1814. * output parameters:
  1815. * Status :HCI_SUCCESS or other error codes
  1816. *
  1817. *
  1818. * return hciStatus_t : HCI_SUCCESS
  1819. *
  1820. ******************************************************************************/
  1821. hciStatus_t HCI_LE_ConnectionlessCTE_TransmitParamCmd( uint8 advertising_handle,
  1822. uint8 len,
  1823. uint8 type,
  1824. uint8 count,
  1825. uint8 Pattern_LEN,
  1826. uint8 *AnaIDs);
  1827. /******************************************************************************
  1828. * fn: HCI_LE_ConnectionlessCTE_TransmitEnableCmd
  1829. *
  1830. * brief: Controller enable or disable CTE in PA
  1831. *
  1832. * input parameters:
  1833. * advertising handle : Identify advertising set in which CTE is enable or disable
  1834. * : 0x0-0xEF
  1835. * enable : 0 : disable , 1: enable
  1836. *
  1837. *
  1838. * output parameters:
  1839. * Status :HCI_SUCCESS or other error codes
  1840. *
  1841. *
  1842. * return hciStatus_t : HCI_SUCCESS or other error codes
  1843. *
  1844. ******************************************************************************/
  1845. hciStatus_t HCI_LE_ConnectionlessCTE_TransmitEnableCmd( uint8 advertising_handle,
  1846. uint8 enable);
  1847. /******************************************************************************
  1848. * fn: HCI_LE_ConnectionlessIQ_SampleEnableCmd
  1849. *
  1850. * brief: Controller enable or disable capturing IQ Samples from the CTE of PA pcakets
  1851. *
  1852. * input parameters:
  1853. * sync_handle : periodic advertising handle
  1854. * Range:0x0 - 0x0EFF
  1855. * slot_Duration : switching and sampling slot 0x1:1us,0x2:2us,Other:RFU
  1856. * enable : 0x0:IQ Sampling disable, 0x1:IQ Sampling enable
  1857. * MaxSampledCTEs : max number of CTE in each PA event that the controller
  1858. * should collect and report
  1859. * Range : 0x0-0x10
  1860. * 0x0 : sample and report all available CTE
  1861. * pattern_len : number of Antenna IDs in the pattern
  1862. * Range:0x2 - 0x4B
  1863. * AnaIDs : list of Antenna IDs in the pattern
  1864. *
  1865. *
  1866. * output parameters:
  1867. * status : HCI_SUCCESS or other error codes
  1868. * sync_handle : Periodic advertising handle
  1869. *
  1870. *
  1871. * return hciStatus_t : HCI_SUCCESS
  1872. *
  1873. ******************************************************************************/
  1874. hciStatus_t HCI_LE_ConnectionlessIQ_SampleEnableCmd( uint16 sync_handle,
  1875. uint8 enable,
  1876. uint8 slot_Duration,
  1877. uint8 MaxSampledCTEs,
  1878. uint8 pattern_len,
  1879. uint8 *AnaIDs);
  1880. /******************************************************************************
  1881. * fn: HCI_LE_ConnectionCTE_ReceiveParamCmd
  1882. *
  1883. * brief: enable or disable sampling received CTE fields on the connection
  1884. * set antenna switching pattern
  1885. * set switching and sampling slot durations
  1886. *
  1887. * input parameters:
  1888. * connHandle : connection handle Range 0x0 - 0x0EFF
  1889. * enable : sampling enable 0:disable , 1:enable
  1890. * slot_Duration : switching and sampling slot 0:1us, 1: 2us
  1891. * pattern_len : the number of Antenna IDs in the pattern
  1892. * Range: 0x2-0x4B
  1893. * AnaIDs : list of Antenna IDs in the pattern
  1894. *
  1895. *
  1896. * output parameters:
  1897. * Status : HCI_SUCCESS or other error codes
  1898. * connHandle : Connection Handle
  1899. *
  1900. *
  1901. * return hciStatus_t
  1902. *
  1903. ******************************************************************************/
  1904. hciStatus_t HCI_LE_Set_ConnectionCTE_ReceiveParamCmd( uint16 connHandle,
  1905. uint8 enable,
  1906. uint8 slot_Duration,
  1907. uint8 pattern_len,
  1908. uint8 *AnaIDs);
  1909. /******************************************************************************
  1910. * fn: HCI_LE_Set_ConnectionCTE_TransmitParamCmd
  1911. *
  1912. * brief: used to set the antenna switching pattern and permitted CTE type
  1913. *
  1914. * input parameters:
  1915. * connHandle : connection Handle, Range: 0x0 - 0x0EFF
  1916. * type : bit set for CTE type , bit 0 : AOA CTE response,
  1917. * bit 1 : AOD CTE response with 1us slots
  1918. * bit 2 : AOD CTE response with 2us slots
  1919. * pattern_len : the number of Antenna IDs in the pattern
  1920. * AnaIDs : list of Antenna IDs in the pattern
  1921. *
  1922. *
  1923. * output parameters:
  1924. * Status : 0 : success, other error code
  1925. * ConnHandle : connection handle
  1926. *
  1927. *
  1928. * return hciStatus_t
  1929. *
  1930. ******************************************************************************/
  1931. hciStatus_t HCI_LE_Set_ConnectionCTE_TransmitParamCmd( uint16 connHandle,
  1932. uint8 type,
  1933. uint8 pattern_len,
  1934. uint8 *AnaIDs);
  1935. /******************************************************************************
  1936. * fn: HCI_LE_Connection_CTE_Request_EnableCmd
  1937. *
  1938. * brief: request Controller to start or stop initiating the CTE request
  1939. * procedure on connection
  1940. *
  1941. * input parameters:
  1942. * connHandle : connection Handle
  1943. * Range:0x0 - 0x0EFF
  1944. * enable : Enable or disable CTE request for the connection
  1945. * 0:disable,1:enable
  1946. * Interval : define whether the CTE request procedure is initiated
  1947. * only once or periodically.
  1948. * Range:0x0 - 0xFFFF
  1949. * 0x0 : Initiate the CTE request procedure once
  1950. * 0x1 - 0xFFFF : Requested interval for initiating the CTE
  1951. * procedure in number of connection events
  1952. * Range:
  1953. * len : minimum length of the CTE in 8us units
  1954. * Range: 0x2 - 0x14
  1955. * type : indicate the type of CTE that the controller shall
  1956. * request from the remote device
  1957. * 0x0:AOA CTE
  1958. * 0x1:AOD CTE with 1us
  1959. * 0x2:AOD CTE with 2us
  1960. *
  1961. *
  1962. * output parameters:
  1963. * Status : 0x0 : command succeed , 0x1 - 0xff : other error code
  1964. * connHandle : connection handle
  1965. *
  1966. *
  1967. * return hciStatus_t
  1968. *
  1969. ******************************************************************************/
  1970. hciStatus_t HCI_LE_Connection_CTE_Request_EnableCmd( uint16 connHandle,
  1971. uint8 enable,
  1972. uint16 Interval,
  1973. uint8 len,
  1974. uint8 type);
  1975. /******************************************************************************
  1976. * fn: HCI_LE_Connection_CTE_Response_EnableCmd
  1977. *
  1978. * brief: request the controller to respond to LL_CTE_REQ with LL_CTE_RSP on the
  1979. * specified connection
  1980. *
  1981. * input parameters:
  1982. * connHandle : connection Handle
  1983. * Range:0x0 - 0x0EFF
  1984. * enable : enable or disable CTE response for the connection
  1985. *
  1986. *
  1987. * output parameters:
  1988. * status : 0x0 : command succeed , 0x1 - 0xff : other error code
  1989. * connHandle : connection handle
  1990. *
  1991. *
  1992. *
  1993. * return hciStatus_t
  1994. *
  1995. ******************************************************************************/
  1996. hciStatus_t HCI_LE_Connection_CTE_Response_EnableCmd( uint16 connHandle,
  1997. uint8 enable);
  1998. /******************************************************************************
  1999. * fn: HCI_LE_READ_Anatenna_InfoCmd
  2000. *
  2001. * brief: Host read the switching rates, the sampling reate, the number of antennae,
  2002. * and the maxumum length of a transmitted CTE supported by the controller
  2003. *
  2004. * input parameters:
  2005. * None
  2006. *
  2007. *
  2008. * output parameters:
  2009. * status : 0x0 : command succeed , 0x1 - 0xff : other error code
  2010. * switch_sample_rate : bit number indicate supported switching and sampling rate
  2011. * bit 0 : 1us switching AOD transmission
  2012. * bit 1 : 1us sampling AOD reception
  2013. * bit 2 : 1us switching and sampling AOA reception
  2014. * Antenna_len : number of Antennae supported by the controller
  2015. * MAX_Pattern_len : MAX length of antenna switching pattern spooorted by the controller
  2016. * MAX_CTE_LEN : MAX length or a transmitted CTE supported in 8us units
  2017. *
  2018. *
  2019. * return hciStatus_t
  2020. *
  2021. ******************************************************************************/
  2022. hciStatus_t HCI_LE_READ_Anatenna_InfoCmd(void);
  2023. /*
  2024. ** HCI Vendor Specific Comamnds: Link Layer Extensions
  2025. */
  2026. /*******************************************************************************
  2027. * @fn HCI_EXT_SetRxGainCmd API
  2028. *
  2029. * @brief This HCI Extension API is used to set the receiver gain.
  2030. *
  2031. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2032. *
  2033. * input parameters
  2034. *
  2035. * @param rxGain - HCI_EXT_RX_GAIN_STD, HCI_EXT_RX_GAIN_HIGH
  2036. *
  2037. * output parameters
  2038. *
  2039. * @param None.
  2040. *
  2041. * @return hciStatus_t
  2042. */
  2043. extern hciStatus_t HCI_EXT_SetRxGainCmd( uint8 rxGain );
  2044. /*******************************************************************************
  2045. * @fn HCI_EXT_SetTxPowerCmd API
  2046. *
  2047. * @brief This HCI Extension API is used to set the transmit power.
  2048. *
  2049. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2050. *
  2051. * input parameters
  2052. *
  2053. * @param txPower - LL_EXT_TX_POWER_MINUS_23_DBM,
  2054. * LL_EXT_TX_POWER_MINUS_6_DBM,
  2055. * LL_EXT_TX_POWER_0_DBM,
  2056. * LL_EXT_TX_POWER_4_DBM
  2057. *
  2058. * output parameters
  2059. *
  2060. * @param None.
  2061. *
  2062. * @return hciStatus_t
  2063. */
  2064. extern hciStatus_t HCI_EXT_SetTxPowerCmd( uint8 txPower );
  2065. /*******************************************************************************
  2066. * @fn HCI_EXT_OnePktPerEvtCmd API
  2067. *
  2068. * @brief This HCI Extension API is used to set whether a connection will
  2069. * be limited to one packet per event.
  2070. *
  2071. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2072. *
  2073. * input parameters
  2074. *
  2075. * @param control - HCI_EXT_ENABLE_ONE_PKT_PER_EVT,
  2076. * HCI_EXT_DISABLE_ONE_PKT_PER_EVT
  2077. *
  2078. * output parameters
  2079. *
  2080. * @param None.
  2081. *
  2082. * @return hciStatus_t
  2083. */
  2084. extern hciStatus_t HCI_EXT_OnePktPerEvtCmd( uint8 control );
  2085. /*******************************************************************************
  2086. * @fn HCI_EXT_ClkDivOnHaltCmd API
  2087. *
  2088. * @brief This HCI Extension API is used to set whether the system clock
  2089. * will be divided when the MCU is halted.
  2090. *
  2091. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2092. *
  2093. * input parameters
  2094. *
  2095. * @param control - HCI_EXT_ENABLE_CLK_DIVIDE_ON_HALT,
  2096. * HCI_EXT_DISABLE_CLK_DIVIDE_ON_HALT
  2097. *
  2098. * output parameters
  2099. *
  2100. * @param None.
  2101. *
  2102. * @return hciStatus_t
  2103. */
  2104. extern hciStatus_t HCI_EXT_ClkDivOnHaltCmd( uint8 control );
  2105. /*******************************************************************************
  2106. * @fn HCI_EXT_DeclareNvUsageCmd API
  2107. *
  2108. * @brief This HCI Extension API is used to indicate to the Controller
  2109. * whether or not the Host will be using the NV memory during BLE
  2110. * operations.
  2111. *
  2112. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2113. *
  2114. * input parameters
  2115. *
  2116. * @param mode - HCI_EXT_NV_IN_USE, HCI_EXT_NV_NOT_IN_USE
  2117. *
  2118. * output parameters
  2119. *
  2120. * @param None.
  2121. *
  2122. * @return hciStatus_t
  2123. */
  2124. extern hciStatus_t HCI_EXT_DeclareNvUsageCmd( uint8 mode );
  2125. /*******************************************************************************
  2126. * @fn HCI_EXT_DecryptCmd API
  2127. *
  2128. * @brief This HCI Extension API is used to decrypt encrypted data using
  2129. * AES128.
  2130. *
  2131. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2132. *
  2133. * input parameters
  2134. *
  2135. * @param key - Pointer to 16 byte encryption key.
  2136. * @param encText - Pointer to 16 byte encrypted data.
  2137. *
  2138. * output parameters
  2139. *
  2140. * @param None.
  2141. *
  2142. * @return hciStatus_t
  2143. */
  2144. extern hciStatus_t HCI_EXT_DecryptCmd( uint8 *key,
  2145. uint8 *encText );
  2146. /*******************************************************************************
  2147. * @fn HCI_EXT_SetLocalSupportedFeaturesCmd API
  2148. *
  2149. * @brief This HCI Extension API is used to write this devie's supported
  2150. * features.
  2151. *
  2152. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2153. *
  2154. * input parameters
  2155. *
  2156. * @param localFeatures - Pointer to eight bytes of local features.
  2157. *
  2158. * output parameters
  2159. *
  2160. * @param None.
  2161. *
  2162. * @return hciStatus_t
  2163. */
  2164. extern hciStatus_t HCI_EXT_SetLocalSupportedFeaturesCmd( uint8 *localFeatures );
  2165. /*******************************************************************************
  2166. * @fn HCI_EXT_SetFastTxResponseTimeCmd API
  2167. *
  2168. * @brief This HCI Extension API is used to set whether transmit data is
  2169. * sent as soon as possible even when slave latency is used.
  2170. *
  2171. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2172. *
  2173. * input parameters
  2174. *
  2175. * @param control - HCI_EXT_ENABLE_FAST_TX_RESP_TIME,
  2176. * HCI_EXT_DISABLE_FAST_TX_RESP_TIME
  2177. *
  2178. * output parameters
  2179. *
  2180. * @param None.
  2181. *
  2182. * @return hciStatus_t
  2183. */
  2184. extern hciStatus_t HCI_EXT_SetFastTxResponseTimeCmd( uint8 control );
  2185. /*******************************************************************************
  2186. * @fn HCI_EXT_SetSlaveLatencyOverrideCmd API
  2187. *
  2188. * @brief This HCI Extension API is used to to enable or disable
  2189. * suspending slave latency.
  2190. *
  2191. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2192. *
  2193. * input parameters
  2194. *
  2195. * @param control - HCI_EXT_ENABLE_SL_OVERRIDE,
  2196. * HCI_EXT_DISABLE_SL_OVERRIDE
  2197. *
  2198. * output parameters
  2199. *
  2200. * @param None.
  2201. *
  2202. * @return hciStatus_t
  2203. */
  2204. extern hciStatus_t HCI_EXT_SetSlaveLatencyOverrideCmd( uint8 control );
  2205. /*******************************************************************************
  2206. * @fn HCI_EXT_ModemTestTxCmd
  2207. *
  2208. * @brief This API is used start a continuous transmitter modem test,
  2209. * using either a modulated or unmodulated carrier wave tone, at
  2210. * the frequency that corresponds to the specified RF channel. Use
  2211. * HCI_EXT_EndModemTest command to end the test.
  2212. *
  2213. * Note: A Controller reset will be issued by HCI_EXT_EndModemTest!
  2214. * Note: The BLE device will transmit at maximum power.
  2215. * Note: This API can be used to verify this device meets Japan's
  2216. * TELEC regulations.
  2217. *
  2218. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2219. *
  2220. * input parameters
  2221. *
  2222. * @param cwMode - HCI_EXT_TX_MODULATED_CARRIER,
  2223. * HCI_EXT_TX_UNMODULATED_CARRIER
  2224. * txFreq - Transmit RF channel k=0..39, where BLE F=2402+(k*2MHz).
  2225. *
  2226. * output parameters
  2227. *
  2228. * @param None.
  2229. *
  2230. * @return hciStatus_t
  2231. */
  2232. extern hciStatus_t HCI_EXT_ModemTestTxCmd( uint8 cwMode,
  2233. uint8 txFreq );
  2234. /*******************************************************************************
  2235. * @fn HCI_EXT_ModemHopTestTxCmd
  2236. *
  2237. * @brief This API is used to start a continuous transmitter direct test
  2238. * mode test using a modulated carrier wave and transmitting a
  2239. * 37 byte packet of Pseudo-Random 9-bit data. A packet is
  2240. * transmitted on a different frequency (linearly stepping through
  2241. * all RF channels 0..39) every 625us. Use HCI_EXT_EndModemTest
  2242. * command to end the test.
  2243. *
  2244. * Note: A Controller reset will be issued by HCI_EXT_EndModemTest!
  2245. * Note: The BLE device will transmit at maximum power.
  2246. * Note: This API can be used to verify this device meets Japan's
  2247. * TELEC regulations.
  2248. *
  2249. * input parameters
  2250. *
  2251. * @param None.
  2252. *
  2253. * output parameters
  2254. *
  2255. * @param None.
  2256. *
  2257. * @return hciStatus_t
  2258. */
  2259. extern hciStatus_t HCI_EXT_ModemHopTestTxCmd( void );
  2260. /*******************************************************************************
  2261. * @fn HCI_EXT_ModemTestRxCmd
  2262. *
  2263. * @brief This API is used to start a continuous receiver modem test
  2264. * using a modulated carrier wave tone, at the frequency that
  2265. * corresponds to the specific RF channel. Any received data is
  2266. * discarded. Receiver gain may be adjusted using the
  2267. * HCI_EXT_SetRxGain command. RSSI may be read during this test
  2268. * by using the HCI_ReadRssi command. Use HCI_EXT_EndModemTest
  2269. * command to end the test.
  2270. *
  2271. * Note: A Controller reset will be issued by HCI_EXT_EndModemTest!
  2272. * Note: The BLE device will transmit at maximum power.
  2273. *
  2274. * input parameters
  2275. *
  2276. * @param rxFreq - Receiver RF channel k=0..39, where BLE F=2402+(k*2MHz).
  2277. *
  2278. * output parameters
  2279. *
  2280. * @param None.
  2281. *
  2282. * @return hciStatus_t
  2283. */
  2284. extern hciStatus_t HCI_EXT_ModemTestRxCmd( uint8 rxFreq );
  2285. /*******************************************************************************
  2286. * @fn HCI_EXT_EndModemTestCmd
  2287. *
  2288. * @brief This API is used to shutdown a modem test. A complete Controller
  2289. * reset will take place.
  2290. *
  2291. * input parameters
  2292. *
  2293. * @param None.
  2294. *
  2295. * output parameters
  2296. *
  2297. * @param None.
  2298. *
  2299. * @return hciStatus_t
  2300. */
  2301. extern hciStatus_t HCI_EXT_EndModemTestCmd( void );
  2302. /*******************************************************************************
  2303. * @fn HCI_EXT_SetBDADDRCmd
  2304. *
  2305. * @brief This API is used to set this device's BLE address (BDADDR).
  2306. *
  2307. * Note: This command is only allowed when the device's state is
  2308. * Standby.
  2309. *
  2310. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2311. *
  2312. * input parameters
  2313. *
  2314. * @param bdAddr - A pointer to a buffer to hold this device's address.
  2315. * An invalid address (i.e. all FF's) will restore this
  2316. * device's address to the address set at initialization.
  2317. *
  2318. * output parameters
  2319. *
  2320. * @param None.
  2321. *
  2322. * @return hciStatus_t
  2323. */
  2324. extern hciStatus_t HCI_EXT_SetBDADDRCmd( uint8 *bdAddr );
  2325. /*******************************************************************************
  2326. * @fn HCI_EXT_SetSCACmd
  2327. *
  2328. * @brief This API is used to set this device's Sleep Clock Accuracy.
  2329. *
  2330. * Note: For a slave device, this value is directly used, but only
  2331. * if power management is enabled. For a master device, this
  2332. * value is converted into one of eight ordinal values
  2333. * representing a SCA range, as specified in Table 2.2,
  2334. * Vol. 6, Part B, Section 2.3.3.1 of the Core specification.
  2335. *
  2336. * Note: This command is only allowed when the device is not in a
  2337. * connection.
  2338. *
  2339. * Note: The device's SCA value remains unaffected by a HCI_Reset.
  2340. *
  2341. * input parameters
  2342. *
  2343. * @param scaInPPM - A SCA value in PPM from 0..500.
  2344. *
  2345. * output parameters
  2346. *
  2347. * @param None.
  2348. *
  2349. * @return hciStatus_t
  2350. */
  2351. extern hciStatus_t HCI_EXT_SetSCACmd( uint16 scaInPPM );
  2352. /*******************************************************************************
  2353. * @fn HCI_EXT_EnablePTMCmd
  2354. *
  2355. * @brief This HCI Extension API is used to enable Production Test Mode.
  2356. *
  2357. * Note: This function can only be directly called from the
  2358. * application and is not available via an external transport
  2359. * interface such as RS232. Also, no vendor specific
  2360. * command complete will be returned.
  2361. *
  2362. * input parameters
  2363. *
  2364. * @param None.
  2365. *
  2366. * output parameters
  2367. *
  2368. * @param None.
  2369. *
  2370. * @return hciStatus_t
  2371. */
  2372. extern hciStatus_t HCI_EXT_EnablePTMCmd( void );
  2373. /*******************************************************************************
  2374. * @fn HCI_EXT_SetFreqTuneCmd
  2375. *
  2376. * @brief This HCI Extension API is used to set the frequency tuning up
  2377. * or down. Setting the mode up/down decreases/increases the amount
  2378. * of capacitance on the external crystal oscillator.
  2379. *
  2380. * Note: This is a Production Test Mode only command!
  2381. *
  2382. * input parameters
  2383. *
  2384. * @param step - HCI_PTM_SET_FREQ_TUNE_UP, HCI_PTM_SET_FREQ_TUNE_DOWN
  2385. *
  2386. * output parameters
  2387. *
  2388. * @param None.
  2389. *
  2390. * @return hciStatus_t
  2391. */
  2392. extern hciStatus_t HCI_EXT_SetFreqTuneCmd( uint8 step );
  2393. /*******************************************************************************
  2394. * @fn HCI_EXT_SaveFreqTuneCmd
  2395. *
  2396. * @brief This HCI Extension API is used to save the frequency tuning
  2397. * value to flash.
  2398. *
  2399. * Note: This is a Production Test Mode only command!
  2400. *
  2401. * input parameters
  2402. *
  2403. * @param None.
  2404. *
  2405. * output parameters
  2406. *
  2407. * @param None.
  2408. *
  2409. * @return hciStatus_t
  2410. */
  2411. extern hciStatus_t HCI_EXT_SaveFreqTuneCmd( void );
  2412. /*******************************************************************************
  2413. * @fn HCI_EXT_SetMaxDtmTxPowerCmd API
  2414. *
  2415. * @brief This HCI Extension API is used to set the maximum transmit
  2416. * output power for Direct Test Mode.
  2417. *
  2418. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2419. *
  2420. * input parameters
  2421. *
  2422. * @param txPower - LL_EXT_TX_POWER_MINUS_23_DBM,
  2423. * LL_EXT_TX_POWER_MINUS_6_DBM,
  2424. * LL_EXT_TX_POWER_0_DBM,
  2425. * LL_EXT_TX_POWER_4_DBM
  2426. *
  2427. * output parameters
  2428. *
  2429. * @param None.
  2430. *
  2431. * @return hciStatus_t
  2432. */
  2433. extern hciStatus_t HCI_EXT_SetMaxDtmTxPowerCmd( uint8 txPower );
  2434. /*******************************************************************************
  2435. */
  2436. extern llStatus_t HCI_EXT_MapPmIoPortCmd( uint8 ioPort, uint8 ioPin );
  2437. /*******************************************************************************
  2438. * @fn HCI_EXT_DisconnectImmedCmd API
  2439. *
  2440. * @brief This HCI Extension API is used to disconnect the connection
  2441. * immediately.
  2442. *
  2443. * Note: The connection (if valid) is immediately terminated
  2444. * without notifying the remote device. The Host is still
  2445. * notified.
  2446. *
  2447. * input parameters
  2448. *
  2449. * @param connHandle - Connection handle.
  2450. *
  2451. * output parameters
  2452. *
  2453. * @param None.
  2454. *
  2455. * @return hciStatus_t
  2456. */
  2457. extern hciStatus_t HCI_EXT_DisconnectImmedCmd( uint16 connHandle );
  2458. /*******************************************************************************
  2459. * @fn HCI_EXT_PacketErrorRate Vendor Specific API
  2460. *
  2461. * @brief This function is used to Reset or Read the Packet Error Rate
  2462. * counters for a connection.
  2463. *
  2464. * Note: The counters are only 16 bits. At the shortest connection
  2465. * interval, this provides a bit over 8 minutes of data.
  2466. *
  2467. * input parameters
  2468. *
  2469. * @param connHandle - The LL connection ID on which to send this data.
  2470. * @param command - HCI_EXT_PER_RESET, HCI_EXT_PER_READ
  2471. *
  2472. * output parameters
  2473. *
  2474. * @param None.
  2475. *
  2476. * @return hciStatus_t
  2477. */
  2478. extern hciStatus_t HCI_EXT_PacketErrorRateCmd( uint16 connHandle, uint8 command );
  2479. /*******************************************************************************
  2480. * @fn HCI_EXT_PERbyChanCmd Vendor Specific API
  2481. *
  2482. * @brief This HCI Extension API is used to start or end Packet Error Rate
  2483. * by Channel counter accumulation for a connection. If the
  2484. * pointer is not NULL, it is assumed there is sufficient memory
  2485. * for the PER data, per the type perByChan_t. If NULL, then
  2486. * the operation is considered disabled.
  2487. *
  2488. * Note: It is the user's responsibility to make sure there is
  2489. * sufficient memory for the data, and that the counters
  2490. * are cleared prior to first use.
  2491. *
  2492. * Note: The counters are only 16 bits. At the shortest connection
  2493. * interval, this provides a bit over 8 minutes of data.
  2494. *
  2495. * input parameters
  2496. *
  2497. * @param connHandle - The LL connection ID on which to send this data.
  2498. * @param perByChan - Pointer to PER by Channel data, or NULL.
  2499. *
  2500. * output parameters
  2501. *
  2502. * @param None.
  2503. *
  2504. * @return hciStatus_t
  2505. */
  2506. extern hciStatus_t HCI_EXT_PERbyChanCmd( uint16 connHandle, perByChan_t *perByChan );
  2507. /*******************************************************************************
  2508. */
  2509. extern hciStatus_t HCI_EXT_ExtendRfRangeCmd( void );
  2510. /*******************************************************************************
  2511. * @fn HCI_EXT_HaltDuringRfCmd API
  2512. *
  2513. * @brief This HCI Extension API is used to enable or disable halting the
  2514. * CPU during RF. The system defaults to enabled.
  2515. *
  2516. * Related Events: HCI_VendorSpecifcCommandCompleteEvent
  2517. *
  2518. * input parameters
  2519. *
  2520. * @param mode - HCI_EXT_HALT_DURING_RF_ENABLE,
  2521. * HCI_EXT_HALT_DURING_RF_DISABLE
  2522. *
  2523. * output parameters
  2524. *
  2525. * @param None.
  2526. *
  2527. * @return hciStatus_t
  2528. */
  2529. extern hciStatus_t HCI_EXT_HaltDuringRfCmd( uint8 mode );
  2530. /*******************************************************************************
  2531. * @fn HCI_EXT_AdvEventNoticeCmd Vendor Specific API
  2532. *
  2533. * @brief This HCI Extension API is used to enable or disable a
  2534. * notification to the specified task using the specified task
  2535. * event whenever a Adv event ends. A non-zero taskEvent value is
  2536. * taken to be "enable", while a zero valued taskEvent is taken
  2537. * to be "disable".
  2538. *
  2539. * input parameters
  2540. *
  2541. * @param taskID - User's task ID.
  2542. * @param taskEvent - User's task event.
  2543. *
  2544. * output parameters
  2545. *
  2546. * @param None.
  2547. *
  2548. * @return hciStatus_t
  2549. */
  2550. extern hciStatus_t HCI_EXT_AdvEventNoticeCmd( uint8 taskID, uint16 taskEvent );
  2551. /*******************************************************************************
  2552. * @fn HCI_EXT_ConnEventNoticeCmd Vendor Specific API
  2553. *
  2554. * @brief This HCI Extension API is used to enable or disable a
  2555. * notification to the specified task using the specified task
  2556. * event whenever a Connection event ends. A non-zero taskEvent
  2557. * value is taken to be "enable", while a zero valued taskEvent
  2558. * taken to be "disable".
  2559. *
  2560. * Note: Currently, only a Slave connection is supported.
  2561. *
  2562. * input parameters
  2563. *
  2564. * @param taskID - User's task ID.
  2565. * @param taskEvent - User's task event.
  2566. *
  2567. * output parameters
  2568. *
  2569. * @param None.
  2570. *
  2571. * @return hciStatus_t
  2572. */
  2573. extern hciStatus_t HCI_EXT_ConnEventNoticeCmd( uint8 taskID, uint16 taskEvent );
  2574. /*******************************************************************************
  2575. * @fn HCI_EXT_BuildRevisionCmd Vendor Specific API
  2576. *
  2577. * @brief This HCI Extension API is used set a user revision number or
  2578. * read the build revision number.
  2579. *
  2580. * input parameters
  2581. *
  2582. * @param mode - HCI_EXT_SET_USER_REVISION | HCI_EXT_READ_BUILD_REVISION
  2583. *
  2584. * output parameters
  2585. *
  2586. * @param None.
  2587. *
  2588. * @return hciStatus_t
  2589. */
  2590. extern hciStatus_t HCI_EXT_BuildRevisionCmd( uint8 mode, uint16 userRevNum );
  2591. /*******************************************************************************
  2592. * @fn HCI_EXT_DelaySleepCmd Vendor Specific API
  2593. *
  2594. * @brief This HCI Extension API is used set the sleep delay.
  2595. *
  2596. * input parameters
  2597. *
  2598. * @param delay - 0..1000, in milliseconds.
  2599. *
  2600. * output parameters
  2601. *
  2602. * @param None.
  2603. *
  2604. * @return hciStatus_t
  2605. */
  2606. extern hciStatus_t HCI_EXT_DelaySleepCmd( uint16 delay );
  2607. /*******************************************************************************
  2608. * @fn HCI_EXT_ResetSystemCmd Vendor Specific API
  2609. *
  2610. * @brief This HCI Extension API is used to issue a soft or hard
  2611. * system reset.
  2612. *
  2613. * input parameters
  2614. *
  2615. * @param mode - HCI_EXT_RESET_SYSTEM_HARD | HCI_EXT_RESET_SYSTEM_SOFT
  2616. *
  2617. * output parameters
  2618. *
  2619. * @param None.
  2620. *
  2621. * @return hciStatus_t
  2622. */
  2623. extern hciStatus_t HCI_EXT_ResetSystemCmd( uint8 mode );
  2624. /*******************************************************************************
  2625. * @fn HCI_EXT_OverlappedProcessingCmd Vendor Specific API
  2626. *
  2627. * @brief This HCI Extension API is used to enable or disable overlapped
  2628. * processing.
  2629. *
  2630. * input parameters
  2631. *
  2632. * @param mode - HCI_EXT_ENABLE_OVERLAPPED_PROCESSING |
  2633. * HCI_EXT_DISABLE_OVERLAPPED_PROCESSING
  2634. *
  2635. * output parameters
  2636. *
  2637. * @param None.
  2638. *
  2639. * @return hciStatus_t
  2640. */
  2641. extern hciStatus_t HCI_EXT_OverlappedProcessingCmd( uint8 mode );
  2642. /*******************************************************************************
  2643. * @fn HCI_EXT_NumComplPktsLimitCmd Vendor Specific API
  2644. *
  2645. * @brief This HCI Extension API is used to set the minimum number of
  2646. * completed packets which must be met before a Number of
  2647. * Completed Packets event is returned. If the limit is not
  2648. * reach by the end of the connection event, then a Number of
  2649. * Completed Packets event will be returned (if non-zero) based
  2650. * on the flushOnEvt flag.
  2651. *
  2652. * input parameters
  2653. *
  2654. * @param limit - From 1 to HCI_MAX_NUM_DATA_BUFFERS.
  2655. * @param flushOnEvt - HCI_EXT_DISABLE_NUM_COMPL_PKTS_ON_EVENT |
  2656. * HCI_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT
  2657. *
  2658. * output parameters
  2659. *
  2660. * @param None.
  2661. *
  2662. * @return hciStatus_t
  2663. */
  2664. extern hciStatus_t HCI_EXT_NumComplPktsLimitCmd( uint8 limit,
  2665. uint8 flushOnEvt );
  2666. /*******************************************************************************
  2667. * @fn HCI_PPLUS_AdvEventDoneNoticeCmd Vendor Specific API
  2668. *
  2669. * @brief This HCI Extension API is used to enable or disable a notification to the
  2670. * specified task using the specified task event whenever a Adv event ends.
  2671. * A non-zero taskEvent value is taken to be "enable", while a zero valued
  2672. * taskEvent is taken to be "disable".
  2673. *
  2674. * input parameters
  2675. *
  2676. * @param taskID - User's task ID.
  2677. * @param taskEvent - User's task event.
  2678. *
  2679. * output parameters
  2680. *
  2681. * @param None.
  2682. *
  2683. * @return hciStatus_t
  2684. */
  2685. hciStatus_t HCI_PPLUS_AdvEventDoneNoticeCmd( uint8 taskID, uint16 taskEvent );
  2686. /*******************************************************************************
  2687. * @fn HCI_PPLUS_ConnEventDoneNoticeCmd Vendor Specific API
  2688. *
  2689. * @brief This HCI Extension API is used to enable or disable a notification to the
  2690. * specified task using the specified task event whenever a Connection event
  2691. * ends. A non-zero taskEvent value is taken to be "enable", while a zero valued
  2692. * taskEvent is taken to be "disable".
  2693. *
  2694. * input parameters
  2695. *
  2696. * @param taskID - User's task ID.
  2697. * @param taskEvent - User's task event.
  2698. *
  2699. * output parameters
  2700. *
  2701. * @param None.
  2702. *
  2703. * @return hciStatus_t
  2704. */
  2705. hciStatus_t HCI_PPLUS_ConnEventDoneNoticeCmd( uint8 taskID, uint16 taskEvent );
  2706. /*******************************************************************************
  2707. * This HCI Extension API is used to enable or disable a notification to the
  2708. * specified task using the specified task event whenever a Connection event
  2709. * ends. A non-zero taskEvent value is taken to be "enable", while a zero valued
  2710. * taskEvent is taken to be "disable".
  2711. *
  2712. */
  2713. hciStatus_t HCI_PPLUS_DateLengthChangedNoticeCmd( uint8 taskID, uint16 taskEvent );
  2714. /*******************************************************************************
  2715. * This HCI Extension API is used to enable or disable a notification to the
  2716. * specified task using the specified task event whenever a Connection event
  2717. * ends. A non-zero taskEvent value is taken to be "enable", while a zero valued
  2718. * taskEvent is taken to be "disable".
  2719. *
  2720. */
  2721. hciStatus_t HCI_PPLUS_PhyUpdateNoticeCmd( uint8 taskID, uint16 taskEvent );
  2722. /*******************************************************************************
  2723. * @fn HCI_PPLUS_ExtendTRXCmd Vendor Specific API
  2724. *
  2725. * @brief This HCI Extension API is used to enable or disable Tx/Rx packets limit
  2726. * per connection event to 8(default is 4).
  2727. *
  2728. * input parameters
  2729. *
  2730. * @param enable - TRUE: 8Tx/8Rx; FALSE: 4Tx/4Rx
  2731. *
  2732. * output parameters
  2733. *
  2734. * @param None.
  2735. *
  2736. * @return hciStatus_t
  2737. */
  2738. hciStatus_t HCI_PPLUS_ExtendTRXCmd( uint8 enable );
  2739. /*******************************************************************************
  2740. */
  2741. hciStatus_t HCI_LE_SetDataLengthCmd( uint16 connHandle,
  2742. uint16 TxOctets,
  2743. uint16 TxTime );
  2744. /*******************************************************************************
  2745. */
  2746. hciStatus_t HCI_LE_ReadMaxDataLengthCmd(void);
  2747. /*******************************************************************************
  2748. * This LE API is used to read Suggested Default max Data length
  2749. *
  2750. * Public function defined in hci.h.
  2751. */
  2752. hciStatus_t HCI_LE_ReadSuggestedDefaultDataLengthCmd(void);
  2753. /*******************************************************************************
  2754. * This LE API is used to write Suggested Default Data length
  2755. *
  2756. * Public function defined in hci.h.
  2757. */
  2758. hciStatus_t HCI_LE_WriteSuggestedDefaultDataLengthCmd(uint16 suggestedMaxTxOctets,uint16 suggestedMaxTxTime);
  2759. /*******************************************************************************
  2760. * This LE API is used to set DefaultPhyMode
  2761. *
  2762. * Public function defined in hci.h.
  2763. */
  2764. hciStatus_t HCI_LE_SetDefaultPhyMode( uint16 connId,uint8 allPhy,uint8 txPhy, uint8 rxPhy);
  2765. /*******************************************************************************
  2766. * This LE API is used to Set PHY Mode
  2767. *
  2768. * Public function defined in hci.h.
  2769. */
  2770. hciStatus_t HCI_LE_SetPhyMode( uint16 connId,uint8 allPhy,uint8 txPhy, uint8 rxPhy,uint16 phyOptions);
  2771. /*******************************************************************************
  2772. * This LE API is used to Read PHY Mode
  2773. *
  2774. * Public function defined in hci.h.
  2775. */
  2776. hciStatus_t HCI_LE_ReadPhyMode( uint16 connId);
  2777. #ifdef __cplusplus
  2778. }
  2779. #endif
  2780. #endif /* HCI_H */