ll.h 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855
  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: ll.h
  30. Revised:
  31. Revision:
  32. Description: This file contains the Link Layer (LL) API for the Bluetooth
  33. Low Energy (BLE) Controller. It provides the defines, types,
  34. and functions for all supported Bluetooth Low Energy (BLE)
  35. commands.
  36. This API is based on the Bluetooth Core Specification,
  37. V4.0.0, Vol. 6.
  38. *******************************************************************************/
  39. #ifndef LL_H
  40. #define LL_H
  41. #ifdef __cplusplus
  42. extern "C"
  43. {
  44. #endif
  45. /*******************************************************************************
  46. * INCLUDES
  47. */
  48. #include "bcomdef.h"
  49. /*******************************************************************************
  50. * MACROS
  51. */
  52. // check if connection parameter ranges for CI (min/max), SL, and LSTO are valid
  53. #define LL_INVALID_CONN_TIME_PARAM( ciMin, ciMax, sl, lsto ) \
  54. (((ciMin) < LL_CONN_INTERVAL_MIN) || \
  55. ((ciMin) > LL_CONN_INTERVAL_MAX) || \
  56. ((ciMax) < LL_CONN_INTERVAL_MIN) || \
  57. ((ciMax) > LL_CONN_INTERVAL_MAX) || \
  58. ((ciMax) < (ciMin)) || \
  59. ((sl) > LL_SLAVE_LATENCY_MAX) || \
  60. ((lsto) < LL_CONN_TIMEOUT_MIN) || \
  61. ((lsto) > LL_CONN_TIMEOUT_MAX))
  62. // check if the CI/SL/LSTO combination is valid
  63. // based on: LSTO > (1 + Slave Latency) * (Connection Interval * 2)
  64. // Note: The CI * 2 requirement based on ESR05 V1.0, Erratum 3904.
  65. // Note: LSTO time is normalized to units of 1.25ms (i.e. 10ms = 8 * 1.25ms).
  66. #define LL_INVALID_CONN_TIME_PARAM_COMBO( ci, sl, lsto ) \
  67. ((uint32)((lsto)*8) <= ((uint32)(1+(sl)) * (uint32)((ci)*2)))
  68. /*******************************************************************************
  69. * CONSTANTS
  70. */
  71. /*
  72. ** LL API Status Codes
  73. **
  74. ** Note: These status values map directly to the HCI Error Codes.
  75. ** Per the Bluetooth Core Specification, V4.0.0, Vol. 2, Part D.
  76. */
  77. #define LL_STATUS_SUCCESS 0x00 // Success
  78. #define LL_STATUS_ERROR_UNKNOWN_CONN_HANDLE 0x02 // Unknown Connection Identifier
  79. #define LL_STATUS_ERROR_INACTIVE_CONNECTION 0x02 // Unknown Connection Identifier for now; may be needed for multiple connections
  80. #define LL_STATUS_ERROR_AUTH_FAILURE 0x05 // Authentication Failure
  81. #define LL_STATUS_ERROR_PIN_OR_KEY_MISSING 0x06 // Pin or Key Missing
  82. #define LL_STATUS_ERROR_OUT_OF_CONN_RESOURCES 0x07 // Memory Capacity Exceeded
  83. #define LL_STATUS_ERROR_OUT_OF_TX_MEM 0x07 // Memory Capacity Exceeded
  84. #define LL_STATUS_ERROR_OUT_OF_RX_MEM 0x07 // Memory Capacity Exceeded
  85. #define LL_STATUS_ERROR_OUT_OF_HEAP 0x07 // Memory Capacity Exceeded
  86. #define LL_STATUS_ERROR_WL_TABLE_FULL 0x07 // Memory Capacity Exceeded
  87. #define LL_STATUS_ERROR_TX_DATA_QUEUE_FULL 0x07 // Memory Capacity Exceeded
  88. #define LL_STATUS_ERROR_TX_DATA_QUEUE_EMPTY 0x07 // Memory Capacity Exceeded
  89. #define LL_STATUS_ERROR_CONNECTION_TIMEOUT 0x08 // Connection Timeout
  90. #define LL_STATUS_ERROR_CONNECTION_LIMIT_EXCEEDED 0x09 // Connection Limit Exceeded
  91. #define LL_STATUS_ERROR_COMMAND_DISALLOWED 0x0C // Command Disallowed
  92. #define LL_STATUS_ERROR_DUE_TO_LIMITED_RESOURCES 0x0D // Command Rejected Due To Limited Resources
  93. #define LL_STATUS_ERROR_DUE_TO_DELAYED_RESOURCES 0x0D // Command Delayed Due To Limited Resources
  94. #define LL_STATUS_ERROR_FEATURE_NOT_SUPPORTED 0x11 // Unsupported Feature or Parameter Value
  95. #define LL_STATUS_ERROR_UNEXPECTED_PARAMETER 0x12 // Invalid HCI Command Parameters
  96. #define LL_STATUS_ERROR_ILLEGAL_PARAM_COMBINATION 0x12 // Invalid HCI Command Parameters
  97. #define LL_STATUS_ERROR_BAD_PARAMETER 0x12 // Invalid HCI Command Parameters or 0x30: Parameter Out of Mandatory Range?
  98. #define LL_STATUS_ERROR_UNKNOWN_ADV_EVT_TYPE 0x12 // Invalid HCI Command Parameters or 0x30: Parameter Out of Mandatory Range?
  99. #define LL_STATUS_ERROR_PEER_TERM 0x13 // Remote User Terminated Connection
  100. #define LL_STATUS_ERROR_PEER_DEVICE_TERM_LOW_RESOURCES 0x14 // Remote Device Terminated Connection Due To Low Resources
  101. #define LL_STATUS_ERROR_PEER_DEVICE_TERM_POWER_OFF 0x15 // Remote Device Terminated Connection Due To Power Off
  102. #define LL_STATUS_ERROR_HOST_TERM 0x16 // Connection Terminated By Local Host
  103. #define LL_STATUS_ERROR_UNSUPPORTED_REMOTE_FEATURE 0x1A // Unsupported Remote Feature
  104. #define LL_STATUS_ERROR_WL_ENTRY_NOT_FOUND 0x1F // Unspecified Error
  105. #define LL_STATUS_ERROR_WL_TABLE_EMPTY 0x1F // Unspecified Error
  106. #define LL_STATUS_ERROR_RNG_FAILURE 0x1F // Unspecified Error
  107. #define LL_STATUS_ERROR_DISCONNECT_IMMEDIATE 0x1F // Unspecified Error
  108. #define LL_STATUS_ERROR_DATA_PACKET_QUEUED 0x1F // Unspecified Error
  109. #define LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE 0x21 // Role Change Not Allowed
  110. #define LL_STATUS_ERROR_LL_TIMEOUT 0x22 // Link Layer Response Timeout
  111. #define LL_STATUS_ERROR_LL_TIMEOUT_HOST 0x22 // Link Layer Response Timeout
  112. #define LL_STATUS_ERROR_LL_TIMEOUT_PEER 0x22 // Link Layer Response Timeout
  113. #define LL_STATUS_ERROR_LL_PROCEDURE_COLLISION 0x23 // Link Layer Procedure collision
  114. #define LL_STATUS_ERROR_INSTANT_PASSED 0x28 // Instant Passed
  115. #define LL_STATUS_ERROR_INSTANT_PASSED_HOST 0x28 // Instant Passed
  116. #define LL_STATUS_ERROR_INSTANT_PASSED_PEER 0x28 // Instant Passed
  117. #define LL_STATUS_ERROR_KEY_PAIRING_NOT_SUPPORTED 0x29 // Pairing With Unit Key Not Supported
  118. #define LL_STATUS_ERROR_DIFF_TRANSACTION_COLLISION 0x2A // Link Layer collision in same procedure
  119. #define LL_STATUS_ERROR_NO_ADV_CHAN_FOUND 0x30 // Parameter Out Of Mandatory Range
  120. #define LL_STATUS_ERROR_PARAM_OUT_OF_RANGE 0x30 // Parameter Out Of Mandatory Range
  121. #define LL_STATUS_ERROR_UPDATE_CTRL_PROC_PENDING 0x3A // Controller Busy
  122. #define LL_STATUS_ERROR_CTRL_PROC_ALREADY_ACTIVE 0x3A // Controller Busy
  123. #define LL_STATUS_ERROR_VER_INFO_REQ_ALREADY_PENDING 0x3A // Controller Busy
  124. #define LL_STATUS_ERROR_UNACCEPTABLE_CONN_INTERVAL 0x3B // Unacceptable Connection Interval
  125. #define LL_STATUS_ERROR_DIRECTED_ADV_TIMEOUT 0x3C // Directed Advertising Timeout
  126. #define LL_STATUS_ERROR_CONN_TERM_DUE_TO_MIC_FAILURE 0x3D // Connection Terminated Due To MIC Failure
  127. #define LL_STATUS_ERROR_CONN_FAILED_TO_BE_ESTABLISHED 0x3E // Connection Failed To Be Established
  128. #define LL_STATUS_ERROR_CONN_TIMING_FAILURE 0x3F // MAC Connection Failed
  129. // Internal
  130. #define LL_STATUS_WARNING_WAITING_LLIRQ 0xFE // only used internally, so value doesn't matter
  131. #define LL_STATUS_WARNING_TX_DISABLED 0xFF // only used internally, so value doesn't matter
  132. #define LL_STATUS_WARNING_FLAG_UNCHANGED 0xFF // only used internally, so value doesn't matter
  133. // Encryption Key Request Reason Codes
  134. #define LL_ENC_KEY_REQ_ACCEPTED LL_STATUS_SUCCESS
  135. #define LL_ENC_KEY_REQ_REJECTED LL_STATUS_ERROR_PIN_OR_KEY_MISSING
  136. #define LL_ENC_KEY_REQ_UNSUPPORTED_FEATURE LL_STATUS_ERROR_UNSUPPORTED_REMOTE_FEATURE
  137. // Disconnect Reason Codes
  138. #define LL_SUPERVISION_TIMEOUT_TERM LL_STATUS_ERROR_CONNECTION_TIMEOUT
  139. #define LL_PEER_REQUESTED_TERM LL_STATUS_ERROR_PEER_TERM
  140. #define LL_PEER_REQUESTED_LOW_RESOURCES_TERM LL_STATUS_ERROR_PEER_DEVICE_TERM_LOW_RESOURCES
  141. #define LL_PEER_REQUESTED_POWER_OFF_TERM LL_STATUS_ERROR_PEER_DEVICE_TERM_POWER_OFF
  142. #define LL_HOST_REQUESTED_TERM LL_STATUS_ERROR_HOST_TERM
  143. #define LL_CTRL_PKT_TIMEOUT_TERM LL_STATUS_ERROR_LL_TIMEOUT
  144. #define LL_CTRL_PKT_TIMEOUT_HOST_TERM LL_STATUS_ERROR_LL_TIMEOUT_HOST
  145. #define LL_CTRL_PKT_TIMEOUT_PEER_TERM LL_STATUS_ERROR_LL_TIMEOUT_PEER
  146. #define LL_CTRL_PKT_INSTANT_PASSED_TERM LL_STATUS_ERROR_INSTANT_PASSED
  147. #define LL_CTRL_PKT_INSTANT_PASSED_HOST_TERM LL_STATUS_ERROR_INSTANT_PASSED_HOST
  148. #define LL_CTRL_PKT_INSTANT_PASSED_PEER_TERM LL_STATUS_ERROR_INSTANT_PASSED_PEER
  149. #define LL_UNACCEPTABLE_CONN_INTERVAL_TERM LL_STATUS_ERROR_UNACCEPTABLE_CONN_INTERVAL
  150. #define LL_MIC_FAILURE_TERM LL_STATUS_ERROR_CONN_TERM_DUE_TO_MIC_FAILURE
  151. #define LL_CONN_ESTABLISHMENT_FAILED_TERM LL_STATUS_ERROR_CONN_FAILED_TO_BE_ESTABLISHED
  152. // Disconnect API Parameter
  153. #define LL_DISCONNECT_AUTH_FAILURE LL_STATUS_ERROR_AUTH_FAILURE
  154. #define LL_DISCONNECT_REMOTE_USER_TERM LL_STATUS_ERROR_PEER_TERM
  155. #define LL_DISCONNECT_REMOTE_DEV_LOW_RESOURCES LL_STATUS_ERROR_PEER_DEVICE_TERM_LOW_RESOURCES
  156. #define LL_DISCONNECT_REMOTE_DEV_POWER_OFF LL_STATUS_ERROR_PEER_DEVICE_TERM_POWER_OFF
  157. #define LL_DISCONNECT_UNSUPPORTED_REMOTE_FEATURE LL_STATUS_ERROR_UNSUPPORTED_REMOTE_FEATURE
  158. #define LL_DISCONNECT_KEY_PAIRING_NOT_SUPPORTED LL_STATUS_ERROR_KEY_PAIRING_NOT_SUPPORTED
  159. #define LL_DISCONNECT_UNACCEPTABLE_CONN_INTERVAL LL_STATUS_ERROR_UNACCEPTABLE_CONN_INTERVAL
  160. /*
  161. ** LL Buffers Supported
  162. */
  163. #define LL_MAX_NUM_DATA_BUFFERS 12
  164. #define LL_MAX_NUM_CMD_BUFFERS 1
  165. /*
  166. ** LL API Parameters
  167. */
  168. // LL Parameter Limits
  169. #define LL_ADV_CONN_INTERVAL_MIN 32 // 20ms in 625us
  170. #define LL_ADV_CONN_INTERVAL_MAX 16384 // 10.24s in 625us
  171. #define LL_ADV_NONCONN_INTERVAL_MIN 160 // 100ms in 625us
  172. #define LL_ADV_NONCONN_INTERVAL_MAX 16384 // 10.24s in 625us
  173. #define LL_ADV_DELAY_MIN 0 // in ms
  174. #define LL_ADV_DELAY_MAX 10 // in ms
  175. #define LL_SCAN_INTERVAL_MIN 4 // 2.5ms in 625us
  176. #define LL_SCAN_INTERVAL_MAX 16384 // 10.24s in 625us
  177. #define LL_SCAN_WINDOW_MIN 4 // 2.5ms in 625us
  178. #define LL_SCAN_WINDOW_MAX 16384 // 10.24s in 625us
  179. #define LL_CONN_INTERVAL_MIN 6 // 7.5ms in 1.25ms
  180. #define LL_CONN_INTERVAL_MAX 3200 // 4s in 1.25ms
  181. #define LL_CONN_TIMEOUT_MIN 10 // 100ms in 10ms
  182. #define LL_CONN_TIMEOUT_MAX 3200 // 32s in 10ms
  183. #define LL_SLAVE_LATENCY_MIN 0
  184. #define LL_SLAVE_LATENCY_MAX 499
  185. #define LL_HOP_LENGTH_MIN 5
  186. #define LL_HOP_LENGTH_MAX 16
  187. #define LL_INSTANT_NUMBER_MIN 6
  188. #define LL_ADV_INTERVAL_DEFAULT 160 // 100ms in 625us ticks
  189. #define LL_SCAN_INTERVAL_DEFAULT 640 // 400ms in 625us ticks
  190. // LL Advertiser Channels
  191. #define LL_ADV_CHAN_37 1
  192. #define LL_ADV_CHAN_38 2
  193. #define LL_ADV_CHAN_39 4
  194. #define LL_ADV_CHAN_ALL (LL_ADV_CHAN_37 | LL_ADV_CHAN_38 | LL_ADV_CHAN_39)
  195. // Advertiser Synchronization Word
  196. #define ADV_SYNCH_WORD 0x8E89BED6 // Adv channel sync
  197. #define ADV_CRC_INIT_VALUE 0x00555555 // not needed; handled by NR hardware automatically
  198. // LL Advertiser Events
  199. #define LL_ADV_CONNECTABLE_UNDIRECTED_EVT 0
  200. #define LL_ADV_CONNECTABLE_HDC_DIRECTED_EVT 1 // High Duty Cycle
  201. #define LL_ADV_SCANNABLE_UNDIRECTED_EVT 2
  202. #define LL_ADV_NONCONNECTABLE_UNDIRECTED_EVT 3
  203. #define LL_ADV_CONNECTABLE_LDC_DIRECTED_EVT 4 // Low Duty Cycle
  204. // LL Address Type
  205. #define LL_DEV_ADDR_TYPE_PUBLIC 0
  206. #define LL_DEV_ADDR_TYPE_RANDOM 1
  207. // Advertiser White List Policy
  208. #define LL_ADV_WL_POLICY_ANY_REQ 0 // any scan request or connect request
  209. #define LL_ADV_WL_POLICY_WL_SCAN_REQ 1 // any connect request, white list scan request
  210. #define LL_ADV_WL_POLICY_WL_CONNECT_REQ 2 // any scan request, white list connect request
  211. #define LL_ADV_WL_POLICY_WL_ALL_REQ 3 // white list scan request and connect request
  212. // Scanner White List Policy
  213. #define LL_SCAN_WL_POLICY_ANY_ADV_PKTS 0
  214. #define LL_SCAN_WL_POLICY_USE_WHITE_LIST 1
  215. // Initiator White List Policy
  216. #define LL_INIT_WL_POLICY_USE_PEER_ADDR 0
  217. #define LL_INIT_WL_POLICY_USE_WHITE_LIST 1
  218. // Black List Control
  219. #define LL_SET_BLACKLIST_DISABLE 0
  220. #define LL_SET_BLACKLIST_ENABLE 1
  221. // Advertiser Commands
  222. #define LL_ADV_MODE_OFF 0
  223. #define LL_ADV_MODE_ON 1
  224. #define LL_ADV_MODE_RESERVED 2
  225. // LL Scan Commands
  226. #define LL_SCAN_STOP 0
  227. #define LL_SCAN_START 1
  228. // LL Scan Filtering
  229. #define LL_FILTER_REPORTS_DISABLE 0
  230. #define LL_FILTER_REPORTS_ENABLE 1
  231. // LL Scan Types
  232. #define LL_SCAN_PASSIVE 0
  233. #define LL_SCAN_ACTIVE 1
  234. // LL Tx Power Types
  235. #define LL_READ_CURRENT_TX_POWER_LEVEL 0
  236. #define LL_READ_MAX_TX_POWER_LEVEL 1
  237. // Data Fragmentation Flag
  238. #define LL_DATA_FIRST_PKT_HOST_TO_CTRL 0
  239. #define LL_DATA_CONTINUATION_PKT 1
  240. #define LL_DATA_FIRST_PKT_CTRL_TO_HOST 2
  241. // Connection Complete Role
  242. #define LL_LINK_CONNECT_COMPLETE_MASTER 0
  243. #define LL_LINK_CONNECT_COMPLETE_SLAVE 1
  244. // Encryption Related
  245. #define LL_ENCRYPTION_OFF 0
  246. #define LL_ENCRYPTION_ON 1
  247. // Feature Set Related
  248. #define LL_MAX_FEATURE_SET_SIZE 8 // in bytes
  249. //
  250. #define LL_FEATURE_RFU 0 // all bits in a byte
  251. #define LL_FEATURE_ENCRYPTION 1 // byte 0, bit 0
  252. #define LL_FEATURE_EXT_REJECT_IND 4 // byte 0, bit 0
  253. #define LL_FEATURE_DATA_LENGTH_EXTENSION 0x20 // byte 0, bit 0
  254. #define LL_FEATURE_2M_PHY 0x01 // byte 1, bit 0
  255. #define LL_FEATURE_CODED_PHY 0x08 // byte 1, bit 3
  256. // Receive Flow Control
  257. #define LL_DISABLE_RX_FLOW_CONTROL 0
  258. #define LL_ENABLE_RX_FLOW_CONTROL 1
  259. // Direct Test Mode
  260. #define LL_DIRECT_TEST_NUM_RF_CHANS 40 // PHY_NUM_RF_CHANS
  261. #define LL_DIRECT_TEST_MAX_PAYLOAD_LEN 37
  262. //
  263. #define LL_DIRECT_TEST_PAYLOAD_PRBS9 0
  264. #define LL_DIRECT_TEST_PAYLOAD_0x0F 1
  265. #define LL_DIRECT_TEST_PAYLOAD_0x55 2
  266. #define LL_DIRECT_TEST_PAYLOAD_PRBS15 3
  267. #define LL_DIRECT_TEST_PAYLOAD_0xFF 4
  268. #define LL_DIRECT_TEST_PAYLOAD_0x00 5
  269. #define LL_DIRECT_TEST_PAYLOAD_0xF0 6
  270. #define LL_DIRECT_TEST_PAYLOAD_0xAA 7
  271. #define LL_DIRECT_TEST_PAYLOAD_UNDEFINED 0xFF
  272. //
  273. #define LL_DIRECT_TEST_MODE_TX 0
  274. #define LL_DIRECT_TEST_MODE_RX 1
  275. //
  276. #define LL_RF_RSSI_UNDEFINED PHY_RSSI_VALUE_INVALID
  277. // Vendor Specific
  278. #define LL_EXT_RX_GAIN_STD 0
  279. #define LL_EXT_RX_GAIN_HIGH 1
  280. //
  281. #define LL_EXT_TX_POWER_MINUS_23_DBM 0
  282. #define LL_EXT_TX_POWER_MINUS_6_DBM 1
  283. #define LL_EXT_TX_POWER_0_DBM 2
  284. #define LL_EXT_TX_POWER_4_DBM 3
  285. //
  286. #define LL_EXT_DISABLE_ONE_PKT_PER_EVT 0
  287. #define LL_EXT_ENABLE_ONE_PKT_PER_EVT 1
  288. //
  289. #define LL_EXT_DISABLE_CLK_DIVIDE_ON_HALT 0
  290. #define LL_EXT_ENABLE_CLK_DIVIDE_ON_HALT 1
  291. //
  292. #define LL_EXT_NV_NOT_IN_USE 0
  293. #define LL_EXT_NV_IN_USE 1
  294. //
  295. #define LL_EXT_DISABLE_FAST_TX_RESP_TIME 0
  296. #define LL_EXT_ENABLE_FAST_TX_RESP_TIME 1
  297. //
  298. #define LL_EXT_DISABLE_SL_OVERRIDE 0
  299. #define LL_EXT_ENABLE_SL_OVERRIDE 1
  300. //
  301. #define LL_EXT_TX_MODULATED_CARRIER 0
  302. #define LL_EXT_TX_UNMODULATED_CARRIER 1
  303. //
  304. #define LL_EXT_SET_FREQ_TUNE_DOWN 0
  305. #define LL_EXT_SET_FREQ_TUNE_UP 1
  306. //
  307. #define LL_EXT_PER_RESET 0
  308. #define LL_EXT_PER_READ 1
  309. //
  310. #define LL_EXT_HALT_DURING_RF_DISABLE 0
  311. #define LL_EXT_HALT_DURING_RF_ENABLE 1
  312. //
  313. #define LL_EXT_SET_USER_REVISION 0
  314. #define LL_EXT_READ_BUILD_REVISION 1
  315. //
  316. #define LL_EXT_RESET_SYSTEM_DELAY 100 // in ms
  317. #define LL_EXT_RESET_SYSTEM_HARD 0
  318. #define LL_EXT_RESET_SYSTEM_SOFT 1
  319. //
  320. #define LL_EXT_DISABLE_OVERLAPPED_PROCESSING 0
  321. #define LL_EXT_ENABLE_OVERLAPPED_PROCESSING 1
  322. //
  323. #define LL_EXT_DISABLE_NUM_COMPL_PKTS_ON_EVENT 0
  324. #define LL_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT 1
  325. // Packet Lengths
  326. #define LL_DEVICE_ADDR_LEN 6
  327. #define LL_MAX_ADV_DATA_LEN 31
  328. #define LL_MAX_ADV_PAYLOAD_LEN (LL_DEVICE_ADDR_LEN + LL_MAX_ADV_DATA_LEN)
  329. #define LL_MAX_SCAN_DATA_LEN 31
  330. #define LL_MAX_SCAN_PAYLOAD_LEN (LL_DEVICE_ADDR_LEN + LL_MAX_SCAN_DATA_LEN)
  331. #define LL_MAX_LINK_DATA_LEN 27 // ZQ 20181030 for DLE feature
  332. //replaced by g_llPduLen.local.MaxTxOctets
  333. /*
  334. ** Event Parameters
  335. */
  336. // Advertising Report Data
  337. #define LL_ADV_RPT_ADV_IND LL_ADV_CONNECTABLE_UNDIRECTED_EVT
  338. #define LL_ADV_RPT_ADV_DIRECT_IND LL_ADV_CONNECTABLE_HDC_DIRECTED_EVT
  339. #define LL_ADV_RPT_ADV_SCANNABLE_IND LL_ADV_SCANNABLE_UNDIRECTED_EVT
  340. #define LL_ADV_RPT_ADV_NONCONN_IND LL_ADV_NONCONNECTABLE_UNDIRECTED_EVT
  341. #define LL_ADV_RPT_SCAN_RSP (LL_ADV_NONCONNECTABLE_UNDIRECTED_EVT + 1)
  342. #define LL_ADV_RPT_INVALID 0xFF
  343. //
  344. #define LL_RSSI_NOT_AVAILABLE 127
  345. // Sleep Clock Accuracy (SCA)
  346. #define LL_SCA_500_PPM 0
  347. #define LL_SCA_250_PPM 1
  348. #define LL_SCA_150_PPM 2
  349. #define LL_SCA_100_PPM 3
  350. #define LL_SCA_75_PPM 4
  351. #define LL_SCA_50_PPM 5
  352. #define LL_SCA_30_PPM 6
  353. #define LL_SCA_20_PPM 7
  354. // Default SCA
  355. //#define LL_SCA_MASTER_DEFAULT 5 // 50ppm (ordinal value)
  356. #define LL_SCA_MASTER_DEFAULT 0 // 500ppm (ordinal value)
  357. #define LL_SCA_SLAVE_DEFAULT 500 // 500ppm
  358. // LL Advertiser Channels
  359. #define LL_ADV_CHAN_37 1
  360. #define LL_ADV_CHAN_38 2
  361. #define LL_ADV_CHAN_39 4
  362. #define LL_ADV_CHAN_ALL (LL_ADV_CHAN_37 | LL_ADV_CHAN_38 | LL_ADV_CHAN_39)
  363. #define LL_ADV_CHAN_MAP_DEFAULT LL_ADV_CHAN_ALL
  364. #define LL_ADV_CHAN_FIRST 37
  365. #define LL_ADV_CHAN_LAST 39
  366. // max future number of events for an update to parameters or data channel
  367. #define LL_MAX_UPDATE_COUNT_RANGE 32767
  368. // add by HZF for whitelist
  369. #define LL_WHITELIST_ENTRY_NUM 8
  370. /*
  371. ** Miscellaneous
  372. */
  373. #define LL_MAX_NUM_DATA_CHAN 37 // 0 - 36
  374. /*******************************************************************************
  375. * TYPEDEFS
  376. */
  377. typedef uint8 llStatus_t;
  378. // Packet Error Rate Information By Channel
  379. typedef struct
  380. {
  381. uint16 numPkts[ LL_MAX_NUM_DATA_CHAN ];
  382. uint16 numCrcErr[ LL_MAX_NUM_DATA_CHAN ];
  383. } perByChan_t;
  384. typedef struct
  385. {
  386. uint16 rxNumPkts[ LL_MAX_NUM_DATA_CHAN ];
  387. uint16 rxNumCrcErr[ LL_MAX_NUM_DATA_CHAN ];
  388. uint16 txNumRetry[ LL_MAX_NUM_DATA_CHAN ];
  389. uint16 TxNumAck[ LL_MAX_NUM_DATA_CHAN ];
  390. uint16 rxToCnt[ LL_MAX_NUM_DATA_CHAN ];
  391. uint16 connEvtCnt[ LL_MAX_NUM_DATA_CHAN ];
  392. } perStatsByChan_t;
  393. typedef struct
  394. {
  395. uint16 rxNumPkts;
  396. uint16 rxNumCrcErr;
  397. uint16 txNumRetry;
  398. uint16 TxNumAck;
  399. uint16 rxToCnt;
  400. uint16 connEvtCnt;
  401. } perStats_t;
  402. typedef struct
  403. {
  404. uint16_t MaxTxOctets;
  405. uint16_t MaxTxTime;
  406. uint16_t MaxRxOctets;
  407. uint16_t MaxRxTime;
  408. }ll_pdu_length_ctrl_t;
  409. typedef struct
  410. {
  411. ll_pdu_length_ctrl_t local;
  412. ll_pdu_length_ctrl_t remote;
  413. ll_pdu_length_ctrl_t suggested;
  414. uint8_t isProcessingReq;
  415. uint8_t isWatingRsp;
  416. uint8_t isChanged;
  417. uint8_t dummy[1];
  418. }llPduLenManagment_t;
  419. typedef struct
  420. {
  421. uint8_t allPhy;
  422. uint8_t txPhy;
  423. uint8_t rxPhy;
  424. uint8_t dummy[1];
  425. }ll_phy_ctrl_t;
  426. typedef struct
  427. {
  428. uint8_t m2sPhy;
  429. uint8_t s2mPhy;
  430. uint16_t instant;
  431. }ll_phy_update_ind_t;
  432. typedef struct
  433. {
  434. ll_phy_ctrl_t def;
  435. ll_phy_ctrl_t local;
  436. ll_phy_ctrl_t req;
  437. ll_phy_ctrl_t rsp;
  438. uint16_t phyOptions;
  439. uint8_t isChanged;
  440. uint8_t isProcessingReq;
  441. uint8_t isWatingRsp;
  442. uint8_t status;
  443. uint8_t dummy[2];
  444. }llPhyModeManagment_t;
  445. typedef enum{
  446. LE_1M_PHY= 0x01,
  447. LE_2M_PHY= 0x02,
  448. LE_CODED_PHY=0x04,
  449. }PhyModeCtrl_e;
  450. typedef uint8_t ( *LL_PLUS_AdvDataFilterCB_t )(void);
  451. typedef uint8_t ( *LL_PLUS_ScanRequestFilterCB_t )(void);
  452. /*******************************************************************************
  453. * LOCAL VARIABLES
  454. */
  455. /*******************************************************************************
  456. * GLOBAL VARIABLES
  457. */
  458. /*******************************************************************************
  459. * LL OSAL Functions
  460. */
  461. /*******************************************************************************
  462. * @fn LL_Init
  463. *
  464. * @brief This is the Link Layer task initialization called by OSAL. It
  465. * must be called once when the software system is started and
  466. * before any other function in the LL API is called.
  467. *
  468. * input parameters
  469. *
  470. * @param taskId - Task identifier assigned by OSAL.
  471. *
  472. * output parameters
  473. *
  474. * @param None.
  475. *
  476. * @return None.
  477. */
  478. extern void LL_Init( uint8 taskId );
  479. /*******************************************************************************
  480. * @fn LL_ProcessEvent
  481. *
  482. * @brief This is the Link Layer process event handler called by OSAL.
  483. *
  484. * input parameters
  485. *
  486. * @param taskId - Task identifier assigned by OSAL.
  487. * events - Event flags to be processed by this task.
  488. *
  489. * output parameters
  490. *
  491. * @param None.
  492. *
  493. * @return Unprocessed event flags.
  494. */
  495. extern uint16 LL_ProcessEvent( uint8 task_id, uint16 events );
  496. /*******************************************************************************
  497. * LL API for HCI
  498. */
  499. /*******************************************************************************
  500. * @fn LL_TX_bm_alloc API
  501. *
  502. * @brief This API is used to allocate memory using buffer management.
  503. *
  504. * Note: This function should never be called by the application.
  505. * It is only used by HCI and L2CAP_bm_alloc.
  506. *
  507. * input parameters
  508. *
  509. * @param size - Number of bytes to allocate from the heap.
  510. *
  511. * output parameters
  512. *
  513. * @param None.
  514. *
  515. * @return Pointer to buffer, or NULL.
  516. */
  517. extern void *LL_TX_bm_alloc( uint16 size );
  518. /*******************************************************************************
  519. * @fn LL_RX_bm_alloc API
  520. *
  521. * @brief This API is used to allocate memory using buffer management.
  522. *
  523. * Note: This function should never be called by the application.
  524. * It is only used by HCI and L2CAP_bm_alloc.
  525. *
  526. * input parameters
  527. *
  528. * @param size - Number of bytes to allocate from the heap.
  529. *
  530. * output parameters
  531. *
  532. * @param None.
  533. *
  534. * @return Pointer to buffer, or NULL.
  535. */
  536. extern void *LL_RX_bm_alloc( uint16 size );
  537. /*******************************************************************************
  538. * @fn LL_Reset API
  539. *
  540. * @brief This function is used by the HCI to reset and initialize the
  541. * LL Controller.
  542. *
  543. * input parameters
  544. *
  545. * @param None.
  546. *
  547. * output parameters
  548. *
  549. * @param None.
  550. *
  551. * @return LL_STATUS_SUCCESS
  552. */
  553. extern llStatus_t LL_Reset( void );
  554. /*******************************************************************************
  555. * @fn LL_ReadBDADDR API
  556. *
  557. * @brief This API is called by the HCI to read the controller's
  558. * own public device address.
  559. *
  560. * Note: The device's address is stored in NV memory.
  561. *
  562. * input parameters
  563. *
  564. * @param None.
  565. *
  566. * output parameters
  567. *
  568. * @param bdAddr - A pointer to a buffer to hold this device's address.
  569. *
  570. * @return LL_STATUS_SUCCESS
  571. */
  572. extern llStatus_t LL_ReadBDADDR( uint8 *bdAddr );
  573. /*******************************************************************************
  574. *
  575. * @fn LL_SetRandomAddress API
  576. *
  577. * @brief This function is used to save this device's random address. It
  578. * is provided by the Host for devices that are unable to store a
  579. * IEEE assigned public address in NV memory.
  580. *
  581. * input parameters
  582. *
  583. * @param devAddr - Pointer to a random address (LSO..MSO).
  584. *
  585. * output parameters
  586. *
  587. * @param None.
  588. *
  589. * @return LL_STATUS_SUCCESS
  590. *
  591. */
  592. extern llStatus_t LL_SetRandomAddress( uint8 *devAddr );
  593. /*******************************************************************************
  594. * @fn LL_ClearWhiteList API
  595. *
  596. * @brief This API is called by the HCI to clear the White List.
  597. *
  598. * Note: If Scanning is enabled using filtering, and the white
  599. * list policy is "Any", then this command will be
  600. * disallowed.
  601. *
  602. * input parameters
  603. *
  604. * @param None.
  605. *
  606. * output parameters
  607. *
  608. * @param None.
  609. *
  610. * @return LL_STATUS_SUCCESS
  611. */
  612. extern llStatus_t LL_ClearWhiteList( void );
  613. /*******************************************************************************
  614. * @fn LL_AddWhiteListDevice API
  615. *
  616. * @brief This API is called by the HCI to add a device address and its
  617. * type to the White List.
  618. *
  619. * input parameters
  620. *
  621. * @param devAddr - Pointer to a 6 byte device address.
  622. * @param addrType - Public or Random device address.
  623. *
  624. * output parameters
  625. *
  626. * @param None.
  627. *
  628. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  629. * LL_STATUS_ERROR_WL_TABLE_FULL
  630. */
  631. extern llStatus_t LL_AddWhiteListDevice( uint8 *devAddr,
  632. uint8 addrType );
  633. /*******************************************************************************
  634. * @fn LL_RemoveWhiteListDevice API
  635. *
  636. * @brief This API is called by the HCI to remove a device address and
  637. * it's type from the White List.
  638. *
  639. * input parameters
  640. *
  641. * @param devAddr - Pointer to a 6 byte device address.
  642. * @param addrType - Public or Random device address.
  643. *
  644. * output parameters
  645. *
  646. * @param None.
  647. *
  648. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  649. * LL_STATUS_ERROR_WL_TABLE_EMPTY,
  650. * LL_STATUS_ERROR_WL_ENTRY_NOT_FOUND
  651. */
  652. extern llStatus_t LL_RemoveWhiteListDevice( uint8 *devAddr,
  653. uint8 addrType );
  654. /*******************************************************************************
  655. * @fn LL_ReadWlSize API
  656. *
  657. * @brief This API is called by the HCI to get the total number of white
  658. * list entries that can be stored in the Controller.
  659. *
  660. * input parameters
  661. *
  662. * @param None.
  663. *
  664. * output parameters
  665. *
  666. * @param *numEntries - Total number of available White List entries.
  667. *
  668. * @return LL_STATUS_SUCCESS
  669. */
  670. extern llStatus_t LL_ReadWlSize( uint8 *numEntries );
  671. /*******************************************************************************
  672. * @fn LL_NumEmptyWlEntries API
  673. *
  674. * @brief This API is called by the HCI to get the number of White List
  675. * entries that are empty.
  676. *
  677. * input parameters
  678. *
  679. * @param None.
  680. *
  681. * output parameters
  682. *
  683. * @param *numEmptyEntries - number of empty entries in the White List.
  684. *
  685. * @return LL_STATUS_SUCCESS
  686. */
  687. extern llStatus_t LL_NumEmptyWlEntries( uint8 *numEmptyEntries );
  688. /*******************************************************************************
  689. * @fn LL_Encrypt API
  690. *
  691. * @brief This API is called by the HCI to request the LL to encrypt the
  692. * data in the command using the key given in the command.
  693. *
  694. * Note: The parameters are byte ordered MSO to LSO.
  695. *
  696. * input parameters
  697. *
  698. * @param *key - A 128 bit key to be used to calculate the
  699. * session key.
  700. * @param *plaintextData - A 128 bit block that is to be encrypted.
  701. *
  702. * output parameters
  703. *
  704. * @param *encryptedData - A 128 bit block that is encrypted.
  705. *
  706. * @param None.
  707. *
  708. * @return LL_STATUS_SUCCESS
  709. */
  710. extern llStatus_t LL_Encrypt( uint8 *key,
  711. uint8 *plaintextData,
  712. uint8 *encryptedData );
  713. /*******************************************************************************
  714. * @fn LL_Rand API
  715. *
  716. * @brief This API is called by the HCI to request the LL Controller to
  717. * provide a data block with random content.
  718. *
  719. * Note: If the radio is in use, then this operation has to be
  720. * delayed until the radio finishes.
  721. *
  722. * input parameters
  723. *
  724. * @param *randData - Pointer to buffer to place a random block of data.
  725. * @param dataLen - The length of the random data block, from 1-255.
  726. *
  727. * output parameters
  728. *
  729. * @param *randData - Pointer to buffer containing a block of true random
  730. * data.
  731. *
  732. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_DUE_TO_LIMITED_RESOURCES,
  733. * LL_STATUS_ERROR_COMMAND_DISALLOWED,
  734. * LL_STATUS_ERROR_BAD_PARAMETER, LL_STATUS_ERROR_RNG_FAILURE
  735. */
  736. extern llStatus_t LL_Rand( uint8 *randData,
  737. uint8 dataLen );
  738. /*******************************************************************************
  739. * @fn LL_ReadSupportedStates API
  740. *
  741. * @brief This function is used to provide the HCI with the Link Layer
  742. * supported states and supported state/role combinations.
  743. *
  744. * input parameters
  745. *
  746. * @param None.
  747. *
  748. * output parameters
  749. *
  750. * @param *states - Eight byte Bit map of supported states/combos.
  751. *
  752. * @return LL_STATUS_SUCCESS
  753. */
  754. extern llStatus_t LL_ReadSupportedStates( uint8 *states );
  755. /*******************************************************************************
  756. * @fn LL_ReadLocalSupportedFeatures API
  757. *
  758. * @brief This API is called by the HCI to read the controller's
  759. * Features Set. The Controller indicates which features it
  760. * supports.
  761. *
  762. * input parameters
  763. *
  764. * @param featureSet - A pointer to the Feature Set where each bit:
  765. * 0: Feature not supported.
  766. * 1: Feature supported by controller.
  767. *
  768. * output parameters
  769. *
  770. * @param None.
  771. *
  772. * @return LL_STATUS_SUCCESS
  773. */
  774. extern llStatus_t LL_ReadLocalSupportedFeatures( uint8 *featureSet );
  775. /*******************************************************************************
  776. * @fn LL_ReadLocalVersionInfo API
  777. *
  778. * @brief This API is called by the HCI to read the controller's
  779. * Version information.
  780. *
  781. * input parameters
  782. *
  783. * @param None.
  784. *
  785. * output parameters
  786. *
  787. * @param verNum - Version of the Bluetooth Controller specification.
  788. * @param comId - Company identifier of the manufacturer of the
  789. * Bluetooth Controller.
  790. * @param subverNum - A unique value for each implementation or revision
  791. * of an implementation of the Bluetooth Controller.
  792. *
  793. * @return LL_STATUS_SUCCESS
  794. */
  795. extern llStatus_t LL_ReadLocalVersionInfo( uint8 *verNum,
  796. uint16 *comId,
  797. uint16 *subverNum );
  798. /*******************************************************************************
  799. * @fn LL_CtrlToHostFlowControl API
  800. *
  801. * @brief This function is used to indicate if the LL enable/disable
  802. * receive FIFO processing. This function provides support for
  803. * Controller to Host flow control.
  804. *
  805. * input parameters
  806. *
  807. * @param mode: LL_ENABLE_RX_FLOW_CONTROL, LL_DISABLE_RX_FLOW_CONTROL
  808. *
  809. * output parameters
  810. *
  811. * @param None.
  812. *
  813. * @return LL_STATUS_SUCCESS
  814. */
  815. extern llStatus_t LL_CtrlToHostFlowControl( uint8 mode );
  816. /*******************************************************************************
  817. * @fn LL_ReadRemoteVersionInfo API
  818. *
  819. * @brief This API is called by the HCI to read the peer controller's
  820. * Version Information. If the peer's Version Information has
  821. * already been received by its request for our Version
  822. * Information, then this data is already cached and can be
  823. * directly returned to the Host. If the peer's Version Information
  824. * is not already cached, then it will be requested from the peer,
  825. * and when received, returned to the Host via the
  826. * LL_ReadRemoteVersionInfoCback callback.
  827. *
  828. * Note: Only one Version Indication is allowed for a connection.
  829. *
  830. * input parameters
  831. *
  832. * @param None.
  833. *
  834. * output parameters
  835. *
  836. * @param connId - The LL connection ID on which to send this data.
  837. *
  838. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_VER_IND_ALREADY_SENT
  839. */
  840. extern llStatus_t LL_ReadRemoteVersionInfo( uint16 connId );
  841. /*******************************************************************************
  842. * @fn LL_ReadTxPowerLevel
  843. *
  844. * @brief This function is used to read a connection's current transmit
  845. * power level or the maximum transmit power level.
  846. *
  847. * input parameters
  848. *
  849. * @param connId - The LL connection handle.
  850. * @param type - LL_READ_CURRENT_TX_POWER_LEVEL or
  851. * LL_READ_MAX_TX_POWER_LEVEL
  852. * @param *txPower - A signed value from -30..+20, in dBm.
  853. *
  854. * output parameters
  855. *
  856. * @param None.
  857. *
  858. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  859. * LL_STATUS_ERROR_PARAM_OUT_OF_RANGE,
  860. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  861. */
  862. llStatus_t LL_ReadTxPowerLevel( uint8 connId,
  863. uint8 type,
  864. int8 *txPower );
  865. // A1 ROM metal change add
  866. /*******************************************************************************
  867. * @fn LL_SetTxPowerLevel
  868. *
  869. * @brief This function is used to set transmit power level
  870. *
  871. * input parameters
  872. *
  873. * @param txPower - The transmit power level to be set
  874. *
  875. * output parameters
  876. *
  877. * @param None.
  878. *
  879. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  880. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  881. */
  882. llStatus_t LL_SetTxPowerLevel( int8 txPower );
  883. /*******************************************************************************
  884. * @fn LL_ReadChanMap API
  885. *
  886. * @brief This API is called by the HCI to read the channel map that the
  887. * LL controller is using for the LL connection.
  888. *
  889. * input parameters
  890. *
  891. * @param connId - The LL connection handle.
  892. *
  893. * output parameters
  894. *
  895. * @param chanMap - A five byte array containing one bit per data channel
  896. * where a 1 means the channel is "used" and a 0 means
  897. * the channel is "unused".
  898. *
  899. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  900. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  901. */
  902. extern llStatus_t LL_ReadChanMap( uint8 connId,
  903. uint8 *chanMap );
  904. /*******************************************************************************
  905. * @fn LL_ReadRssi API
  906. *
  907. * @brief This API is called by the HCI to request RSSI. If there is an
  908. * active connection for the given connection ID, then the RSSI of
  909. * the last received data packet in the LL will be returned. If a
  910. * receiver Modem Test is running, then the RF RSSI for the last
  911. * received data will be returned. If no valid RSSI value is
  912. * available, then LL_RSSI_NOT_AVAILABLE will be returned.
  913. *
  914. * input parameters
  915. *
  916. * @param connId - The LL connection ID on which to read last RSSI.
  917. *
  918. * output parameters
  919. *
  920. * @param *lastRssi - The last data RSSI received.
  921. * Range: -127dBm..+20dBm, 127=Not Available.
  922. *
  923. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  924. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  925. */
  926. extern llStatus_t LL_ReadRssi( uint16 connId,
  927. int8 *lastRssi );
  928. extern llStatus_t LL_ReadFoff( uint16 connId,
  929. uint16 *foff );
  930. extern llStatus_t LL_ReadCarrSens( uint16 connId,
  931. uint8 *carrSense );
  932. /*******************************************************************************
  933. * @fn LL_Disconnect API
  934. *
  935. * @brief This API is called by the HCI to terminate a LL connection.
  936. *
  937. * input parameters
  938. *
  939. * @param connId - The LL connection ID on which to send this data.
  940. * @param reason - The reason for the Host connection termination.
  941. *
  942. * output parameters
  943. *
  944. * @param None.
  945. *
  946. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  947. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  948. * LL_STATUS_ERROR_CTRL_PROC_ALREADY_ACTIVE
  949. */
  950. extern llStatus_t LL_Disconnect( uint16 connId,
  951. uint8 reason );
  952. /*******************************************************************************
  953. * @fn LL_TxData API
  954. *
  955. * @brief This API is called by the HCI to transmit a buffer of data on a
  956. * given LL connection. If fragmentation is supported, the HCI must
  957. * also indicate whether this is the first Host packet, or a
  958. * continuation Host packet. When fragmentation is not supported,
  959. * then a start packet should always specified. If the device is in
  960. * a connection as a Master and the current connection ID is the
  961. * connection for this data, or is in a connection as a Slave, then
  962. * the data is written to the TX FIFO (even if the radio is
  963. * curerntly active). If this is a Slave connection, and Fast TX is
  964. * enabled and Slave Latency is being used, then the amount of time
  965. * to the next event is checked. If there's at least a connection
  966. * interval plus some overhead, then the next event is re-aligned
  967. * to the next event boundary. Otherwise, in all cases, the buffer
  968. * pointer will be retained for transmission, and the callback
  969. * event LL_TxDataCompleteCback will be generated to the HCI when
  970. * the buffer pointer is no longer needed by the LL.
  971. *
  972. * Note: If the return status is LL_STATUS_ERROR_OUT_OF_TX_MEM,
  973. * then the HCI must not release the buffer until it receives
  974. * the LL_TxDataCompleteCback callback, which indicates the
  975. * LL has copied the transmit buffer.
  976. *
  977. * Note: The HCI should not call this routine if a buffer is still
  978. * pending from a previous call. This is fatal!
  979. *
  980. * Note: If the connection should be terminated within the LL
  981. * before the Host knows, attempts by the HCI to send more
  982. * data (after receiving a LL_TxDataCompleteCback) will
  983. * fail (LL_STATUS_ERROR_INACTIVE_CONNECTION).
  984. *
  985. * input parameters
  986. *
  987. * @param connId - The LL connection ID on which to send this data.
  988. * @param *pBuf - A pointer to the data buffer to transmit.
  989. * @param pktLen - The number of bytes to transmit on this connection.
  990. * @param fragFlag - LL_DATA_FIRST_PKT_HOST_TO_CTRL:
  991. * Indicates buffer is the start of a
  992. * Host-to-Controller packet.
  993. * LL_DATA_CONTINUATION_PKT:
  994. * Indicates buffer is a continuation of a
  995. * Host-to-Controller packet.
  996. *
  997. * output parameters
  998. *
  999. * @param None.
  1000. *
  1001. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1002. * LL_STATUS_ERROR_INACTIVE_CONNECTION,
  1003. * LL_STATUS_ERROR_OUT_OF_TX_MEM,
  1004. * LL_STATUS_ERROR_UNEXPECTED_PARAMETER
  1005. */
  1006. extern llStatus_t LL_TxData( uint16 connId,
  1007. uint8 *pBuf,
  1008. uint8 pktLen,
  1009. uint8 fragFlag );
  1010. /*******************************************************************************
  1011. * @fn LL_DirectTestTxTest API
  1012. *
  1013. * @brief This function is used to initiate a BLE PHY level Transmit Test
  1014. * in Direct Test Mode where the DUT generates test reference
  1015. * packets at fixed intervals. This test will make use of the
  1016. * nanoRisc Raw Data Transmit and Receive task.
  1017. *
  1018. * Note: The BLE device is to transmit at maximum power.
  1019. * Note: A LL reset should be issued when done using DTM!
  1020. *
  1021. * input parameters
  1022. *
  1023. * @param txFreq - Tx RF frequency k=0..39, where F=2402+(k*2MHz).
  1024. * @param payloadLen - Number of bytes (0..37)in payload for each packet.
  1025. * @param payloadType - The type of pattern to transmit.
  1026. *
  1027. * output parameters
  1028. *
  1029. * @param None.
  1030. *
  1031. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1032. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1033. */
  1034. extern llStatus_t LL_DirectTestTxTest( uint8 txFreq,
  1035. uint8 payloadLen,
  1036. uint8 payloadType );
  1037. /*******************************************************************************
  1038. * @fn LL_DirectTestRxTest API
  1039. *
  1040. * @brief This function is used to initiate a BLE PHY level Receive Test
  1041. * in Direct Test Mode where the DUT receives test reference
  1042. * packets at fixed intervals. This test will make use of the
  1043. * nanoRisc Raw Data Transmit and Receive task. The received
  1044. * packets are verified based on the CRC, and metrics are kept.
  1045. *
  1046. * Note: A LL reset should be issued when done using DTM!
  1047. *
  1048. * input parameters
  1049. *
  1050. * @param rxFreq - Rx RF frequency k=0..39, where F=2402+(k*2MHz).
  1051. *
  1052. * output parameters
  1053. *
  1054. * @param None.
  1055. *
  1056. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1057. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1058. */
  1059. extern llStatus_t LL_DirectTestRxTest( uint8 rxFreq );
  1060. /*******************************************************************************
  1061. * @fn LL_DirectTestEnd API
  1062. *
  1063. * @brief This function is used to end the Direct Test Transmit or Direct
  1064. * Test Receive tests executing in Direct Test mode. When the raw
  1065. * task is ended, the LL_DirectTestEndDoneCback callback is called.
  1066. * If a Direct Test mode operation is not currently active, an
  1067. * error is returned.
  1068. *
  1069. * Note: A LL reset is issued upon completion!
  1070. *
  1071. * input parameters
  1072. *
  1073. * @param None.
  1074. *
  1075. * output parameters
  1076. *
  1077. * @param None.
  1078. *
  1079. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1080. */
  1081. extern llStatus_t LL_DirectTestEnd( void );
  1082. /*******************************************************************************
  1083. * @fn LL_SetAdvParam API
  1084. *
  1085. * @brief This API is called by the HCI to set the Advertiser's
  1086. * parameters.
  1087. *
  1088. * input parameters
  1089. * @param advIntervalMin - The minimum Adv interval.
  1090. * @param advIntervalMax - The maximum Adv interval.
  1091. * @param advEvtType - The type of advertisment event.
  1092. * @param ownAddrType - The Adv's address type of public or random.
  1093. * @param directAddrType - Only used for directed advertising.
  1094. * @param *directAddr - Only used for directed advertising (NULL otherwise).
  1095. * @param advChanMap - A byte containing 1 bit per advertising
  1096. * channel. A bit set to 1 means the channel is
  1097. * used. The bit positions define the advertising
  1098. * channels as follows:
  1099. * Bit 0: 37, Bit 1: 38, Bit 2: 39.
  1100. * @param advWlPolicy - The Adv white list filter policy.
  1101. *
  1102. * output parameters
  1103. *
  1104. * @param None.
  1105. *
  1106. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1107. * LL_STATUS_ERROR_NO_ADV_CHAN_FOUND
  1108. */
  1109. extern llStatus_t LL_SetAdvParam( uint16 advIntervalMin,
  1110. uint16 advIntervalMax,
  1111. uint8 advEvtType,
  1112. uint8 ownAddrType,
  1113. uint8 directAddrType,
  1114. uint8 *directAddr,
  1115. uint8 advChanMap,
  1116. uint8 advWlPolicy );
  1117. /*******************************************************************************
  1118. * @fn LL_SetAdvData API
  1119. *
  1120. * @brief This API is called by the HCI to set the Advertiser's data.
  1121. *
  1122. * Note: If the Advertiser is restarted without intervening calls
  1123. * to this routine to make updates, then the previously
  1124. * defined data will be reused.
  1125. *
  1126. * Note: If the data happens to be changed while advertising, then
  1127. * the new data will be sent on the next advertising event.
  1128. *
  1129. * input parameters
  1130. *
  1131. * @param advDataLen - The number of scan response bytes: 0..31.
  1132. * @param advData - Pointer to the advertiser data, or NULL.
  1133. *
  1134. * output parameters
  1135. *
  1136. * @param None.
  1137. *
  1138. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1139. */
  1140. extern llStatus_t LL_SetAdvData( uint8 advDataLen,
  1141. uint8 *advData );
  1142. /*******************************************************************************
  1143. * @fn LL_SetScanRspData API
  1144. *
  1145. * @brief This API is called by the HCI to set the Advertiser's Scan
  1146. * Response data.
  1147. *
  1148. * Note: If the Advertiser is restarted without intervening calls
  1149. * to this routine to make updates, then the previously
  1150. * defined data will be reused.
  1151. *
  1152. * input parameters
  1153. *
  1154. * @param scanRspLen - The number of scan response bytes: 0..31.
  1155. * @param *scanRspData - Pointer to the scan response data.
  1156. *
  1157. * output parameters
  1158. *
  1159. * @param None.
  1160. *
  1161. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1162. */
  1163. extern llStatus_t LL_SetScanRspData( uint8 scanRspLen,
  1164. uint8 *scanRspData );
  1165. /*******************************************************************************
  1166. * @fn LL_SetAdvControl API
  1167. *
  1168. * @brief This API is called by the HCI to request the Controller to start
  1169. * or stop advertising.
  1170. *
  1171. * input parameters
  1172. *
  1173. * @param advMode - LL_ADV_MODE_ON or LL_ADV_MODE_OFF.
  1174. *
  1175. * output parameters
  1176. *
  1177. * @param None.
  1178. *
  1179. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_UNEXPECTED_PARAMETER,
  1180. * LL_STATUS_ERROR_BAD_PARAMETER,
  1181. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE,
  1182. * LL_STATUS_ERROR_COMMAND_DISALLOWED
  1183. */
  1184. extern llStatus_t LL_SetAdvControl( uint8 advMode );
  1185. /*******************************************************************************
  1186. * @fn LL_ReadAdvChanTxPower
  1187. *
  1188. * @brief This function is used to read the transmit power level used
  1189. * for BLE advertising channel packets. Currently, only two
  1190. * settings are possible, a standard setting of 0 dBm, and a
  1191. * maximum setting of 4 dBm.
  1192. *
  1193. * input parameters
  1194. *
  1195. * @param *txPower - A non-null pointer.
  1196. *
  1197. * output parameters
  1198. *
  1199. * @param *txPower - A signed value from -20..+10, in dBm.
  1200. *
  1201. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_PARAM_OUT_OF_RANGE
  1202. */
  1203. extern llStatus_t LL_ReadAdvChanTxPower( int8 *txPower );
  1204. /*******************************************************************************
  1205. * @fn LL_SetScanParam API
  1206. *
  1207. * @brief This API is called by the HCI to set the Scanner's parameters.
  1208. *
  1209. * input parameters
  1210. *
  1211. * @param scanType - Passive or Active scan type.
  1212. * @param scanInterval - Time between scan events.
  1213. * @param scanWindow - Duration of a scan. When the same as the scan
  1214. * interval, then scan continuously.
  1215. * @param ownAddrType - Address type (Public or Random) to use in the
  1216. * SCAN_REQ packet.
  1217. * @param advWlPolicy - Either allow all Adv packets, or only those that
  1218. * are in the white list.
  1219. *
  1220. * output parameters
  1221. *
  1222. * @param None.
  1223. *
  1224. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1225. */
  1226. extern llStatus_t LL_SetScanParam( uint8 scanType,
  1227. uint16 scanInterval,
  1228. uint16 scanWindow,
  1229. uint8 ownAddrType,
  1230. uint8 advWlPolicy );
  1231. /*******************************************************************************
  1232. * @fn LL_SetScanControl API
  1233. *
  1234. * @brief This API is called by the HCI to start or stop the Scanner. It
  1235. * also specifies whether the LL will filter duplicate advertising
  1236. * reports to the Host, or generate a report for each packet
  1237. * received.
  1238. *
  1239. * input parameters
  1240. *
  1241. * @param scanMode - LL_SCAN_START or LL_SCAN_STOP.
  1242. * @param filterReports - LL_FILTER_REPORTS_DISABLE or
  1243. * LL_FILTER_REPORTS_ENABLE
  1244. *
  1245. * output parameters
  1246. *
  1247. * @param None.
  1248. *
  1249. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1250. * LL_STATUS_ERROR_UNEXPECTED_PARAMETER,
  1251. * LL_STATUS_ERROR_OUT_OF_TX_MEM,
  1252. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1253. */
  1254. extern llStatus_t LL_SetScanControl( uint8 scanMode,
  1255. uint8 filterReports );
  1256. /*******************************************************************************
  1257. * @fn LL_EncLtkReply API
  1258. *
  1259. * @brief This API is called by the HCI to provide the controller with
  1260. * the Long Term Key (LTK) for encryption. This command is
  1261. * actually a reply to the link layer's LL_EncLtkReqCback, which
  1262. * provided the random number and encryption diversifier received
  1263. * from the Master during an encryption setup.
  1264. *
  1265. * Note: The key parameter is byte ordered LSO to MSO.
  1266. *
  1267. * input parameters
  1268. *
  1269. * @param connId - The LL connection ID on which to send this data.
  1270. * @param *key - A 128 bit key to be used to calculate the session key.
  1271. *
  1272. * output parameters
  1273. *
  1274. * @param None.
  1275. *
  1276. * @return LL_STATUS_SUCCESS
  1277. */
  1278. extern llStatus_t LL_EncLtkReply( uint16 connId,
  1279. uint8 *key );
  1280. /*******************************************************************************
  1281. * @fn LL_EncLtkNegReply API
  1282. *
  1283. * @brief This API is called by the HCI to indicate to the controller
  1284. * that the Long Term Key (LTK) for encryption can not be provided.
  1285. * This command is actually a reply to the link layer's
  1286. * LL_EncLtkReqCback, which provided the random number and
  1287. * encryption diversifier received from the Master during an
  1288. * encryption setup. How the LL responds to the negative reply
  1289. * depends on whether this is part of a start encryption or a
  1290. * re-start encryption after a pause. For the former, an
  1291. * encryption request rejection is sent to the peer device. For
  1292. * the latter, the connection is terminated.
  1293. *
  1294. * input parameters
  1295. *
  1296. * @param connId - The LL connection ID on which to send this data.
  1297. *
  1298. * output parameters
  1299. *
  1300. * @param None.
  1301. *
  1302. * @return LL_STATUS_SUCCESS
  1303. */
  1304. extern llStatus_t LL_EncLtkNegReply( uint16 connId );
  1305. /*******************************************************************************
  1306. * @fn LL_CreateConn API
  1307. *
  1308. * @brief This API is called by the HCI to create a connection.
  1309. *
  1310. * input parameters
  1311. *
  1312. * @param scanInterval - The scan interval.
  1313. * @param scanWindow - The scan window.
  1314. * @param initWlPolicy - Filter Adv address directly or using WL.
  1315. * @param peerAddrType - Peer address is Public or Random.
  1316. * @param *peerAddr - The Adv address, or NULL for WL policy.
  1317. * @param ownAddrType - This device's address is Public or Random.
  1318. * @param connIntervalMin - Defines minimum connection interval value.
  1319. * @param connIntervalMax - Defines maximum connection interval value.
  1320. * @param connLatency - The connection's Slave Latency.
  1321. * @param connTimeout - The connection's Supervision Timeout.
  1322. * @param minLength - Info parameter about min length of connection.
  1323. * @param maxLength - Info parameter about max length of connection.
  1324. *
  1325. * output parameters
  1326. *
  1327. * @param None.
  1328. *
  1329. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE,
  1330. * LL_STATUS_ERROR_ILLEGAL_PARAM_COMBINATION,
  1331. * LL_STATUS_ERROR_BAD_PARAMETER
  1332. */
  1333. extern llStatus_t LL_CreateConn( uint16 scanInterval,
  1334. uint16 scanWindow,
  1335. uint8 initWlPolicy,
  1336. uint8 peerAddrType,
  1337. uint8 *peerAddr,
  1338. uint8 ownAddrType,
  1339. uint16 connIntervalMin,
  1340. uint16 connIntervalMax,
  1341. uint16 connLatency,
  1342. uint16 connTimeout,
  1343. uint16 minLength,
  1344. uint16 maxLength );
  1345. /*******************************************************************************
  1346. * @fn LL_CreateConnCancel API
  1347. *
  1348. * @brief This API is called by the HCI to cancel a previously given LL
  1349. * connection creation command that is still pending. This command
  1350. * should only be used after the LL_CreateConn command as been
  1351. * issued, but before the LL_ConnComplete callback.
  1352. *
  1353. * input parameters
  1354. *
  1355. * @param None.
  1356. *
  1357. * output parameters
  1358. *
  1359. * @param None.
  1360. *
  1361. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED
  1362. */
  1363. extern llStatus_t LL_CreateConnCancel( void );
  1364. /*******************************************************************************
  1365. * @fn LL_ConnActive
  1366. *
  1367. * @brief This API is called by the HCI to check if a connection
  1368. * given by the connection handle is active.
  1369. *
  1370. * input parameters
  1371. *
  1372. * @param connId - Connection handle.
  1373. *
  1374. * output parameters
  1375. *
  1376. * @param None.
  1377. *
  1378. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1379. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  1380. */
  1381. extern llStatus_t LL_ConnActive( uint16 connId );
  1382. /*******************************************************************************
  1383. * @fn LL_ConnUpdate API
  1384. *
  1385. * @brief This API is called by the HCI to update the connection
  1386. * parameters by initiating a connection update control procedure.
  1387. *
  1388. * input parameters
  1389. *
  1390. * @param connId - The connection ID on which to send this data.
  1391. * @param connIntervalMin - Defines minimum connection interval value.
  1392. * @param connIntervalMax - Defines maximum connection interval value.
  1393. * @param connLatency - The connection's Slave Latency.
  1394. * @param connTimeout - The connection's Supervision Timeout.
  1395. * @param minLength - Info parameter about min length of connection.
  1396. * @param maxLength - Info parameter about max length of connection.
  1397. *
  1398. * output parameters
  1399. *
  1400. * @param None.
  1401. *
  1402. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1403. * LL_STATUS_ERROR_INACTIVE_CONNECTION
  1404. * LL_STATUS_ERROR_CTRL_PROC_ALREADY_ACTIVE,
  1405. * LL_STATUS_ERROR_ILLEGAL_PARAM_COMBINATION
  1406. */
  1407. extern llStatus_t LL_ConnUpdate( uint16 connId,
  1408. uint16 connIntervalMin,
  1409. uint16 connIntervalMax,
  1410. uint16 connLatency,
  1411. uint16 connTimeout,
  1412. uint16 minLength,
  1413. uint16 maxLength );
  1414. /*******************************************************************************
  1415. * @fn LL_ChanMapUpdate API
  1416. *
  1417. * @brief This API is called by the HCI to update the Host data channels
  1418. * initiating an Update Data Channel control procedure.
  1419. *
  1420. * Note: While it isn't specified, it is assumed that the Host
  1421. * expects an update channel map on all active connections.
  1422. *
  1423. * Note: This LL currently only supports one connection.
  1424. *
  1425. * input parameters
  1426. *
  1427. * @param chanMap - A five byte array containing one bit per data channel
  1428. * where a 1 means the channel is "used".
  1429. *
  1430. * output parameters
  1431. *
  1432. * @param None.
  1433. *
  1434. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1435. * LL_STATUS_ERROR_ILLEGAL_PARAM_COMBINATION
  1436. */
  1437. extern llStatus_t LL_ChanMapUpdate( uint8 *chanMap );
  1438. /*******************************************************************************
  1439. * @fn LL_StartEncrypt API
  1440. *
  1441. * @brief This API is called by the Master HCI to setup encryption and to
  1442. * update encryption keys in the LL connection. If the connection
  1443. * is already in encryption mode, then this command will first
  1444. * pause the encryption before subsequently running the encryption
  1445. * setup.
  1446. *
  1447. * Note: The parameters are byte ordered LSO to MSO.
  1448. *
  1449. * input parameters
  1450. *
  1451. * @param connId - The LL connection ID on which to send this data.
  1452. * @param *rand - Random vector used in device identification.
  1453. * @param *eDiv - Encrypted diversifier.
  1454. * @param *key - A 128 bit key to be used to calculate the session key.
  1455. *
  1456. * output parameters
  1457. *
  1458. * @param None.
  1459. *
  1460. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_FEATURE_NOT_SUPPORTED
  1461. */
  1462. extern llStatus_t LL_StartEncrypt( uint16 connId,
  1463. uint8 *rand,
  1464. uint8 *eDiv,
  1465. uint8 *ltk );
  1466. /*******************************************************************************
  1467. * @fn LL_ReadRemoteUsedFeatures API
  1468. *
  1469. * @brief This API is called by the Master HCI to initiate a feature
  1470. * setup control process.
  1471. *
  1472. * input parameters
  1473. *
  1474. * @param connId - The LL connection ID on which to send this data.
  1475. *
  1476. * output parameters
  1477. *
  1478. * @param None.
  1479. *
  1480. * @return LL_STATUS_SUCCESS
  1481. */
  1482. extern llStatus_t LL_ReadRemoteUsedFeatures( uint16 connId );
  1483. /*
  1484. ** Vendor Specific Command API
  1485. */
  1486. /*******************************************************************************
  1487. * @fn LL_EXT_SetRxGain Vendor Specific API
  1488. *
  1489. * @brief This function is used to to set the RF RX gain.
  1490. *
  1491. * input parameters
  1492. *
  1493. * @param rxGain - LL_EXT_RX_GAIN_STD, LL_EXT_RX_GAIN_HIGH
  1494. *
  1495. * output parameters
  1496. *
  1497. * @param cmdComplete - Boolean to indicate the command is still pending.
  1498. *
  1499. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1500. */
  1501. extern llStatus_t LL_EXT_SetRxGain( uint8 rxGain,
  1502. uint8 *cmdComplete );
  1503. /*******************************************************************************
  1504. * @fn LL_EXT_SetTxPower Vendor Specific API
  1505. *
  1506. * @brief This function is used to to set the RF TX power.
  1507. *
  1508. * input parameters
  1509. *
  1510. * @param txPower - LL_EXT_TX_POWER_0_DBM, LL_EXT_TX_POWER_4_DBM
  1511. *
  1512. * output parameters
  1513. *
  1514. * @param cmdComplete - Boolean to indicate the command is still pending.
  1515. *
  1516. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1517. */
  1518. extern llStatus_t LL_EXT_SetTxPower( uint8 txPower,
  1519. uint8 *cmdComplete );
  1520. /*******************************************************************************
  1521. * @fn LL_EXT_OnePacketPerEvent Vendor Specific API
  1522. *
  1523. * @brief This function is used to enable or disable allowing only one
  1524. * packet per event.
  1525. *
  1526. * input parameters
  1527. *
  1528. * @param control - LL_EXT_ENABLE_ONE_PKT_PER_EVT,
  1529. * LL_EXT_DISABLE_ONE_PKT_PER_EVT
  1530. *
  1531. * output parameters
  1532. *
  1533. * @param None.
  1534. *
  1535. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1536. */
  1537. extern llStatus_t LL_EXT_OnePacketPerEvent( uint8 control );
  1538. /*******************************************************************************
  1539. * @fn LL_EXT_ClkDivOnHalt Vendor Specific API
  1540. *
  1541. * @brief This function is used to enable or disable dividing down the
  1542. * system clock while halted.
  1543. *
  1544. * Note: This command is disallowed if haltDuringRf is not defined.
  1545. *
  1546. * input parameters
  1547. *
  1548. * @param control - LL_EXT_ENABLE_CLK_DIVIDE_ON_HALT,
  1549. * LL_EXT_DISABLE_CLK_DIVIDE_ON_HALT
  1550. *
  1551. * output parameters
  1552. *
  1553. * @param None.
  1554. *
  1555. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED
  1556. */
  1557. extern llStatus_t LL_EXT_ClkDivOnHalt( uint8 control );
  1558. /*******************************************************************************
  1559. * @fn LL_EXT_DeclareNvUsage Vendor Specific API
  1560. *
  1561. * @brief This HCI Extension API is used to indicate to the Controller
  1562. * whether or not the Host will be using the NV memory during BLE
  1563. * operations.
  1564. *
  1565. * input parameters
  1566. *
  1567. * @param mode - HCI_EXT_NV_IN_USE, HCI_EXT_NV_NOT_IN_USE
  1568. *
  1569. * output parameters
  1570. *
  1571. * @param None.
  1572. *
  1573. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1574. * LL_STATUS_ERROR_COMMAND_DISALLOWED
  1575. */
  1576. extern llStatus_t LL_EXT_DeclareNvUsage( uint8 mode );
  1577. /*******************************************************************************
  1578. * @fn LL_EXT_Decrypt API
  1579. *
  1580. * @brief This API is called by the HCI to request the LL to decrypt the
  1581. * data in the command using the key given in the command.
  1582. *
  1583. * Note: The parameters are byte ordered MSO to LSO.
  1584. *
  1585. * input parameters
  1586. *
  1587. * @param *key - A 128 bit key to be used to calculate the
  1588. * session key.
  1589. * @param *encryptedData - A 128 bit block that is encrypted.
  1590. *
  1591. * output parameters
  1592. *
  1593. * @param *plaintextData - A 128 bit block that is to be encrypted.
  1594. *
  1595. * @param None.
  1596. *
  1597. * @return LL_STATUS_SUCCESS
  1598. */
  1599. extern llStatus_t LL_EXT_Decrypt( uint8 *key,
  1600. uint8 *encryptedData,
  1601. uint8 *plaintextData );
  1602. /*******************************************************************************
  1603. * @fn LL_EXT_SetLocalSupportedFeatures API
  1604. *
  1605. * @brief This API is called by the HCI to indicate to the Controller
  1606. * which features can or can not be used.
  1607. *
  1608. * Note: Not all features indicated by the Host to the Controller
  1609. * are valid. If invalid, they shall be ignored.
  1610. *
  1611. * input parameters
  1612. *
  1613. * @param featureSet - A pointer to the Feature Set where each bit:
  1614. * 0: Feature shall not be used.
  1615. * 1: Feature can be used.
  1616. *
  1617. * output parameters
  1618. *
  1619. * @param None.
  1620. *
  1621. * @return LL_STATUS_SUCCESS
  1622. */
  1623. extern llStatus_t LL_EXT_SetLocalSupportedFeatures( uint8 *featureSet );
  1624. /*******************************************************************************
  1625. * @fn LL_EXT_SetFastTxResponseTime API
  1626. *
  1627. * @brief This API is used to enable or disable the fast TX response
  1628. * time feature. This can be helpful when a short connection
  1629. * interval is used in combination with slave latency. In such
  1630. * a scenario, the response time for sending the TX data packet
  1631. * can effectively shorten or eliminate slave latency, thereby
  1632. * increasing power consumption. By disabling, this feature
  1633. * trades fast response time for less power consumption.
  1634. *
  1635. * input parameters
  1636. *
  1637. * @param control - LL_EXT_ENABLE_FAST_TX_RESP_TIME,
  1638. * LL_EXT_DISABLE_FAST_TX_RESP_TIME
  1639. *
  1640. * output parameters
  1641. *
  1642. * @param None.
  1643. *
  1644. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED,
  1645. * LL_STATUS_ERROR_BAD_PARAMETER
  1646. */
  1647. extern llStatus_t LL_EXT_SetFastTxResponseTime( uint8 control );
  1648. /*******************************************************************************
  1649. * @fn LL_EXT_SetSlaveLatencyOverride API
  1650. *
  1651. * @brief This API is used to enable or disable the suspention of slave
  1652. * latency. This can be helpful when the Slave application knows
  1653. * it will soon receive something that needs to be handled without
  1654. * delay.
  1655. *
  1656. * input parameters
  1657. *
  1658. * @param control - LL_EXT_DISABLE_SL_OVERRIDE,
  1659. * LL_EXT_ENABLE_SL_OVERRIDE
  1660. *
  1661. * output parameters
  1662. *
  1663. * @param None.
  1664. *
  1665. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED,
  1666. * LL_STATUS_ERROR_BAD_PARAMETER
  1667. */
  1668. extern llStatus_t LL_EXT_SetSlaveLatencyOverride( uint8 control );
  1669. /*******************************************************************************
  1670. * @fn LL_EXT_ModemTestTx
  1671. *
  1672. * @brief This API is used start a continuous transmitter modem test,
  1673. * using either a modulated or unmodulated carrier wave tone, at
  1674. * the frequency that corresponds to the specified RF channel. Use
  1675. * LL_EXT_EndModemTest command to end the test.
  1676. *
  1677. * Note: A LL reset will be issued by LL_EXT_EndModemTest!
  1678. * Note: The BLE device will transmit at maximum power.
  1679. * Note: This API can be used to verify this device meets Japan's
  1680. * TELEC regulations.
  1681. *
  1682. * input parameters
  1683. *
  1684. * @param cwMode - LL_EXT_TX_MODULATED_CARRIER,
  1685. * LL_EXT_TX_UNMODULATED_CARRIER
  1686. * txFreq - Transmit RF channel k=0..39, where BLE F=2402+(k*2MHz).
  1687. *
  1688. * output parameters
  1689. *
  1690. * @param None.
  1691. *
  1692. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1693. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1694. */
  1695. extern llStatus_t LL_EXT_ModemTestTx( uint8 cwMode,
  1696. uint8 txFreq );
  1697. /*******************************************************************************
  1698. * @fn LL_EXT_ModemHopTestTx
  1699. *
  1700. * @brief This API is used to start a continuous transmitter direct test
  1701. * mode test using a modulated carrier wave and transmitting a
  1702. * 37 byte packet of Pseudo-Random 9-bit data. A packet is
  1703. * transmitted on a different frequency (linearly stepping through
  1704. * all RF channels 0..39) every 625us. Use LL_EXT_EndModemTest
  1705. * command to end the test.
  1706. *
  1707. * Note: A LL reset will be issued by LL_EXT_EndModemTest!
  1708. * Note: The BLE device will transmit at maximum power.
  1709. * Note: This API can be used to verify this device meets Japan's
  1710. * TELEC regulations.
  1711. *
  1712. * input parameters
  1713. *
  1714. * @param None.
  1715. *
  1716. * output parameters
  1717. *
  1718. * @param None.
  1719. *
  1720. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1721. */
  1722. extern llStatus_t LL_EXT_ModemHopTestTx( void );
  1723. /*******************************************************************************
  1724. * @fn LL_EXT_ModemTestRx
  1725. *
  1726. * @brief This API is used to start a continuous receiver modem test
  1727. * using a modulated carrier wave tone, at the frequency that
  1728. * corresponds to the specific RF channel. Any received data is
  1729. * discarded. Receiver gain may be adjusted using the
  1730. * LL_EXT_SetRxGain command. RSSI may be read during this test by
  1731. * using the LL_ReadRssi command. Use LL_EXT_EndModemTest command
  1732. * to end the test.
  1733. *
  1734. * Note: A LL reset will be issued by LL_EXT_EndModemTest!
  1735. * Note: The BLE device will transmit at maximum power.
  1736. *
  1737. * input parameters
  1738. *
  1739. * @param rxFreq - Receiver RF channel k=0..39, where BLE F=2402+(k*2MHz).
  1740. *
  1741. * output parameters
  1742. *
  1743. * @param None.
  1744. *
  1745. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1746. * LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1747. */
  1748. extern llStatus_t LL_EXT_ModemTestRx( uint8 rxFreq );
  1749. /*******************************************************************************
  1750. * @fn LL_EXT_EndModemTest
  1751. *
  1752. * @brief This API is used to shutdown a modem test. A complete link
  1753. * layer reset will take place.
  1754. *
  1755. * input parameters
  1756. *
  1757. * @param None.
  1758. *
  1759. * output parameters
  1760. *
  1761. * @param None.
  1762. *
  1763. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_UNEXPECTED_STATE_ROLE
  1764. */
  1765. extern llStatus_t LL_EXT_EndModemTest( void );
  1766. /*******************************************************************************
  1767. * @fn LL_EXT_SetBDADDR
  1768. *
  1769. * @brief This API is used to set this device's BLE address (BDADDR).
  1770. *
  1771. * Note: This command is only allowed when the device's state is
  1772. * Standby.
  1773. *
  1774. * input parameters
  1775. *
  1776. * @param bdAddr - A pointer to a buffer to hold this device's address.
  1777. * An invalid address (i.e. all FF's) will restore this
  1778. * device's address to the address set at initialization.
  1779. *
  1780. * output parameters
  1781. *
  1782. * @param None.
  1783. *
  1784. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1785. * LL_STATUS_ERROR_COMMAND_DISALLOWED
  1786. */
  1787. extern llStatus_t LL_EXT_SetBDADDR( uint8 *bdAddr );
  1788. /*******************************************************************************
  1789. * @fn LL_EXT_SetSCA
  1790. *
  1791. * @brief This API is used to set this device's Sleep Clock Accuracy.
  1792. *
  1793. * Note: For a slave device, this value is directly used, but only
  1794. * if power management is enabled. For a master device, this
  1795. * value is converted into one of eight ordinal values
  1796. * representing a SCA range, as specified in Table 2.2,
  1797. * Vol. 6, Part B, Section 2.3.3.1 of the Core specification.
  1798. *
  1799. * Note: This command is only allowed when the device is not in a
  1800. * connection.
  1801. *
  1802. * Note: The device's SCA value remains unaffected by a HCI_Reset.
  1803. *
  1804. * input parameters
  1805. *
  1806. * @param scaInPPM - This device's SCA in PPM from 0..500.
  1807. *
  1808. * output parameters
  1809. *
  1810. * @param None.
  1811. *
  1812. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER,
  1813. * LL_STATUS_ERROR_COMMAND_DISALLOWED
  1814. */
  1815. extern llStatus_t LL_EXT_SetSCA( uint16 scaInPPM );
  1816. /*******************************************************************************
  1817. * @fn LL_EXT_SetFreqTune
  1818. *
  1819. * @brief This API is used to set the Frequncy Tuning up or down. If the
  1820. * current setting is already at the max/min value, then no
  1821. * update is performed.
  1822. *
  1823. * Note: This is a Production Test Mode only command!
  1824. *
  1825. * input parameters
  1826. *
  1827. * @param step - LL_EXT_SET_FREQ_TUNE_UP or LL_EXT_SET_FREQ_TUNE_DOWN
  1828. *
  1829. * output parameters
  1830. *
  1831. * @param None.
  1832. *
  1833. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1834. */
  1835. extern llStatus_t LL_EXT_SetFreqTune( uint8 step );
  1836. /*******************************************************************************
  1837. * @fn LL_EXT_SaveFreqTune
  1838. *
  1839. * @brief This API is used to save the current Frequency Tuning value to
  1840. * flash memory. It is restored on reboot or wake from sleep.
  1841. *
  1842. * Note: This is a Production Test Mode only command!
  1843. *
  1844. * input parameters
  1845. *
  1846. * @param None.
  1847. *
  1848. * output parameters
  1849. *
  1850. * @param None.
  1851. *
  1852. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED
  1853. */
  1854. extern llStatus_t LL_EXT_SaveFreqTune( void );
  1855. /*******************************************************************************
  1856. * @fn LL_EXT_SetMaxDtmTxPower Vendor Specific API
  1857. *
  1858. * @brief This function is used to set the max RF TX power to be used
  1859. * when using Direct Test Mode.
  1860. *
  1861. * input parameters
  1862. *
  1863. * @param txPower - LL_EXT_TX_POWER_MINUS_23_DBM,
  1864. * LL_EXT_TX_POWER_MINUS_6_DBM,
  1865. * LL_EXT_TX_POWER_0_DBM,
  1866. * LL_EXT_TX_POWER_4_DBM
  1867. *
  1868. * output parameters
  1869. *
  1870. * @param cmdComplete - Boolean to indicate the command is still pending.
  1871. *
  1872. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1873. */
  1874. extern llStatus_t LL_EXT_SetMaxDtmTxPower( uint8 txPower );
  1875. /*******************************************************************************
  1876. * @fn LL_EXT_DisconnectImmed Vendor Specific API
  1877. *
  1878. * @brief This function is used to disconnect the connection immediately.
  1879. *
  1880. * Note: The connection (if valid) is immediately terminated
  1881. * without notifying the remote device. The Host is still
  1882. * notified.
  1883. *
  1884. * input parameters
  1885. *
  1886. * @param connId - The LL connection ID on which to send this data.
  1887. *
  1888. * output parameters
  1889. *
  1890. * @param None.
  1891. *
  1892. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_INACTIVE_CONNECTION
  1893. */
  1894. extern llStatus_t LL_EXT_DisconnectImmed( uint16 connId );
  1895. /*******************************************************************************
  1896. * @fn LL_EXT_PacketErrorRate Vendor Specific API
  1897. *
  1898. * @brief This function is used to Reset or Read the Packet Error Rate
  1899. * counters for a connection. When Reset, the counters are cleared;
  1900. * when Read, the total number of packets received, the number of
  1901. * packets received with a CRC error, the number of events, and the
  1902. * number of missed events are returned via a callback.
  1903. *
  1904. * Note: The counters are only 16 bits. At the shortest connection
  1905. * interval, this provides a bit over 8 minutes of data.
  1906. *
  1907. * input parameters
  1908. *
  1909. * @param connId - The LL connection ID on which to send this data.
  1910. * @param command - LL_EXT_PER_RESET, LL_EXT_PER_READ
  1911. *
  1912. * output parameters
  1913. *
  1914. * @param None.
  1915. *
  1916. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_INACTIVE_CONNECTION
  1917. */
  1918. extern llStatus_t LL_EXT_PacketErrorRate( uint16 connId, uint8 command );
  1919. /*******************************************************************************
  1920. * @fn LL_EXT_PERbyChan Vendor Specific API
  1921. *
  1922. * @brief This API is called by the HCI to start or end Packet Error Rate
  1923. * by Channel counter accumulation for a connection. If the
  1924. * pointer is not NULL, it is assumed there is sufficient memory
  1925. * for the PER data, per the type perByChan_t. If NULL, then
  1926. * the operation is considered disabled.
  1927. *
  1928. * Note: It is the user's responsibility to make sure there is
  1929. * sufficient memory for the data, and that the counters
  1930. * are cleared prior to first use.
  1931. *
  1932. * Note: The counters are only 16 bits. At the shortest connection
  1933. * interval, this provides a bit over 8 minutes of data.
  1934. *
  1935. * input parameters
  1936. *
  1937. * @param connId - The LL connection ID on which to send this data.
  1938. * @param perByChan - Pointer to PER by Channel data, or NULL.
  1939. *
  1940. * output parameters
  1941. *
  1942. * @param None.
  1943. *
  1944. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_INACTIVE_CONNECTION
  1945. */
  1946. extern llStatus_t LL_EXT_PERbyChan( uint16 connId, perByChan_t *perByChan );
  1947. /*******************************************************************************
  1948. * @fn LL_EXT_HaltDuringRf Vendor Specfic API
  1949. *
  1950. * @brief This function is used to enable or disable halting the
  1951. * CPU during RF. The system defaults to enabled.
  1952. *
  1953. * input parameters
  1954. *
  1955. * @param mode - LL_EXT_HALT_DURING_RF_ENABLE,
  1956. * LL_EXT_HALT_DURING_RF_DISABLE
  1957. *
  1958. * output parameters
  1959. *
  1960. * @param None.
  1961. *
  1962. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_COMMAND_DISALLOWED,
  1963. * LL_STATUS_ERROR_BAD_PARAMETER
  1964. */
  1965. extern llStatus_t LL_EXT_HaltDuringRf( uint8 mode );
  1966. /*******************************************************************************
  1967. * @fn LL_EXT_AdvEventNotice Vendor Specific API
  1968. *
  1969. * @brief This API is called to enable or disable a notification to the
  1970. * specified task using the specified task event whenever a Adv
  1971. * event ends. A non-zero taskEvent value is taken to be "enable",
  1972. * while a zero valued taskEvent is taken to be "disable".
  1973. *
  1974. * input parameters
  1975. *
  1976. * @param taskID - User's task ID.
  1977. * @param taskEvent - User's task event.
  1978. *
  1979. * output parameters
  1980. *
  1981. * @param None.
  1982. *
  1983. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  1984. */
  1985. extern llStatus_t LL_EXT_AdvEventNotice( uint8 taskID, uint16 taskEvent );
  1986. /*******************************************************************************
  1987. * @fn LL_EXT_ConnEventNotice Vendor Specific API
  1988. *
  1989. * @brief This API is called to enable or disable a notification to the
  1990. * specified task using the specified task event whenever a
  1991. * Connection event ends. A non-zero taskEvent value is taken to
  1992. * be "enable", while a zero valued taskEvent is taken to be
  1993. * "disable".
  1994. *
  1995. * Note: Currently, only a Slave connection is supported.
  1996. *
  1997. * input parameters
  1998. *
  1999. * @param taskID - User's task ID.
  2000. * @param taskEvent - User's task event.
  2001. *
  2002. * output parameters
  2003. *
  2004. * @param None.
  2005. *
  2006. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_INACTIVE_CONNECTION,
  2007. * LL_STATUS_ERROR_BAD_PARAMETER
  2008. */
  2009. extern llStatus_t LL_EXT_ConnEventNotice( uint8 taskID, uint16 taskEvent );
  2010. /*******************************************************************************
  2011. * @fn LL_EXT_BuildRevision Vendor Specific API
  2012. *
  2013. * @brief This API is used to to set a user revision number or read the
  2014. * build revision number.
  2015. *
  2016. * input parameters
  2017. *
  2018. * @param mode - LL_EXT_SET_USER_REVISION |
  2019. * LL_EXT_READ_BUILD_REVISION
  2020. * @param userRevNum - A 16 bit value the user can set as their own
  2021. * revision number
  2022. *
  2023. * output parameters
  2024. *
  2025. * @param buildRev - Pointer to returned build revision, if any.
  2026. *
  2027. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  2028. */
  2029. extern llStatus_t LL_EXT_BuildRevision( uint8 mode, uint16 userRevNum, uint8 *buildRev );
  2030. /*******************************************************************************
  2031. * @fn LL_EXT_DelaySleep Vendor Specific API
  2032. *
  2033. * @brief This API is used to to set the sleep delay.
  2034. *
  2035. * input parameters
  2036. *
  2037. * @param delay - 0 .. 1000, in milliseconds.
  2038. *
  2039. * output parameters
  2040. *
  2041. * @param None.
  2042. *
  2043. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  2044. */
  2045. extern llStatus_t LL_EXT_DelaySleep( uint16 delay );
  2046. /*******************************************************************************
  2047. * @fn LL_EXT_ResetSystem Vendor Specific API
  2048. *
  2049. * @brief This API is used to to issue a soft or hard system reset.
  2050. *
  2051. * input parameters
  2052. *
  2053. * @param mode - LL_EXT_RESET_SYSTEM_HARD | LL_EXT_RESET_SYSTEM_SOFT
  2054. *
  2055. * output parameters
  2056. *
  2057. * @param None.
  2058. *
  2059. * @return LL_STATUS_SUCCESS, LL_STATUS_ERROR_BAD_PARAMETER
  2060. */
  2061. extern llStatus_t LL_EXT_ResetSystem( uint8 mode );
  2062. /*******************************************************************************
  2063. * @fn LL_EXT_OverlappedProcessing Vendor Specific API
  2064. *
  2065. * @brief This API is used to enable or disable overlapped processing.
  2066. *
  2067. * input parameters
  2068. *
  2069. * @param mode - LL_EXT_ENABLE_OVERLAPPED_PROCESSING |
  2070. * LL_EXT_DISABLE_OVERLAPPED_PROCESSING
  2071. *
  2072. * output parameters
  2073. *
  2074. * @param None.
  2075. *
  2076. * @return LL_STATUS_SUCCESS, LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS
  2077. */
  2078. extern llStatus_t LL_EXT_OverlappedProcessing( uint8 mode );
  2079. /*******************************************************************************
  2080. * @fn LL_EXT_NumComplPktsLimit Vendor Specific API
  2081. *
  2082. * @brief This API is used to set the minimum number of
  2083. * completed packets which must be met before a Number of
  2084. * Completed Packets event is returned. If the limit is not
  2085. * reach by the end of the connection event, then a Number of
  2086. * Completed Packets event will be returned (if non-zero) based
  2087. * on the flushOnEvt flag.
  2088. *
  2089. * input parameters
  2090. *
  2091. * @param limit - From 1 to LL_MAX_NUM_DATA_BUFFERS.
  2092. * @param flushOnEvt - LL_EXT_DISABLE_NUM_COMPL_PKTS_ON_EVENT |
  2093. * LL_EXT_ENABLE_NUM_COMPL_PKTS_ON_EVENT
  2094. *
  2095. * output parameters
  2096. *
  2097. * @param None.
  2098. *
  2099. * @return LL_STATUS_SUCCESS, LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS
  2100. */
  2101. extern llStatus_t LL_EXT_NumComplPktsLimit( uint8 limit,
  2102. uint8 flushOnEvt );
  2103. /*
  2104. ** LL Callbacks to HCI
  2105. */
  2106. /*******************************************************************************
  2107. * @fn LL_ConnectionCompleteCback Callback
  2108. *
  2109. * @brief This Callback is used by the LL to indicate to the Host that
  2110. * a new connection has been created. For the Slave, this means
  2111. * a CONNECT_REQ message was received from an Initiator. For the
  2112. * Master, this means a CONNECT_REQ message was sent in response
  2113. * to a directed or undirected message addressed to the Initiator.
  2114. *
  2115. * input parameters
  2116. *
  2117. * @param reasonCode - LL_STATUS_SUCCESS or ?
  2118. * @param connId - The LL connection ID for new connection.
  2119. * @param role - LL_LINK_CONNECT_COMPLETE_MASTER or
  2120. * LL_LINK_CONNECT_COMPLETE_SLAVE.
  2121. * @param peerAddrType - Peer address type (public or random).
  2122. * @param peerAddr - Peer address.
  2123. * @param connInterval - Connection interval.
  2124. * @param slaveLatency - The connection's Slave Latency.
  2125. * @param connTimeout - The connection's Supervision Timeout.
  2126. * @param clockAccuracy - The sleep clock accurracy of the Master. Only
  2127. * valid on the Slave. Set to 0x00 for the Master.
  2128. *
  2129. * output parameters
  2130. *
  2131. * @param None.
  2132. *
  2133. * @return None.
  2134. */
  2135. extern void LL_ConnectionCompleteCback( uint8 reasonCode,
  2136. uint16 connId,
  2137. uint8 role,
  2138. uint8 peerAddrType,
  2139. uint8 *peerAddr,
  2140. uint16 connInterval,
  2141. uint16 slaveLatency,
  2142. uint16 connTimeout,
  2143. uint8 clockAccuracy );
  2144. /*******************************************************************************
  2145. * @fn LL_DisconnectCback Callback
  2146. *
  2147. * @brief This Callback is used by the LL to indicate to the Host that
  2148. * the connection has been terminated. The cause is given by the
  2149. * reason code.
  2150. *
  2151. * input parameters
  2152. *
  2153. * @param connId - The LL connection ID.
  2154. * @param reason - The reason the connection was terminated.
  2155. *
  2156. * output parameters
  2157. *
  2158. * @param None.
  2159. *
  2160. * @return None.
  2161. */
  2162. extern void LL_DisconnectCback( uint16 connId,
  2163. uint8 reason );
  2164. /*******************************************************************************
  2165. * @fn LL_ConnParamUpdateCback Callback
  2166. *
  2167. * @brief This Callback is used by the LL to indicate to the Host that
  2168. * the update parameters control procedure has completed. It is
  2169. * always made to the Master's Host when the update request has
  2170. * been sent. It is only made to the Slave's Host when the update
  2171. * results in a change to the connection interval, and/or the
  2172. * connection latency, and/or the connection timeout.
  2173. *
  2174. * input parameters
  2175. *
  2176. * @param connId - The LL connection ID.
  2177. * @param connInterval - Connection interval.
  2178. * @param connLatency - The connection's Slave Latency.
  2179. * @param connTimeout - The connection's Supervision Timeout.
  2180. *
  2181. * output parameters
  2182. *
  2183. * @param None.
  2184. *
  2185. * @return None.
  2186. */
  2187. extern void LL_ConnParamUpdateCback( uint16 connId,
  2188. uint16 connInterval,
  2189. uint16 connLatency,
  2190. uint16 connTimeout );
  2191. /*******************************************************************************
  2192. * @fn LL_ReadRemoteVersionInfoCback Callback
  2193. *
  2194. * @brief This Callback is used by the LL to indicate to the Host the
  2195. * requested peer's Version information.
  2196. *
  2197. * input parameters
  2198. *
  2199. * @param status - Status of callback.
  2200. * @param connId - The LL connection ID.
  2201. * @param verNum - Version of the Bluetooth Controller specification.
  2202. * @param comId - Company identifier of the manufacturer of the
  2203. * Bluetooth Controller.
  2204. * @param subverNum - A unique value for each implementation or revision
  2205. * of an implementation of the Bluetooth Controller.
  2206. *
  2207. * output parameters
  2208. *
  2209. * @param None.
  2210. *
  2211. * @return None.
  2212. */
  2213. extern void LL_ReadRemoteVersionInfoCback( uint8 status,
  2214. uint16 connId,
  2215. uint8 verNum,
  2216. uint16 comId,
  2217. uint16 subverNum );
  2218. /*******************************************************************************
  2219. * @fn LL_EncChangeCback Callback
  2220. *
  2221. * @brief This Callback is used by the LL to indicate to the Host that
  2222. * an encryption change has taken place. This results when
  2223. * the host performs a LL_StartEncrypt when encryption is not
  2224. * already enabled.
  2225. *
  2226. * Note: If the key request was rejected, then encryption will
  2227. * remain off.
  2228. *
  2229. * input parameters
  2230. *
  2231. * @param connId - The LL connection ID for new connection.
  2232. * @param reason - LL_ENC_KEY_REQ_ACCEPTED or LL_ENC_KEY_REQ_REJECTED.
  2233. * @param encEnab - LL_ENCRYPTION_OFF or LL_ENCRYPTION_ON.
  2234. *
  2235. * output parameters
  2236. *
  2237. * @param None.
  2238. *
  2239. * @return None.
  2240. */
  2241. extern void LL_EncChangeCback( uint16 connId,
  2242. uint8 reason,
  2243. uint8 encEnab );
  2244. /*******************************************************************************
  2245. * @fn LL_EncKeyRefreshCback Callback
  2246. *
  2247. * @brief This Callback is used by the LL to indicate to the Host that
  2248. * an encryption key change has taken place. This results when
  2249. * the host performs a LL_StartEncrypt when encryption is already
  2250. * enabled.
  2251. *
  2252. * input parameters
  2253. *
  2254. * @param connId - The LL connection ID for new connection.
  2255. * @param reason - LL_ENC_KEY_REQ_ACCEPTED.
  2256. *
  2257. * output parameters
  2258. *
  2259. * @param None.
  2260. *
  2261. * @return None.
  2262. */
  2263. extern void LL_EncKeyRefreshCback( uint16 connId,
  2264. uint8 reason );
  2265. /*******************************************************************************
  2266. * @fn LL_AdvReportCback Callback
  2267. *
  2268. * @brief This Callback is used by the LL to provide information about
  2269. * advertisers from which an advertising packet was received.
  2270. *
  2271. * input parameters
  2272. *
  2273. * @param eventType - Type of advertisement packet received by Scanner
  2274. * or Initiator, and scan response for Initiator.
  2275. * @param advAddrType - Advertiser address type (public or random).
  2276. * @param advAddr - Advertiser address.
  2277. * @param dataLen - Size in bytes of advertisement packet.
  2278. * @param data - Advertisement data.
  2279. * @param rssi - RSSI value (-127..20dBm), or not available
  2280. *
  2281. * output parameters
  2282. *
  2283. * @param None.
  2284. *
  2285. * @return None.
  2286. */
  2287. extern void LL_AdvReportCback( uint8 eventType,
  2288. uint8 advAddrType,
  2289. uint8 *advAddr,
  2290. uint8 dataLen,
  2291. uint8 *data,
  2292. int8 rssi );
  2293. /*******************************************************************************
  2294. * @fn LL_ReadRemoteUsedFeaturesCompleteCback Callback
  2295. *
  2296. * @brief This Callback is used by the LL to indicate to the Host that
  2297. * the Read Remote Feature Support command as completed.
  2298. *
  2299. * input parameters
  2300. *
  2301. * @param status - SUCCESS or control procedure timeout.
  2302. * @param connId - The LL connection ID for new connection.
  2303. * @param featureSet - A pointer to the Feature Set.
  2304. *
  2305. * output parameters
  2306. *
  2307. * @param None.
  2308. *
  2309. * @return None.
  2310. */
  2311. extern void LL_ReadRemoteUsedFeaturesCompleteCback( uint8 status,
  2312. uint16 connId,
  2313. uint8 *featureSet );
  2314. /*******************************************************************************
  2315. * @fn LL_EncLtkReqCback Callback
  2316. *
  2317. * @brief This Callback is used by the LL to provide to the Host the
  2318. * Master's random number and encryption diversifier, and to
  2319. * request the Host's Long Term Key (LTK).
  2320. *
  2321. * input parameters
  2322. *
  2323. * @param connId - The LL connection ID for new connection.
  2324. * @param randNum - Random vector used in device identification.
  2325. * @param encDiv - Encrypted diversifier.
  2326. *
  2327. * output parameters
  2328. *
  2329. * @param None.
  2330. *
  2331. * @return None.
  2332. */
  2333. extern void LL_EncLtkReqCback( uint16 connId,
  2334. uint8 *randNum,
  2335. uint8 *encDiv );
  2336. /*******************************************************************************
  2337. * @fn LL_DirectTestEndDone Callback
  2338. *
  2339. * @brief This Callback is used by the LL to notify the HCI that the
  2340. * Direct Test End command has completed.
  2341. *
  2342. *
  2343. * input parameters
  2344. *
  2345. * @param numPackets - The number of packets received. Zero for transmit.
  2346. * @param mode - LL_DIRECT_TEST_MODE_TX or LL_DIRECT_TEST_MODE_RX.
  2347. *
  2348. * output parameters
  2349. *
  2350. * @param None.
  2351. *
  2352. * @return LL_STATUS_SUCCESS
  2353. */
  2354. extern void LL_DirectTestEndDoneCback( uint16 numPackets,
  2355. uint8 mode );
  2356. /*******************************************************************************
  2357. * @fn LL_DataLengthChange Callback
  2358. *
  2359. *
  2360. */
  2361. extern void LL_DataLengthChangeCback(uint16 connHandle,
  2362. uint16 MaxTxOctets,
  2363. uint16 MaxTxTime,
  2364. uint16 MaxRxOctets,
  2365. uint16 MaxRxTime);
  2366. /*******************************************************************************
  2367. * @fn LL_TxDataCompleteCback Callback
  2368. *
  2369. * @brief This Callback is used by the LL to indicate to the HCI that
  2370. * the HCI's buffer is free for its own use again.
  2371. *
  2372. * input parameters
  2373. *
  2374. * @param connId - The LL connection ID on which to send this data.
  2375. * @param *pBuf - A pointer to the data buffer to transmit, or NULL.
  2376. *
  2377. * output parameters
  2378. *
  2379. * @param None.
  2380. *
  2381. * @return None.
  2382. ******************************************************************************/
  2383. extern void LL_TxDataCompleteCback( uint16 connId,
  2384. uint8 *pBuf );
  2385. /*******************************************************************************
  2386. * @fn LL_RxDataCompleteCback Callback
  2387. *
  2388. * @brief This Callback is used by the LL to indicate to the HCI that
  2389. * data has been received and placed in the buffer provided by
  2390. * the HCI.
  2391. *
  2392. * input parameters
  2393. *
  2394. * @param connId - The LL connection ID on which data was received.
  2395. * @param *pBuf - A pointer to the receive data buffer provided by
  2396. * the HCI.
  2397. * @param len - The number of bytes received on this connection.
  2398. * @param fragFlag - LL_DATA_FIRST_PKT indicates buffer is the start of
  2399. * a Host packet.
  2400. * LL_DATA_CONTINUATION_PKT: Indicates buffer is a
  2401. * continuation of a Host packet.
  2402. * @param rssi - The RSSI of this received packet as a signed byte.
  2403. * Range: -127dBm..+20dBm, 127=Not Available.
  2404. *
  2405. * output parameters
  2406. *
  2407. * @param **pBuf - A double pointer updated to the next receive data
  2408. * buffer, or NULL if no next buffer is available.
  2409. *
  2410. * @return None.
  2411. */
  2412. extern void LL_RxDataCompleteCback( uint16 connId,
  2413. uint8 *ppBuf,
  2414. uint8 len,
  2415. uint8 fragFlag,
  2416. int8 rssi );
  2417. /*******************************************************************************
  2418. * @fn LL_RandCback API
  2419. *
  2420. * @brief This Callback is used by the LL to notify the HCI that the true
  2421. * random number command has been completed.
  2422. *
  2423. * Note: The length is always given by B_RANDOM_NUM_SIZE.
  2424. *
  2425. * input parameters
  2426. *
  2427. * @param *randData - Pointer to buffer to place a random block of data.
  2428. *
  2429. * output parameters
  2430. *
  2431. * @param None.
  2432. *
  2433. * @return None.
  2434. */
  2435. extern void LL_RandCback( uint8 *randData );
  2436. /*******************************************************************************
  2437. * @fn LL_EXT_SetRxGainCback Callback
  2438. *
  2439. * @brief This Callback is used by the LL to notify the HCI that the set
  2440. * RX gain command has been completed.
  2441. *
  2442. * input parameters
  2443. *
  2444. * @param None.
  2445. *
  2446. * output parameters
  2447. *
  2448. * @param None.
  2449. *
  2450. * @return None.
  2451. */
  2452. extern void LL_EXT_SetRxGainCback( void );
  2453. /*******************************************************************************
  2454. * @fn LL_EXT_SetTxPowerCback Callback
  2455. *
  2456. * @brief This Callback is used by the LL to notify the HCI that the set
  2457. * TX power command has been completed.
  2458. *
  2459. * input parameters
  2460. *
  2461. * @param None.
  2462. *
  2463. * output parameters
  2464. *
  2465. * @param None.
  2466. *
  2467. * @return None.
  2468. */
  2469. extern void LL_EXT_SetTxPowerCback( void );
  2470. /*******************************************************************************
  2471. * @fn LL_EXT_PacketErrorRateCback Callback
  2472. *
  2473. * @brief This Callback is used by the LL to notify the HCI that the
  2474. * Packet Error Rate Read command has been completed.
  2475. *
  2476. * Note: The counters are only 16 bits. At the shortest connection
  2477. * interval, this provides a bit over 8 minutes of data.
  2478. *
  2479. * input parameters
  2480. *
  2481. * @param numPkts - Number of Packets received.
  2482. * @param numCrcErr - Number of Packets received with a CRC error.
  2483. * @param numEvents - Number of Connection Events.
  2484. * @param numPkts - Number of Missed Connection Events.
  2485. *
  2486. * output parameters
  2487. *
  2488. * @param None.
  2489. *
  2490. * @return None.
  2491. */
  2492. extern void LL_EXT_PacketErrorRateCback( uint16 numPkts,
  2493. uint16 numCrcErr,
  2494. uint16 numEvents,
  2495. uint16 numMissedEvts );
  2496. /*******************************************************************************
  2497. * @fn LL_EXT_ExtendRfRangeCback Callback
  2498. *
  2499. * @brief This Callback is used by the LL to notify the HCI that the
  2500. * Extend Rf Range command has been completed.
  2501. *
  2502. * input parameters
  2503. *
  2504. * @param None.
  2505. *
  2506. * output parameters
  2507. *
  2508. * @param None.
  2509. *
  2510. * @return None.
  2511. */
  2512. //extern void LL_EXT_ExtendRfRangeCback( void );
  2513. /*******************************************************************************
  2514. * @fn LL_PLUS_LoadMACFromFlash
  2515. *
  2516. * @brief Used to load MAC Address from Flash
  2517. *
  2518. * input parameters
  2519. *
  2520. * @param None.
  2521. *
  2522. * output parameters
  2523. *
  2524. * @param None.
  2525. *
  2526. * @return None.
  2527. */
  2528. extern void LL_PLUS_LoadMACFromFlash(uint32_t addr);
  2529. /*******************************************************************************
  2530. * @fn LL_PLUS_PerStatsReset
  2531. *
  2532. * @brief Used to reset linklayer per stats
  2533. *
  2534. * input parameters
  2535. *
  2536. * @param None.
  2537. *
  2538. * output parameters
  2539. *
  2540. * @param None.
  2541. *
  2542. * @return None.
  2543. */
  2544. extern void LL_PLUS_PerStatsReset(void);
  2545. /*******************************************************************************
  2546. * @fn LL_PLUS_PerStasReadByChn
  2547. *
  2548. * @brief read per stats by data channel id
  2549. *
  2550. * input parameters
  2551. *
  2552. * @param None.
  2553. *
  2554. * output parameters
  2555. *
  2556. * @param None.
  2557. *
  2558. * @return None.
  2559. */
  2560. extern void LL_PLUS_PerStasReadByChn(uint8 chnId,perStats_t * perStats);
  2561. extern LL_PLUS_AdvDataFilterCB_t LL_PLUS_AdvDataFilterCBack;
  2562. extern void LL_PLUS_SetAdvDataFilterCB(LL_PLUS_AdvDataFilterCB_t AdvDataFilterCBack);
  2563. extern uint8_t* LL_PLUS_GetAdvDataExtendData(void);
  2564. extern void LL_PLUS_SetScanRequestData(uint8 dLen,uint8* pData);
  2565. extern LL_PLUS_ScanRequestFilterCB_t LL_PLUS_ScanRequestFilterCBack;
  2566. extern void LL_PLUS_SetScanRequestFilterCB(LL_PLUS_ScanRequestFilterCB_t ScanRequestFilterCBack);
  2567. extern uint8 LL_PLUS_GetScanRequestExtendData(uint8* pData);
  2568. extern void LL_PLUS_GetScanerAddr(uint8* pData);
  2569. extern void LL_PLUS_SetScanRsqData(uint8 dLen,uint8* pData);
  2570. extern void LL_PLUS_SetScanRsqDataByIndex(uint8 dIdx,uint8 data);
  2571. //DLE
  2572. extern llStatus_t LL_SetDataLengh( uint16 connId,uint16 TxOctets,uint16 TxTime );
  2573. extern uint8 LL_PLUS_GetLocalPduDataLength(ll_pdu_length_ctrl_t* pduLen);
  2574. extern llStatus_t LL_WriteSuggestedDefaultDataLength(uint16 TxOctets,uint16 TxTime);
  2575. extern void LL_DataLengthChangeCback( uint16 connHandle,
  2576. uint16 MaxTxOctets,
  2577. uint16 MaxTxTime,
  2578. uint16 MaxRxOctets,
  2579. uint16 MaxRxTime);
  2580. //PHY UPDATE
  2581. extern llStatus_t LL_SetDefaultPhyMode( uint16 connId,uint8 allPhy,uint8 txPhy, uint8 rxPhy);
  2582. extern llStatus_t LL_SetPhyMode( uint16 connId,uint8 allPhy,uint8 txPhy, uint8 rxPhy,uint16 phyOptions);
  2583. extern llStatus_t LL_PhyUpdate( uint16 connId );
  2584. extern void LL_PhyUpdateCompleteCback( uint16 connHandle,
  2585. uint8 status,
  2586. uint8 txPhy,
  2587. uint8 rxPhy);
  2588. #ifdef __cplusplus
  2589. }
  2590. #endif
  2591. #endif /* LL_H */