btstack_event.h 209 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625
  1. /*********************************************************************************************
  2. * Filename : btstack_event.h
  3. * Description :
  4. * Author : Tongai
  5. * Email : laotongai@zh-jieli.com
  6. * Last modifiled : 2020-07-01 16:23
  7. * Copyright:(c)JIELI 2011-2019 @ , All Rights Reserved.
  8. *********************************************************************************************/
  9. #ifndef __BTSTACK_EVENT_H
  10. #define __BTSTACK_EVENT_H
  11. #if defined __cplusplus
  12. extern "C" {
  13. #endif
  14. #include "btstack/btstack_typedef.h"
  15. #include <stdint.h>
  16. #define ENABLE_BLE
  17. #ifdef ENABLE_BLE
  18. #include "le/gatt.h"
  19. #endif
  20. /* API_START */
  21. /**
  22. * @brief Get event type
  23. * @param event
  24. * @return type of event
  25. */
  26. static inline uint8_t hci_event_packet_get_type(const uint8_t *event)
  27. {
  28. return event[0];
  29. }
  30. /***
  31. * @brief Get subevent code for ancs event
  32. * @param event packet
  33. * @return subevent_code
  34. */
  35. static inline uint8_t hci_event_ancs_meta_get_subevent_code(const uint8_t *event)
  36. {
  37. return event[2];
  38. }
  39. /***
  40. * @brief Get subevent code for avdtp event
  41. * @param event packet
  42. * @return subevent_code
  43. */
  44. static inline uint8_t hci_event_avdtp_meta_get_subevent_code(const uint8_t *event)
  45. {
  46. return event[2];
  47. }
  48. /***
  49. * @brief Get subevent code for a2dp event
  50. * @param event packet
  51. * @return subevent_code
  52. */
  53. static inline uint8_t hci_event_a2dp_meta_get_subevent_code(const uint8_t *event)
  54. {
  55. return event[2];
  56. }
  57. /***
  58. * @brief Get subevent code for avrcp event
  59. * @param event packet
  60. * @return subevent_code
  61. */
  62. static inline uint8_t hci_event_avrcp_meta_get_subevent_code(const uint8_t *event)
  63. {
  64. return event[2];
  65. }
  66. /***
  67. * @brief Get subevent code for goep event
  68. * @param event packet
  69. * @return subevent_code
  70. */
  71. static inline uint8_t hci_event_goep_meta_get_subevent_code(const uint8_t *event)
  72. {
  73. return event[2];
  74. }
  75. /***
  76. * @brief Get subevent code for hfp event
  77. * @param event packet
  78. * @return subevent_code
  79. */
  80. static inline uint8_t hci_event_hfp_meta_get_subevent_code(const uint8_t *event)
  81. {
  82. return event[2];
  83. }
  84. /***
  85. * @brief Get subevent code for hsp event
  86. * @param event packet
  87. * @return subevent_code
  88. */
  89. static inline uint8_t hci_event_hsp_meta_get_subevent_code(const uint8_t *event)
  90. {
  91. return event[2];
  92. }
  93. /***
  94. * @brief Get subevent code for pbap event
  95. * @param event packet
  96. * @return subevent_code
  97. */
  98. static inline uint8_t hci_event_pbap_meta_get_subevent_code(const uint8_t *event)
  99. {
  100. return event[2];
  101. }
  102. /***
  103. * @brief Get subevent code for le event
  104. * @param event packet
  105. * @return subevent_code
  106. */
  107. static inline uint8_t hci_event_le_meta_get_subevent_code(const uint8_t *event)
  108. {
  109. return event[2];
  110. }
  111. /***
  112. * @brief Get subevent code for hid event
  113. * @param event packet
  114. * @return subevent_code
  115. */
  116. static inline uint8_t hci_event_hid_meta_get_subevent_code(const uint8_t *event)
  117. {
  118. return event[2];
  119. }
  120. /***
  121. * @brief Get subevent code for hids event
  122. * @param event packet
  123. * @return subevent_code
  124. */
  125. static inline uint8_t hci_event_hids_meta_get_subevent_code(const uint8_t *event)
  126. {
  127. return event[2];
  128. }
  129. /**
  130. * @brief Get field status from event HCI_EVENT_INQUIRY_COMPLETE
  131. * @param event packet
  132. * @return status
  133. * @note: btstack_type 1
  134. */
  135. static inline uint8_t hci_event_inquiry_complete_get_status(const uint8_t *event)
  136. {
  137. return event[2];
  138. }
  139. /**
  140. * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT
  141. * @param event packet
  142. * @return num_responses
  143. * @note: btstack_type 1
  144. */
  145. static inline uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t *event)
  146. {
  147. return event[2];
  148. }
  149. /**
  150. * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT
  151. * @param event packet
  152. * @param Pointer to storage for bd_addr
  153. * @note: btstack_type B
  154. */
  155. static inline void hci_event_inquiry_result_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  156. {
  157. reverse_bd_addr(&event[3], bd_addr);
  158. }
  159. /**
  160. * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT
  161. * @param event packet
  162. * @return page_scan_repetition_mode
  163. * @note: btstack_type 1
  164. */
  165. static inline uint8_t hci_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t *event)
  166. {
  167. return event[9];
  168. }
  169. /**
  170. * @brief Get field reserved1 from event HCI_EVENT_INQUIRY_RESULT
  171. * @param event packet
  172. * @return reserved1
  173. * @note: btstack_type 1
  174. */
  175. static inline uint8_t hci_event_inquiry_result_get_reserved1(const uint8_t *event)
  176. {
  177. return event[10];
  178. }
  179. /**
  180. * @brief Get field reserved2 from event HCI_EVENT_INQUIRY_RESULT
  181. * @param event packet
  182. * @return reserved2
  183. * @note: btstack_type 1
  184. */
  185. static inline uint8_t hci_event_inquiry_result_get_reserved2(const uint8_t *event)
  186. {
  187. return event[11];
  188. }
  189. /**
  190. * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT
  191. * @param event packet
  192. * @return class_of_device
  193. * @note: btstack_type 3
  194. */
  195. static inline uint32_t hci_event_inquiry_result_get_class_of_device(const uint8_t *event)
  196. {
  197. return little_endian_read_24(event, 12);
  198. }
  199. /**
  200. * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT
  201. * @param event packet
  202. * @return clock_offset
  203. * @note: btstack_type 2
  204. */
  205. static inline uint16_t hci_event_inquiry_result_get_clock_offset(const uint8_t *event)
  206. {
  207. return little_endian_read_16(event, 15);
  208. }
  209. /**
  210. * @brief Get field status from event HCI_EVENT_CONNECTION_COMPLETE
  211. * @param event packet
  212. * @return status
  213. * @note: btstack_type 1
  214. */
  215. static inline uint8_t hci_event_connection_complete_get_status(const uint8_t *event)
  216. {
  217. return event[2];
  218. }
  219. /**
  220. * @brief Get field connection_handle from event HCI_EVENT_CONNECTION_COMPLETE
  221. * @param event packet
  222. * @return connection_handle
  223. * @note: btstack_type 2
  224. */
  225. static inline uint16_t hci_event_connection_complete_get_connection_handle(const uint8_t *event)
  226. {
  227. return little_endian_read_16(event, 3);
  228. }
  229. /**
  230. * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_COMPLETE
  231. * @param event packet
  232. * @param Pointer to storage for bd_addr
  233. * @note: btstack_type B
  234. */
  235. static inline void hci_event_connection_complete_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  236. {
  237. reverse_bd_addr(&event[5], bd_addr);
  238. }
  239. /**
  240. * @brief Get field link_type from event HCI_EVENT_CONNECTION_COMPLETE
  241. * @param event packet
  242. * @return link_type
  243. * @note: btstack_type 1
  244. */
  245. static inline uint8_t hci_event_connection_complete_get_link_type(const uint8_t *event)
  246. {
  247. return event[11];
  248. }
  249. /**
  250. * @brief Get field encryption_enabled from event HCI_EVENT_CONNECTION_COMPLETE
  251. * @param event packet
  252. * @return encryption_enabled
  253. * @note: btstack_type 1
  254. */
  255. static inline uint8_t hci_event_connection_complete_get_encryption_enabled(const uint8_t *event)
  256. {
  257. return event[12];
  258. }
  259. /**
  260. * @brief Get field bd_addr from event HCI_EVENT_CONNECTION_REQUEST
  261. * @param event packet
  262. * @param Pointer to storage for bd_addr
  263. * @note: btstack_type B
  264. */
  265. static inline void hci_event_connection_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  266. {
  267. reverse_bd_addr(&event[2], bd_addr);
  268. }
  269. /**
  270. * @brief Get field class_of_device from event HCI_EVENT_CONNECTION_REQUEST
  271. * @param event packet
  272. * @return class_of_device
  273. * @note: btstack_type 3
  274. */
  275. static inline uint32_t hci_event_connection_request_get_class_of_device(const uint8_t *event)
  276. {
  277. return little_endian_read_24(event, 8);
  278. }
  279. /**
  280. * @brief Get field link_type from event HCI_EVENT_CONNECTION_REQUEST
  281. * @param event packet
  282. * @return link_type
  283. * @note: btstack_type 1
  284. */
  285. static inline uint8_t hci_event_connection_request_get_link_type(const uint8_t *event)
  286. {
  287. return event[11];
  288. }
  289. /**
  290. * @brief Get field status from event HCI_EVENT_DISCONNECTION_COMPLETE
  291. * @param event packet
  292. * @return status
  293. * @note: btstack_type 1
  294. */
  295. static inline uint8_t hci_event_disconnection_complete_get_status(const uint8_t *event)
  296. {
  297. return event[2];
  298. }
  299. /**
  300. * @brief Get field connection_handle from event HCI_EVENT_DISCONNECTION_COMPLETE
  301. * @param event packet
  302. * @return connection_handle
  303. * @note: btstack_type 2
  304. */
  305. static inline uint16_t hci_event_disconnection_complete_get_connection_handle(const uint8_t *event)
  306. {
  307. return little_endian_read_16(event, 3);
  308. }
  309. /**
  310. * @brief Get field reason from event HCI_EVENT_DISCONNECTION_COMPLETE
  311. * @param event packet
  312. * @return reason
  313. * @note: btstack_type 1
  314. */
  315. static inline uint8_t hci_event_disconnection_complete_get_reason(const uint8_t *event)
  316. {
  317. return event[5];
  318. }
  319. /**
  320. * @brief Get field status from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT
  321. * @param event packet
  322. * @return status
  323. * @note: btstack_type 1
  324. */
  325. static inline uint8_t hci_event_authentication_complete_event_get_status(const uint8_t *event)
  326. {
  327. return event[2];
  328. }
  329. /**
  330. * @brief Get field connection_handle from event HCI_EVENT_AUTHENTICATION_COMPLETE_EVENT
  331. * @param event packet
  332. * @return connection_handle
  333. * @note: btstack_type 2
  334. */
  335. static inline uint16_t hci_event_authentication_complete_event_get_connection_handle(const uint8_t *event)
  336. {
  337. return little_endian_read_16(event, 3);
  338. }
  339. /**
  340. * @brief Get field status from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
  341. * @param event packet
  342. * @return status
  343. * @note: btstack_type 1
  344. */
  345. static inline uint8_t hci_event_remote_name_request_complete_get_status(const uint8_t *event)
  346. {
  347. return event[2];
  348. }
  349. /**
  350. * @brief Get field bd_addr from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
  351. * @param event packet
  352. * @param Pointer to storage for bd_addr
  353. * @note: btstack_type B
  354. */
  355. static inline void hci_event_remote_name_request_complete_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  356. {
  357. reverse_bd_addr(&event[3], bd_addr);
  358. }
  359. /**
  360. * @brief Get field remote_name from event HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE
  361. * @param event packet
  362. * @return remote_name
  363. * @note: btstack_type N
  364. */
  365. static inline const char *hci_event_remote_name_request_complete_get_remote_name(const uint8_t *event)
  366. {
  367. return (const char *) &event[9];
  368. }
  369. /**
  370. * @brief Get field status from event HCI_EVENT_ENCRYPTION_CHANGE
  371. * @param event packet
  372. * @return status
  373. * @note: btstack_type 1
  374. */
  375. static inline uint8_t hci_event_encryption_change_get_status(const uint8_t *event)
  376. {
  377. return event[2];
  378. }
  379. /**
  380. * @brief Get field connection_handle from event HCI_EVENT_ENCRYPTION_CHANGE
  381. * @param event packet
  382. * @return connection_handle
  383. * @note: btstack_type 2
  384. */
  385. static inline uint16_t hci_event_encryption_change_get_connection_handle(const uint8_t *event)
  386. {
  387. return little_endian_read_16(event, 3);
  388. }
  389. /**
  390. * @brief Get field encryption_enabled from event HCI_EVENT_ENCRYPTION_CHANGE
  391. * @param event packet
  392. * @return encryption_enabled
  393. * @note: btstack_type 1
  394. */
  395. static inline uint8_t hci_event_encryption_change_get_encryption_enabled(const uint8_t *event)
  396. {
  397. return event[5];
  398. }
  399. /**
  400. * @brief Get field status from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
  401. * @param event packet
  402. * @return status
  403. * @note: btstack_type 1
  404. */
  405. static inline uint8_t hci_event_change_connection_link_key_complete_get_status(const uint8_t *event)
  406. {
  407. return event[2];
  408. }
  409. /**
  410. * @brief Get field connection_handle from event HCI_EVENT_CHANGE_CONNECTION_LINK_KEY_COMPLETE
  411. * @param event packet
  412. * @return connection_handle
  413. * @note: btstack_type 2
  414. */
  415. static inline uint16_t hci_event_change_connection_link_key_complete_get_connection_handle(const uint8_t *event)
  416. {
  417. return little_endian_read_16(event, 3);
  418. }
  419. /**
  420. * @brief Get field status from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
  421. * @param event packet
  422. * @return status
  423. * @note: btstack_type 1
  424. */
  425. static inline uint8_t hci_event_master_link_key_complete_get_status(const uint8_t *event)
  426. {
  427. return event[2];
  428. }
  429. /**
  430. * @brief Get field connection_handle from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
  431. * @param event packet
  432. * @return connection_handle
  433. * @note: btstack_type 2
  434. */
  435. static inline uint16_t hci_event_master_link_key_complete_get_connection_handle(const uint8_t *event)
  436. {
  437. return little_endian_read_16(event, 3);
  438. }
  439. /**
  440. * @brief Get field key_flag from event HCI_EVENT_MASTER_LINK_KEY_COMPLETE
  441. * @param event packet
  442. * @return key_flag
  443. * @note: btstack_type 1
  444. */
  445. static inline uint8_t hci_event_master_link_key_complete_get_key_flag(const uint8_t *event)
  446. {
  447. return event[5];
  448. }
  449. /**
  450. * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_COMPLETE
  451. * @param event packet
  452. * @return num_hci_command_packets
  453. * @note: btstack_type 1
  454. */
  455. static inline uint8_t hci_event_command_complete_get_num_hci_command_packets(const uint8_t *event)
  456. {
  457. return event[2];
  458. }
  459. /**
  460. * @brief Get field command_opcode from event HCI_EVENT_COMMAND_COMPLETE
  461. * @param event packet
  462. * @return command_opcode
  463. * @note: btstack_type 2
  464. */
  465. static inline uint16_t hci_event_command_complete_get_command_opcode(const uint8_t *event)
  466. {
  467. return little_endian_read_16(event, 3);
  468. }
  469. /**
  470. * @brief Get field return_parameters from event HCI_EVENT_COMMAND_COMPLETE
  471. * @param event packet
  472. * @return return_parameters
  473. * @note: btstack_type R
  474. */
  475. static inline const uint8_t *hci_event_command_complete_get_return_parameters(const uint8_t *event)
  476. {
  477. return &event[5];
  478. }
  479. /**
  480. * @brief Get field status from event HCI_EVENT_COMMAND_STATUS
  481. * @param event packet
  482. * @return status
  483. * @note: btstack_type 1
  484. */
  485. static inline uint8_t hci_event_command_status_get_status(const uint8_t *event)
  486. {
  487. return event[2];
  488. }
  489. /**
  490. * @brief Get field num_hci_command_packets from event HCI_EVENT_COMMAND_STATUS
  491. * @param event packet
  492. * @return num_hci_command_packets
  493. * @note: btstack_type 1
  494. */
  495. static inline uint8_t hci_event_command_status_get_num_hci_command_packets(const uint8_t *event)
  496. {
  497. return event[3];
  498. }
  499. /**
  500. * @brief Get field command_opcode from event HCI_EVENT_COMMAND_STATUS
  501. * @param event packet
  502. * @return command_opcode
  503. * @note: btstack_type 2
  504. */
  505. static inline uint16_t hci_event_command_status_get_command_opcode(const uint8_t *event)
  506. {
  507. return little_endian_read_16(event, 4);
  508. }
  509. /**
  510. * @brief Get field hardware_code from event HCI_EVENT_HARDWARE_ERROR
  511. * @param event packet
  512. * @return hardware_code
  513. * @note: btstack_type 1
  514. */
  515. static inline uint8_t hci_event_hardware_error_get_hardware_code(const uint8_t *event)
  516. {
  517. return event[2];
  518. }
  519. /**
  520. * @brief Get field status from event HCI_EVENT_ROLE_CHANGE
  521. * @param event packet
  522. * @return status
  523. * @note: btstack_type 1
  524. */
  525. static inline uint8_t hci_event_role_change_get_status(const uint8_t *event)
  526. {
  527. return event[2];
  528. }
  529. /**
  530. * @brief Get field bd_addr from event HCI_EVENT_ROLE_CHANGE
  531. * @param event packet
  532. * @param Pointer to storage for bd_addr
  533. * @note: btstack_type B
  534. */
  535. static inline void hci_event_role_change_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  536. {
  537. reverse_bd_addr(&event[3], bd_addr);
  538. }
  539. /**
  540. * @brief Get field role from event HCI_EVENT_ROLE_CHANGE
  541. * @param event packet
  542. * @return role
  543. * @note: btstack_type 1
  544. */
  545. static inline uint8_t hci_event_role_change_get_role(const uint8_t *event)
  546. {
  547. return event[9];
  548. }
  549. /**
  550. * @brief Get field status from event HCI_EVENT_MODE_CHANGE_EVENT
  551. * @param event packet
  552. * @return status
  553. * @note: btstack_type 1
  554. */
  555. static inline uint8_t hci_event_mode_change_event_get_status(const uint8_t *event)
  556. {
  557. return event[2];
  558. }
  559. /**
  560. * @brief Get field handle from event HCI_EVENT_MODE_CHANGE_EVENT
  561. * @param event packet
  562. * @return handle
  563. * @note: btstack_type H
  564. */
  565. static inline hci_con_handle_t hci_event_mode_change_event_get_handle(const uint8_t *event)
  566. {
  567. return little_endian_read_16(event, 3);
  568. }
  569. /**
  570. * @brief Get field mode from event HCI_EVENT_MODE_CHANGE_EVENT
  571. * @param event packet
  572. * @return mode
  573. * @note: btstack_type 1
  574. */
  575. static inline uint8_t hci_event_mode_change_event_get_mode(const uint8_t *event)
  576. {
  577. return event[5];
  578. }
  579. /**
  580. * @brief Get field interval from event HCI_EVENT_MODE_CHANGE_EVENT
  581. * @param event packet
  582. * @return interval
  583. * @note: btstack_type 2
  584. */
  585. static inline uint16_t hci_event_mode_change_event_get_interval(const uint8_t *event)
  586. {
  587. return little_endian_read_16(event, 6);
  588. }
  589. /**
  590. * @brief Get field bd_addr from event HCI_EVENT_PIN_CODE_REQUEST
  591. * @param event packet
  592. * @param Pointer to storage for bd_addr
  593. * @note: btstack_type B
  594. */
  595. static inline void hci_event_pin_code_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  596. {
  597. reverse_bd_addr(&event[2], bd_addr);
  598. }
  599. /**
  600. * @brief Get field bd_addr from event HCI_EVENT_LINK_KEY_REQUEST
  601. * @param event packet
  602. * @param Pointer to storage for bd_addr
  603. * @note: btstack_type B
  604. */
  605. static inline void hci_event_link_key_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  606. {
  607. reverse_bd_addr(&event[2], bd_addr);
  608. }
  609. /**
  610. * @brief Get field link_type from event HCI_EVENT_DATA_BUFFER_OVERFLOW
  611. * @param event packet
  612. * @return link_type
  613. * @note: btstack_type 1
  614. */
  615. static inline uint8_t hci_event_data_buffer_overflow_get_link_type(const uint8_t *event)
  616. {
  617. return event[2];
  618. }
  619. /**
  620. * @brief Get field handle from event HCI_EVENT_MAX_SLOTS_CHANGED
  621. * @param event packet
  622. * @return handle
  623. * @note: btstack_type H
  624. */
  625. static inline hci_con_handle_t hci_event_max_slots_changed_get_handle(const uint8_t *event)
  626. {
  627. return little_endian_read_16(event, 2);
  628. }
  629. /**
  630. * @brief Get field lmp_max_slots from event HCI_EVENT_MAX_SLOTS_CHANGED
  631. * @param event packet
  632. * @return lmp_max_slots
  633. * @note: btstack_type 1
  634. */
  635. static inline uint8_t hci_event_max_slots_changed_get_lmp_max_slots(const uint8_t *event)
  636. {
  637. return event[4];
  638. }
  639. /**
  640. * @brief Get field status from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
  641. * @param event packet
  642. * @return status
  643. * @note: btstack_type 1
  644. */
  645. static inline uint8_t hci_event_read_clock_offset_complete_get_status(const uint8_t *event)
  646. {
  647. return event[2];
  648. }
  649. /**
  650. * @brief Get field handle from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
  651. * @param event packet
  652. * @return handle
  653. * @note: btstack_type H
  654. */
  655. static inline hci_con_handle_t hci_event_read_clock_offset_complete_get_handle(const uint8_t *event)
  656. {
  657. return little_endian_read_16(event, 3);
  658. }
  659. /**
  660. * @brief Get field clock_offset from event HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE
  661. * @param event packet
  662. * @return clock_offset
  663. * @note: btstack_type 2
  664. */
  665. static inline uint16_t hci_event_read_clock_offset_complete_get_clock_offset(const uint8_t *event)
  666. {
  667. return little_endian_read_16(event, 5);
  668. }
  669. /**
  670. * @brief Get field status from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
  671. * @param event packet
  672. * @return status
  673. * @note: btstack_type 1
  674. */
  675. static inline uint8_t hci_event_connection_packet_type_changed_get_status(const uint8_t *event)
  676. {
  677. return event[2];
  678. }
  679. /**
  680. * @brief Get field handle from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
  681. * @param event packet
  682. * @return handle
  683. * @note: btstack_type H
  684. */
  685. static inline hci_con_handle_t hci_event_connection_packet_type_changed_get_handle(const uint8_t *event)
  686. {
  687. return little_endian_read_16(event, 3);
  688. }
  689. /**
  690. * @brief Get field packet_types from event HCI_EVENT_CONNECTION_PACKET_TYPE_CHANGED
  691. * @param event packet
  692. * @return packet_types
  693. * @note: btstack_type 2
  694. */
  695. static inline uint16_t hci_event_connection_packet_type_changed_get_packet_types(const uint8_t *event)
  696. {
  697. return little_endian_read_16(event, 5);
  698. }
  699. /**
  700. * @brief Get field num_responses from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  701. * @param event packet
  702. * @return num_responses
  703. * @note: btstack_type 1
  704. */
  705. static inline uint8_t hci_event_inquiry_result_with_rssi_get_num_responses(const uint8_t *event)
  706. {
  707. return event[2];
  708. }
  709. /**
  710. * @brief Get field bd_addr from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  711. * @param event packet
  712. * @param Pointer to storage for bd_addr
  713. * @note: btstack_type B
  714. */
  715. static inline void hci_event_inquiry_result_with_rssi_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  716. {
  717. reverse_bd_addr(&event[3], bd_addr);
  718. }
  719. /**
  720. * @brief Get field page_scan_repetition_mode from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  721. * @param event packet
  722. * @return page_scan_repetition_mode
  723. * @note: btstack_type 1
  724. */
  725. static inline uint8_t hci_event_inquiry_result_with_rssi_get_page_scan_repetition_mode(const uint8_t *event)
  726. {
  727. return event[9];
  728. }
  729. /**
  730. * @brief Get field reserved from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  731. * @param event packet
  732. * @return reserved
  733. * @note: btstack_type 1
  734. */
  735. static inline uint8_t hci_event_inquiry_result_with_rssi_get_reserved(const uint8_t *event)
  736. {
  737. return event[10];
  738. }
  739. /**
  740. * @brief Get field class_of_device from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  741. * @param event packet
  742. * @return class_of_device
  743. * @note: btstack_type 3
  744. */
  745. static inline uint32_t hci_event_inquiry_result_with_rssi_get_class_of_device(const uint8_t *event)
  746. {
  747. return little_endian_read_24(event, 11);
  748. }
  749. /**
  750. * @brief Get field clock_offset from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  751. * @param event packet
  752. * @return clock_offset
  753. * @note: btstack_type 2
  754. */
  755. static inline uint16_t hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t *event)
  756. {
  757. return little_endian_read_16(event, 14);
  758. }
  759. /**
  760. * @brief Get field rssi from event HCI_EVENT_INQUIRY_RESULT_WITH_RSSI
  761. * @param event packet
  762. * @return rssi
  763. * @note: btstack_type 1
  764. */
  765. static inline uint8_t hci_event_inquiry_result_with_rssi_get_rssi(const uint8_t *event)
  766. {
  767. return event[16];
  768. }
  769. /**
  770. * @brief Get field status from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  771. * @param event packet
  772. * @return status
  773. * @note: btstack_type 1
  774. */
  775. static inline uint8_t hci_event_synchronous_connection_complete_get_status(const uint8_t *event)
  776. {
  777. return event[2];
  778. }
  779. /**
  780. * @brief Get field handle from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  781. * @param event packet
  782. * @return handle
  783. * @note: btstack_type H
  784. */
  785. static inline hci_con_handle_t hci_event_synchronous_connection_complete_get_handle(const uint8_t *event)
  786. {
  787. return little_endian_read_16(event, 3);
  788. }
  789. /**
  790. * @brief Get field bd_addr from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  791. * @param event packet
  792. * @param Pointer to storage for bd_addr
  793. * @note: btstack_type B
  794. */
  795. static inline void hci_event_synchronous_connection_complete_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  796. {
  797. reverse_bd_addr(&event[5], bd_addr);
  798. }
  799. /**
  800. * @brief Get field link_type from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  801. * @param event packet
  802. * @return link_type
  803. * @note: btstack_type 1
  804. */
  805. static inline uint8_t hci_event_synchronous_connection_complete_get_link_type(const uint8_t *event)
  806. {
  807. return event[11];
  808. }
  809. /**
  810. * @brief Get field transmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  811. * @param event packet
  812. * @return transmission_interval
  813. * @note: btstack_type 1
  814. */
  815. static inline uint8_t hci_event_synchronous_connection_complete_get_transmission_interval(const uint8_t *event)
  816. {
  817. return event[12];
  818. }
  819. /**
  820. * @brief Get field retransmission_interval from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  821. * @param event packet
  822. * @return retransmission_interval
  823. * @note: btstack_type 1
  824. */
  825. static inline uint8_t hci_event_synchronous_connection_complete_get_retransmission_interval(const uint8_t *event)
  826. {
  827. return event[13];
  828. }
  829. /**
  830. * @brief Get field rx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  831. * @param event packet
  832. * @return rx_packet_length
  833. * @note: btstack_type 2
  834. */
  835. static inline uint16_t hci_event_synchronous_connection_complete_get_rx_packet_length(const uint8_t *event)
  836. {
  837. return little_endian_read_16(event, 14);
  838. }
  839. /**
  840. * @brief Get field tx_packet_length from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  841. * @param event packet
  842. * @return tx_packet_length
  843. * @note: btstack_type 2
  844. */
  845. static inline uint16_t hci_event_synchronous_connection_complete_get_tx_packet_length(const uint8_t *event)
  846. {
  847. return little_endian_read_16(event, 16);
  848. }
  849. /**
  850. * @brief Get field air_mode from event HCI_EVENT_SYNCHRONOUS_CONNECTION_COMPLETE
  851. * @param event packet
  852. * @return air_mode
  853. * @note: btstack_type 1
  854. */
  855. static inline uint8_t hci_event_synchronous_connection_complete_get_air_mode(const uint8_t *event)
  856. {
  857. return event[18];
  858. }
  859. /**
  860. * @brief Get field num_responses from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  861. * @param event packet
  862. * @return num_responses
  863. * @note: btstack_type 1
  864. */
  865. static inline uint8_t hci_event_extended_inquiry_response_get_num_responses(const uint8_t *event)
  866. {
  867. return event[2];
  868. }
  869. /**
  870. * @brief Get field bd_addr from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  871. * @param event packet
  872. * @param Pointer to storage for bd_addr
  873. * @note: btstack_type B
  874. */
  875. static inline void hci_event_extended_inquiry_response_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  876. {
  877. reverse_bd_addr(&event[3], bd_addr);
  878. }
  879. /**
  880. * @brief Get field page_scan_repetition_mode from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  881. * @param event packet
  882. * @return page_scan_repetition_mode
  883. * @note: btstack_type 1
  884. */
  885. static inline uint8_t hci_event_extended_inquiry_response_get_page_scan_repetition_mode(const uint8_t *event)
  886. {
  887. return event[9];
  888. }
  889. /**
  890. * @brief Get field reserved from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  891. * @param event packet
  892. * @return reserved
  893. * @note: btstack_type 1
  894. */
  895. static inline uint8_t hci_event_extended_inquiry_response_get_reserved(const uint8_t *event)
  896. {
  897. return event[10];
  898. }
  899. /**
  900. * @brief Get field class_of_device from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  901. * @param event packet
  902. * @return class_of_device
  903. * @note: btstack_type 3
  904. */
  905. static inline uint32_t hci_event_extended_inquiry_response_get_class_of_device(const uint8_t *event)
  906. {
  907. return little_endian_read_24(event, 11);
  908. }
  909. /**
  910. * @brief Get field clock_offset from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  911. * @param event packet
  912. * @return clock_offset
  913. * @note: btstack_type 2
  914. */
  915. static inline uint16_t hci_event_extended_inquiry_response_get_clock_offset(const uint8_t *event)
  916. {
  917. return little_endian_read_16(event, 14);
  918. }
  919. /**
  920. * @brief Get field rssi from event HCI_EVENT_EXTENDED_INQUIRY_RESPONSE
  921. * @param event packet
  922. * @return rssi
  923. * @note: btstack_type 1
  924. */
  925. static inline uint8_t hci_event_extended_inquiry_response_get_rssi(const uint8_t *event)
  926. {
  927. return event[16];
  928. }
  929. /**
  930. * @brief Get field status from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE
  931. * @param event packet
  932. * @return status
  933. * @note: btstack_type 1
  934. */
  935. static inline uint8_t hci_event_encryption_key_refresh_complete_get_status(const uint8_t *event)
  936. {
  937. return event[2];
  938. }
  939. /**
  940. * @brief Get field handle from event HCI_EVENT_ENCRYPTION_KEY_REFRESH_COMPLETE
  941. * @param event packet
  942. * @return handle
  943. * @note: btstack_type H
  944. */
  945. static inline hci_con_handle_t hci_event_encryption_key_refresh_complete_get_handle(const uint8_t *event)
  946. {
  947. return little_endian_read_16(event, 3);
  948. }
  949. /**
  950. * @brief Get field bd_addr from event HCI_EVENT_USER_CONFIRMATION_REQUEST
  951. * @param event packet
  952. * @param Pointer to storage for bd_addr
  953. * @note: btstack_type B
  954. */
  955. static inline void hci_event_user_confirmation_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  956. {
  957. reverse_bd_addr(&event[2], bd_addr);
  958. }
  959. /**
  960. * @brief Get field numeric_value from event HCI_EVENT_USER_CONFIRMATION_REQUEST
  961. * @param event packet
  962. * @return numeric_value
  963. * @note: btstack_type 4
  964. */
  965. static inline uint32_t hci_event_user_confirmation_request_get_numeric_value(const uint8_t *event)
  966. {
  967. return little_endian_read_32(event, 8);
  968. }
  969. /**
  970. * @brief Get field bd_addr from event HCI_EVENT_USER_PASSKEY_REQUEST
  971. * @param event packet
  972. * @param Pointer to storage for bd_addr
  973. * @note: btstack_type B
  974. */
  975. static inline void hci_event_user_passkey_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  976. {
  977. reverse_bd_addr(&event[2], bd_addr);
  978. }
  979. /**
  980. * @brief Get field bd_addr from event HCI_EVENT_REMOTE_OOB_DATA_REQUEST
  981. * @param event packet
  982. * @param Pointer to storage for bd_addr
  983. * @note: btstack_type B
  984. */
  985. static inline void hci_event_remote_oob_data_request_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  986. {
  987. reverse_bd_addr(&event[2], bd_addr);
  988. }
  989. /**
  990. * @brief Get field status from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE
  991. * @param event packet
  992. * @return status
  993. * @note: btstack_type 1
  994. */
  995. static inline uint8_t hci_event_simple_pairing_complete_get_status(const uint8_t *event)
  996. {
  997. return event[2];
  998. }
  999. /**
  1000. * @brief Get field bd_addr from event HCI_EVENT_SIMPLE_PAIRING_COMPLETE
  1001. * @param event packet
  1002. * @param Pointer to storage for bd_addr
  1003. * @note: btstack_type B
  1004. */
  1005. static inline void hci_event_simple_pairing_complete_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  1006. {
  1007. reverse_bd_addr(&event[3], bd_addr);
  1008. }
  1009. /**
  1010. * @brief Get field state from event BTSTACK_EVENT_STATE
  1011. * @param event packet
  1012. * @return state
  1013. * @note: btstack_type 1
  1014. */
  1015. static inline uint8_t btstack_event_state_get_state(const uint8_t *event)
  1016. {
  1017. return event[2];
  1018. }
  1019. /**
  1020. * @brief Get field number_connections from event BTSTACK_EVENT_NR_CONNECTIONS_CHANGED
  1021. * @param event packet
  1022. * @return number_connections
  1023. * @note: btstack_type 1
  1024. */
  1025. static inline uint8_t btstack_event_nr_connections_changed_get_number_connections(const uint8_t *event)
  1026. {
  1027. return event[2];
  1028. }
  1029. /**
  1030. * @brief Get field discoverable from event BTSTACK_EVENT_DISCOVERABLE_ENABLED
  1031. * @param event packet
  1032. * @return discoverable
  1033. * @note: btstack_type 1
  1034. */
  1035. static inline uint8_t btstack_event_discoverable_enabled_get_discoverable(const uint8_t *event)
  1036. {
  1037. return event[2];
  1038. }
  1039. /**
  1040. * @brief Get field active from event HCI_EVENT_TRANSPORT_SLEEP_MODE
  1041. * @param event packet
  1042. * @return active
  1043. * @note: btstack_type 1
  1044. */
  1045. static inline uint8_t hci_event_transport_sleep_mode_get_active(const uint8_t *event)
  1046. {
  1047. return event[2];
  1048. }
  1049. /**
  1050. * @brief Get field handle from event HCI_EVENT_SCO_CAN_SEND_NOW
  1051. * @param event packet
  1052. * @param Pointer to storage for handle
  1053. * @note: btstack_type B
  1054. */
  1055. static inline void hci_event_sco_can_send_now_get_handle(const uint8_t *event, bd_addr_t handle)
  1056. {
  1057. reverse_bd_addr(&event[2], handle);
  1058. }
  1059. /**
  1060. * @brief Get field status from event L2CAP_EVENT_CHANNEL_OPENED
  1061. * @param event packet
  1062. * @return status
  1063. * @note: btstack_type 1
  1064. */
  1065. static inline uint8_t l2cap_event_channel_opened_get_status(const uint8_t *event)
  1066. {
  1067. return event[2];
  1068. }
  1069. /**
  1070. * @brief Get field address from event L2CAP_EVENT_CHANNEL_OPENED
  1071. * @param event packet
  1072. * @param Pointer to storage for address
  1073. * @note: btstack_type B
  1074. */
  1075. static inline void l2cap_event_channel_opened_get_address(const uint8_t *event, bd_addr_t address)
  1076. {
  1077. reverse_bd_addr(&event[3], address);
  1078. }
  1079. /**
  1080. * @brief Get field handle from event L2CAP_EVENT_CHANNEL_OPENED
  1081. * @param event packet
  1082. * @return handle
  1083. * @note: btstack_type H
  1084. */
  1085. static inline hci_con_handle_t l2cap_event_channel_opened_get_handle(const uint8_t *event)
  1086. {
  1087. return little_endian_read_16(event, 9);
  1088. }
  1089. /**
  1090. * @brief Get field psm from event L2CAP_EVENT_CHANNEL_OPENED
  1091. * @param event packet
  1092. * @return psm
  1093. * @note: btstack_type 2
  1094. */
  1095. static inline uint16_t l2cap_event_channel_opened_get_psm(const uint8_t *event)
  1096. {
  1097. return little_endian_read_16(event, 11);
  1098. }
  1099. /**
  1100. * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_OPENED
  1101. * @param event packet
  1102. * @return local_cid
  1103. * @note: btstack_type 2
  1104. */
  1105. static inline uint16_t l2cap_event_channel_opened_get_local_cid(const uint8_t *event)
  1106. {
  1107. return little_endian_read_16(event, 13);
  1108. }
  1109. /**
  1110. * @brief Get field remote_cid from event L2CAP_EVENT_CHANNEL_OPENED
  1111. * @param event packet
  1112. * @return remote_cid
  1113. * @note: btstack_type 2
  1114. */
  1115. static inline uint16_t l2cap_event_channel_opened_get_remote_cid(const uint8_t *event)
  1116. {
  1117. return little_endian_read_16(event, 15);
  1118. }
  1119. /**
  1120. * @brief Get field local_mtu from event L2CAP_EVENT_CHANNEL_OPENED
  1121. * @param event packet
  1122. * @return local_mtu
  1123. * @note: btstack_type 2
  1124. */
  1125. static inline uint16_t l2cap_event_channel_opened_get_local_mtu(const uint8_t *event)
  1126. {
  1127. return little_endian_read_16(event, 17);
  1128. }
  1129. /**
  1130. * @brief Get field remote_mtu from event L2CAP_EVENT_CHANNEL_OPENED
  1131. * @param event packet
  1132. * @return remote_mtu
  1133. * @note: btstack_type 2
  1134. */
  1135. static inline uint16_t l2cap_event_channel_opened_get_remote_mtu(const uint8_t *event)
  1136. {
  1137. return little_endian_read_16(event, 19);
  1138. }
  1139. /**
  1140. * @brief Get field flush_timeout from event L2CAP_EVENT_CHANNEL_OPENED
  1141. * @param event packet
  1142. * @return flush_timeout
  1143. * @note: btstack_type 2
  1144. */
  1145. static inline uint16_t l2cap_event_channel_opened_get_flush_timeout(const uint8_t *event)
  1146. {
  1147. return little_endian_read_16(event, 21);
  1148. }
  1149. /**
  1150. * @brief Get field incoming from event L2CAP_EVENT_CHANNEL_OPENED
  1151. * @param event packet
  1152. * @return incoming
  1153. * @note: btstack_type 1
  1154. */
  1155. static inline uint8_t l2cap_event_channel_opened_get_incoming(const uint8_t *event)
  1156. {
  1157. return event[23];
  1158. }
  1159. /**
  1160. * @brief Get field local_cid from event L2CAP_EVENT_CHANNEL_CLOSED
  1161. * @param event packet
  1162. * @return local_cid
  1163. * @note: btstack_type 2
  1164. */
  1165. static inline uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t *event)
  1166. {
  1167. return little_endian_read_16(event, 2);
  1168. }
  1169. /**
  1170. * @brief Get field address from event L2CAP_EVENT_INCOMING_CONNECTION
  1171. * @param event packet
  1172. * @param Pointer to storage for address
  1173. * @note: btstack_type B
  1174. */
  1175. static inline void l2cap_event_incoming_connection_get_address(const uint8_t *event, bd_addr_t address)
  1176. {
  1177. reverse_bd_addr(&event[2], address);
  1178. }
  1179. /**
  1180. * @brief Get field handle from event L2CAP_EVENT_INCOMING_CONNECTION
  1181. * @param event packet
  1182. * @return handle
  1183. * @note: btstack_type H
  1184. */
  1185. static inline hci_con_handle_t l2cap_event_incoming_connection_get_handle(const uint8_t *event)
  1186. {
  1187. return little_endian_read_16(event, 8);
  1188. }
  1189. /**
  1190. * @brief Get field psm from event L2CAP_EVENT_INCOMING_CONNECTION
  1191. * @param event packet
  1192. * @return psm
  1193. * @note: btstack_type 2
  1194. */
  1195. static inline uint16_t l2cap_event_incoming_connection_get_psm(const uint8_t *event)
  1196. {
  1197. return little_endian_read_16(event, 10);
  1198. }
  1199. /**
  1200. * @brief Get field local_cid from event L2CAP_EVENT_INCOMING_CONNECTION
  1201. * @param event packet
  1202. * @return local_cid
  1203. * @note: btstack_type 2
  1204. */
  1205. static inline uint16_t l2cap_event_incoming_connection_get_local_cid(const uint8_t *event)
  1206. {
  1207. return little_endian_read_16(event, 12);
  1208. }
  1209. /**
  1210. * @brief Get field remote_cid from event L2CAP_EVENT_INCOMING_CONNECTION
  1211. * @param event packet
  1212. * @return remote_cid
  1213. * @note: btstack_type 2
  1214. */
  1215. static inline uint16_t l2cap_event_incoming_connection_get_remote_cid(const uint8_t *event)
  1216. {
  1217. return little_endian_read_16(event, 14);
  1218. }
  1219. /**
  1220. * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
  1221. * @param event packet
  1222. * @return handle
  1223. * @note: btstack_type H
  1224. */
  1225. static inline hci_con_handle_t l2cap_event_connection_parameter_update_request_get_handle(const uint8_t *event)
  1226. {
  1227. return little_endian_read_16(event, 2);
  1228. }
  1229. /**
  1230. * @brief Get field interval_min from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
  1231. * @param event packet
  1232. * @return interval_min
  1233. * @note: btstack_type 2
  1234. */
  1235. static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_min(const uint8_t *event)
  1236. {
  1237. return little_endian_read_16(event, 4);
  1238. }
  1239. /**
  1240. * @brief Get field interval_max from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
  1241. * @param event packet
  1242. * @return interval_max
  1243. * @note: btstack_type 2
  1244. */
  1245. static inline uint16_t l2cap_event_connection_parameter_update_request_get_interval_max(const uint8_t *event)
  1246. {
  1247. return little_endian_read_16(event, 6);
  1248. }
  1249. /**
  1250. * @brief Get field latencey from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
  1251. * @param event packet
  1252. * @return latencey
  1253. * @note: btstack_type 2
  1254. */
  1255. static inline uint16_t l2cap_event_connection_parameter_update_request_get_latencey(const uint8_t *event)
  1256. {
  1257. return little_endian_read_16(event, 8);
  1258. }
  1259. /**
  1260. * @brief Get field timeout_multiplier from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_REQUEST
  1261. * @param event packet
  1262. * @return timeout_multiplier
  1263. * @note: btstack_type 2
  1264. */
  1265. static inline uint16_t l2cap_event_connection_parameter_update_request_get_timeout_multiplier(const uint8_t *event)
  1266. {
  1267. return little_endian_read_16(event, 10);
  1268. }
  1269. /**
  1270. * @brief Get field handle from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE
  1271. * @param event packet
  1272. * @return handle
  1273. * @note: btstack_type H
  1274. */
  1275. static inline hci_con_handle_t l2cap_event_connection_parameter_update_response_get_handle(const uint8_t *event)
  1276. {
  1277. return little_endian_read_16(event, 2);
  1278. }
  1279. /**
  1280. * @brief Get field result from event L2CAP_EVENT_CONNECTION_PARAMETER_UPDATE_RESPONSE
  1281. * @param event packet
  1282. * @return result
  1283. * @note: btstack_type 2
  1284. */
  1285. static inline uint16_t l2cap_event_connection_parameter_update_response_get_result(const uint8_t *event)
  1286. {
  1287. return little_endian_read_16(event, 4);
  1288. }
  1289. /**
  1290. * @brief Get field local_cid from event L2CAP_EVENT_CAN_SEND_NOW
  1291. * @param event packet
  1292. * @return local_cid
  1293. * @note: btstack_type 2
  1294. */
  1295. static inline uint16_t l2cap_event_can_send_now_get_local_cid(const uint8_t *event)
  1296. {
  1297. return little_endian_read_16(event, 2);
  1298. }
  1299. /**
  1300. * @brief Get field address_type from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1301. * @param event packet
  1302. * @return address_type
  1303. * @note: btstack_type 1
  1304. */
  1305. static inline uint8_t l2cap_event_le_incoming_connection_get_address_type(const uint8_t *event)
  1306. {
  1307. return event[2];
  1308. }
  1309. /**
  1310. * @brief Get field address from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1311. * @param event packet
  1312. * @param Pointer to storage for address
  1313. * @note: btstack_type B
  1314. */
  1315. static inline void l2cap_event_le_incoming_connection_get_address(const uint8_t *event, bd_addr_t address)
  1316. {
  1317. reverse_bd_addr(&event[3], address);
  1318. }
  1319. /**
  1320. * @brief Get field handle from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1321. * @param event packet
  1322. * @return handle
  1323. * @note: btstack_type H
  1324. */
  1325. static inline hci_con_handle_t l2cap_event_le_incoming_connection_get_handle(const uint8_t *event)
  1326. {
  1327. return little_endian_read_16(event, 9);
  1328. }
  1329. /**
  1330. * @brief Get field psm from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1331. * @param event packet
  1332. * @return psm
  1333. * @note: btstack_type 2
  1334. */
  1335. static inline uint16_t l2cap_event_le_incoming_connection_get_psm(const uint8_t *event)
  1336. {
  1337. return little_endian_read_16(event, 11);
  1338. }
  1339. /**
  1340. * @brief Get field local_cid from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1341. * @param event packet
  1342. * @return local_cid
  1343. * @note: btstack_type 2
  1344. */
  1345. static inline uint16_t l2cap_event_le_incoming_connection_get_local_cid(const uint8_t *event)
  1346. {
  1347. return little_endian_read_16(event, 13);
  1348. }
  1349. /**
  1350. * @brief Get field remote_cid from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1351. * @param event packet
  1352. * @return remote_cid
  1353. * @note: btstack_type 2
  1354. */
  1355. static inline uint16_t l2cap_event_le_incoming_connection_get_remote_cid(const uint8_t *event)
  1356. {
  1357. return little_endian_read_16(event, 15);
  1358. }
  1359. /**
  1360. * @brief Get field remote_mtu from event L2CAP_EVENT_LE_INCOMING_CONNECTION
  1361. * @param event packet
  1362. * @return remote_mtu
  1363. * @note: btstack_type 2
  1364. */
  1365. static inline uint16_t l2cap_event_le_incoming_connection_get_remote_mtu(const uint8_t *event)
  1366. {
  1367. return little_endian_read_16(event, 17);
  1368. }
  1369. /**
  1370. * @brief Get field status from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1371. * @param event packet
  1372. * @return status
  1373. * @note: btstack_type 1
  1374. */
  1375. static inline uint8_t l2cap_event_le_channel_opened_get_status(const uint8_t *event)
  1376. {
  1377. return event[2];
  1378. }
  1379. /**
  1380. * @brief Get field address_type from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1381. * @param event packet
  1382. * @return address_type
  1383. * @note: btstack_type 1
  1384. */
  1385. static inline uint8_t l2cap_event_le_channel_opened_get_address_type(const uint8_t *event)
  1386. {
  1387. return event[3];
  1388. }
  1389. /**
  1390. * @brief Get field address from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1391. * @param event packet
  1392. * @param Pointer to storage for address
  1393. * @note: btstack_type B
  1394. */
  1395. static inline void l2cap_event_le_channel_opened_get_address(const uint8_t *event, bd_addr_t address)
  1396. {
  1397. reverse_bd_addr(&event[4], address);
  1398. }
  1399. /**
  1400. * @brief Get field handle from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1401. * @param event packet
  1402. * @return handle
  1403. * @note: btstack_type H
  1404. */
  1405. static inline hci_con_handle_t l2cap_event_le_channel_opened_get_handle(const uint8_t *event)
  1406. {
  1407. return little_endian_read_16(event, 10);
  1408. }
  1409. /**
  1410. * @brief Get field incoming from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1411. * @param event packet
  1412. * @return incoming
  1413. * @note: btstack_type 1
  1414. */
  1415. static inline uint8_t l2cap_event_le_channel_opened_get_incoming(const uint8_t *event)
  1416. {
  1417. return event[12];
  1418. }
  1419. /**
  1420. * @brief Get field psm from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1421. * @param event packet
  1422. * @return psm
  1423. * @note: btstack_type 2
  1424. */
  1425. static inline uint16_t l2cap_event_le_channel_opened_get_psm(const uint8_t *event)
  1426. {
  1427. return little_endian_read_16(event, 13);
  1428. }
  1429. /**
  1430. * @brief Get field local_cid from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1431. * @param event packet
  1432. * @return local_cid
  1433. * @note: btstack_type 2
  1434. */
  1435. static inline uint16_t l2cap_event_le_channel_opened_get_local_cid(const uint8_t *event)
  1436. {
  1437. return little_endian_read_16(event, 15);
  1438. }
  1439. /**
  1440. * @brief Get field remote_cid from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1441. * @param event packet
  1442. * @return remote_cid
  1443. * @note: btstack_type 2
  1444. */
  1445. static inline uint16_t l2cap_event_le_channel_opened_get_remote_cid(const uint8_t *event)
  1446. {
  1447. return little_endian_read_16(event, 17);
  1448. }
  1449. /**
  1450. * @brief Get field local_mtu from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1451. * @param event packet
  1452. * @return local_mtu
  1453. * @note: btstack_type 2
  1454. */
  1455. static inline uint16_t l2cap_event_le_channel_opened_get_local_mtu(const uint8_t *event)
  1456. {
  1457. return little_endian_read_16(event, 19);
  1458. }
  1459. /**
  1460. * @brief Get field remote_mtu from event L2CAP_EVENT_LE_CHANNEL_OPENED
  1461. * @param event packet
  1462. * @return remote_mtu
  1463. * @note: btstack_type 2
  1464. */
  1465. static inline uint16_t l2cap_event_le_channel_opened_get_remote_mtu(const uint8_t *event)
  1466. {
  1467. return little_endian_read_16(event, 21);
  1468. }
  1469. /**
  1470. * @brief Get field local_cid from event L2CAP_EVENT_LE_CHANNEL_CLOSED
  1471. * @param event packet
  1472. * @return local_cid
  1473. * @note: btstack_type 2
  1474. */
  1475. static inline uint16_t l2cap_event_le_channel_closed_get_local_cid(const uint8_t *event)
  1476. {
  1477. return little_endian_read_16(event, 2);
  1478. }
  1479. /**
  1480. * @brief Get field local_cid from event L2CAP_EVENT_LE_CAN_SEND_NOW
  1481. * @param event packet
  1482. * @return local_cid
  1483. * @note: btstack_type 2
  1484. */
  1485. static inline uint16_t l2cap_event_le_can_send_now_get_local_cid(const uint8_t *event)
  1486. {
  1487. return little_endian_read_16(event, 2);
  1488. }
  1489. /**
  1490. * @brief Get field local_cid from event L2CAP_EVENT_LE_PACKET_SENT
  1491. * @param event packet
  1492. * @return local_cid
  1493. * @note: btstack_type 2
  1494. */
  1495. static inline uint16_t l2cap_event_le_packet_sent_get_local_cid(const uint8_t *event)
  1496. {
  1497. return little_endian_read_16(event, 2);
  1498. }
  1499. /**
  1500. * @brief Get field status from event RFCOMM_EVENT_CHANNEL_OPENED
  1501. * @param event packet
  1502. * @return status
  1503. * @note: btstack_type 1
  1504. */
  1505. static inline uint8_t rfcomm_event_channel_opened_get_status(const uint8_t *event)
  1506. {
  1507. return event[2];
  1508. }
  1509. /**
  1510. * @brief Get field bd_addr from event RFCOMM_EVENT_CHANNEL_OPENED
  1511. * @param event packet
  1512. * @param Pointer to storage for bd_addr
  1513. * @note: btstack_type B
  1514. */
  1515. static inline void rfcomm_event_channel_opened_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  1516. {
  1517. reverse_bd_addr(&event[3], bd_addr);
  1518. }
  1519. /**
  1520. * @brief Get field con_handle from event RFCOMM_EVENT_CHANNEL_OPENED
  1521. * @param event packet
  1522. * @return con_handle
  1523. * @note: btstack_type 2
  1524. */
  1525. static inline uint16_t rfcomm_event_channel_opened_get_con_handle(const uint8_t *event)
  1526. {
  1527. return little_endian_read_16(event, 9);
  1528. }
  1529. /**
  1530. * @brief Get field server_channel from event RFCOMM_EVENT_CHANNEL_OPENED
  1531. * @param event packet
  1532. * @return server_channel
  1533. * @note: btstack_type 1
  1534. */
  1535. static inline uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t *event)
  1536. {
  1537. return event[11];
  1538. }
  1539. /**
  1540. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_OPENED
  1541. * @param event packet
  1542. * @return rfcomm_cid
  1543. * @note: btstack_type 2
  1544. */
  1545. static inline uint16_t rfcomm_event_channel_opened_get_rfcomm_cid(const uint8_t *event)
  1546. {
  1547. return little_endian_read_16(event, 12);
  1548. }
  1549. /**
  1550. * @brief Get field max_frame_size from event RFCOMM_EVENT_CHANNEL_OPENED
  1551. * @param event packet
  1552. * @return max_frame_size
  1553. * @note: btstack_type 2
  1554. */
  1555. static inline uint16_t rfcomm_event_channel_opened_get_max_frame_size(const uint8_t *event)
  1556. {
  1557. return little_endian_read_16(event, 14);
  1558. }
  1559. /**
  1560. * @brief Get field incoming from event RFCOMM_EVENT_CHANNEL_OPENED
  1561. * @param event packet
  1562. * @return incoming
  1563. * @note: btstack_type 1
  1564. */
  1565. static inline uint8_t rfcomm_event_channel_opened_get_incoming(const uint8_t *event)
  1566. {
  1567. return event[16];
  1568. }
  1569. /**
  1570. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CHANNEL_CLOSED
  1571. * @param event packet
  1572. * @return rfcomm_cid
  1573. * @note: btstack_type 2
  1574. */
  1575. static inline uint16_t rfcomm_event_channel_closed_get_rfcomm_cid(const uint8_t *event)
  1576. {
  1577. return little_endian_read_16(event, 2);
  1578. }
  1579. /**
  1580. * @brief Get field bd_addr from event RFCOMM_EVENT_INCOMING_CONNECTION
  1581. * @param event packet
  1582. * @param Pointer to storage for bd_addr
  1583. * @note: btstack_type B
  1584. */
  1585. static inline void rfcomm_event_incoming_connection_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  1586. {
  1587. reverse_bd_addr(&event[2], bd_addr);
  1588. }
  1589. /**
  1590. * @brief Get field server_channel from event RFCOMM_EVENT_INCOMING_CONNECTION
  1591. * @param event packet
  1592. * @return server_channel
  1593. * @note: btstack_type 1
  1594. */
  1595. static inline uint8_t rfcomm_event_incoming_connection_get_server_channel(const uint8_t *event)
  1596. {
  1597. return event[8];
  1598. }
  1599. /**
  1600. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_INCOMING_CONNECTION
  1601. * @param event packet
  1602. * @return rfcomm_cid
  1603. * @note: btstack_type 2
  1604. */
  1605. static inline uint16_t rfcomm_event_incoming_connection_get_rfcomm_cid(const uint8_t *event)
  1606. {
  1607. return little_endian_read_16(event, 9);
  1608. }
  1609. /**
  1610. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_LINE_STATUS
  1611. * @param event packet
  1612. * @return rfcomm_cid
  1613. * @note: btstack_type 2
  1614. */
  1615. static inline uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t *event)
  1616. {
  1617. return little_endian_read_16(event, 2);
  1618. }
  1619. /**
  1620. * @brief Get field line_status from event RFCOMM_EVENT_REMOTE_LINE_STATUS
  1621. * @param event packet
  1622. * @return line_status
  1623. * @note: btstack_type 1
  1624. */
  1625. static inline uint8_t rfcomm_event_remote_line_status_get_line_status(const uint8_t *event)
  1626. {
  1627. return event[4];
  1628. }
  1629. /**
  1630. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_REMOTE_MODEM_STATUS
  1631. * @param event packet
  1632. * @return rfcomm_cid
  1633. * @note: btstack_type 2
  1634. */
  1635. static inline uint16_t rfcomm_event_remote_modem_status_get_rfcomm_cid(const uint8_t *event)
  1636. {
  1637. return little_endian_read_16(event, 2);
  1638. }
  1639. /**
  1640. * @brief Get field modem_status from event RFCOMM_EVENT_REMOTE_MODEM_STATUS
  1641. * @param event packet
  1642. * @return modem_status
  1643. * @note: btstack_type 1
  1644. */
  1645. static inline uint8_t rfcomm_event_remote_modem_status_get_modem_status(const uint8_t *event)
  1646. {
  1647. return event[4];
  1648. }
  1649. /**
  1650. * @brief Get field rfcomm_cid from event RFCOMM_EVENT_CAN_SEND_NOW
  1651. * @param event packet
  1652. * @return rfcomm_cid
  1653. * @note: btstack_type 2
  1654. */
  1655. static inline uint16_t rfcomm_event_can_send_now_get_rfcomm_cid(const uint8_t *event)
  1656. {
  1657. return little_endian_read_16(event, 2);
  1658. }
  1659. /**
  1660. * @brief Get field status from event SDP_EVENT_QUERY_COMPLETE
  1661. * @param event packet
  1662. * @return status
  1663. * @note: btstack_type 1
  1664. */
  1665. static inline uint8_t sdp_event_query_complete_get_status(const uint8_t *event)
  1666. {
  1667. return event[2];
  1668. }
  1669. /**
  1670. * @brief Get field rfcomm_channel from event SDP_EVENT_QUERY_RFCOMM_SERVICE
  1671. * @param event packet
  1672. * @return rfcomm_channel
  1673. * @note: btstack_type 1
  1674. */
  1675. static inline uint8_t sdp_event_query_rfcomm_service_get_rfcomm_channel(const uint8_t *event)
  1676. {
  1677. return event[2];
  1678. }
  1679. /**
  1680. * @brief Get field name from event SDP_EVENT_QUERY_RFCOMM_SERVICE
  1681. * @param event packet
  1682. * @return name
  1683. * @note: btstack_type T
  1684. */
  1685. static inline const char *sdp_event_query_rfcomm_service_get_name(const uint8_t *event)
  1686. {
  1687. return (const char *) &event[3];
  1688. }
  1689. /**
  1690. * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
  1691. * @param event packet
  1692. * @return record_id
  1693. * @note: btstack_type 2
  1694. */
  1695. static inline uint16_t sdp_event_query_attribute_byte_get_record_id(const uint8_t *event)
  1696. {
  1697. return little_endian_read_16(event, 2);
  1698. }
  1699. /**
  1700. * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
  1701. * @param event packet
  1702. * @return attribute_id
  1703. * @note: btstack_type 2
  1704. */
  1705. static inline uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t *event)
  1706. {
  1707. return little_endian_read_16(event, 4);
  1708. }
  1709. /**
  1710. * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
  1711. * @param event packet
  1712. * @return attribute_length
  1713. * @note: btstack_type 2
  1714. */
  1715. static inline uint16_t sdp_event_query_attribute_byte_get_attribute_length(const uint8_t *event)
  1716. {
  1717. return little_endian_read_16(event, 6);
  1718. }
  1719. /**
  1720. * @brief Get field data_offset from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
  1721. * @param event packet
  1722. * @return data_offset
  1723. * @note: btstack_type 2
  1724. */
  1725. static inline uint16_t sdp_event_query_attribute_byte_get_data_offset(const uint8_t *event)
  1726. {
  1727. return little_endian_read_16(event, 8);
  1728. }
  1729. /**
  1730. * @brief Get field data from event SDP_EVENT_QUERY_ATTRIBUTE_BYTE
  1731. * @param event packet
  1732. * @return data
  1733. * @note: btstack_type 1
  1734. */
  1735. static inline uint8_t sdp_event_query_attribute_byte_get_data(const uint8_t *event)
  1736. {
  1737. return event[10];
  1738. }
  1739. /**
  1740. * @brief Get field record_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
  1741. * @param event packet
  1742. * @return record_id
  1743. * @note: btstack_type 2
  1744. */
  1745. static inline uint16_t sdp_event_query_attribute_value_get_record_id(const uint8_t *event)
  1746. {
  1747. return little_endian_read_16(event, 2);
  1748. }
  1749. /**
  1750. * @brief Get field attribute_id from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
  1751. * @param event packet
  1752. * @return attribute_id
  1753. * @note: btstack_type 2
  1754. */
  1755. static inline uint16_t sdp_event_query_attribute_value_get_attribute_id(const uint8_t *event)
  1756. {
  1757. return little_endian_read_16(event, 4);
  1758. }
  1759. /**
  1760. * @brief Get field attribute_length from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
  1761. * @param event packet
  1762. * @return attribute_length
  1763. * @note: btstack_type L
  1764. */
  1765. static inline int sdp_event_query_attribute_value_get_attribute_length(const uint8_t *event)
  1766. {
  1767. return little_endian_read_16(event, 6);
  1768. }
  1769. /**
  1770. * @brief Get field attribute_value from event SDP_EVENT_QUERY_ATTRIBUTE_VALUE
  1771. * @param event packet
  1772. * @return attribute_value
  1773. * @note: btstack_type V
  1774. */
  1775. static inline const uint8_t *sdp_event_query_attribute_value_get_attribute_value(const uint8_t *event)
  1776. {
  1777. return &event[8];
  1778. }
  1779. /**
  1780. * @brief Get field total_count from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
  1781. * @param event packet
  1782. * @return total_count
  1783. * @note: btstack_type 2
  1784. */
  1785. static inline uint16_t sdp_event_query_service_record_handle_get_total_count(const uint8_t *event)
  1786. {
  1787. return little_endian_read_16(event, 2);
  1788. }
  1789. /**
  1790. * @brief Get field record_index from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
  1791. * @param event packet
  1792. * @return record_index
  1793. * @note: btstack_type 2
  1794. */
  1795. static inline uint16_t sdp_event_query_service_record_handle_get_record_index(const uint8_t *event)
  1796. {
  1797. return little_endian_read_16(event, 4);
  1798. }
  1799. /**
  1800. * @brief Get field record_handle from event SDP_EVENT_QUERY_SERVICE_RECORD_HANDLE
  1801. * @param event packet
  1802. * @return record_handle
  1803. * @note: btstack_type 4
  1804. */
  1805. static inline uint32_t sdp_event_query_service_record_handle_get_record_handle(const uint8_t *event)
  1806. {
  1807. return little_endian_read_32(event, 6);
  1808. }
  1809. #ifdef ENABLE_BLE
  1810. /**
  1811. * @brief Get field handle from event GATT_EVENT_QUERY_COMPLETE
  1812. * @param event packet
  1813. * @return handle
  1814. * @note: btstack_type H
  1815. */
  1816. static inline hci_con_handle_t gatt_event_query_complete_get_handle(const uint8_t *event)
  1817. {
  1818. return little_endian_read_16(event, 2);
  1819. }
  1820. /**
  1821. * @brief Get field status from event GATT_EVENT_QUERY_COMPLETE
  1822. * @param event packet
  1823. * @return status
  1824. * @note: btstack_type 1
  1825. */
  1826. static inline uint8_t gatt_event_query_complete_get_status(const uint8_t *event)
  1827. {
  1828. return event[4];
  1829. }
  1830. #endif
  1831. #ifdef ENABLE_BLE
  1832. /**
  1833. * @brief Get field handle from event GATT_EVENT_SERVICE_QUERY_RESULT
  1834. * @param event packet
  1835. * @return handle
  1836. * @note: btstack_type H
  1837. */
  1838. static inline hci_con_handle_t gatt_event_service_query_result_get_handle(const uint8_t *event)
  1839. {
  1840. return little_endian_read_16(event, 2);
  1841. }
  1842. /**
  1843. * @brief Get field service from event GATT_EVENT_SERVICE_QUERY_RESULT
  1844. * @param event packet
  1845. * @param Pointer to storage for service
  1846. * @note: btstack_type X
  1847. */
  1848. static inline void gatt_event_service_query_result_get_service(const uint8_t *event, gatt_client_service_t *service)
  1849. {
  1850. gatt_client_deserialize_service(event, 4, service);
  1851. }
  1852. #endif
  1853. #ifdef ENABLE_BLE
  1854. /**
  1855. * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT
  1856. * @param event packet
  1857. * @return handle
  1858. * @note: btstack_type H
  1859. */
  1860. static inline hci_con_handle_t gatt_event_characteristic_query_result_get_handle(const uint8_t *event)
  1861. {
  1862. return little_endian_read_16(event, 2);
  1863. }
  1864. /**
  1865. * @brief Get field characteristic from event GATT_EVENT_CHARACTERISTIC_QUERY_RESULT
  1866. * @param event packet
  1867. * @param Pointer to storage for characteristic
  1868. * @note: btstack_type Y
  1869. */
  1870. static inline void gatt_event_characteristic_query_result_get_characteristic(const uint8_t *event, gatt_client_characteristic_t *characteristic)
  1871. {
  1872. gatt_client_deserialize_characteristic(event, 4, characteristic);
  1873. }
  1874. #endif
  1875. #ifdef ENABLE_BLE
  1876. /**
  1877. * @brief Get field handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
  1878. * @param event packet
  1879. * @return handle
  1880. * @note: btstack_type H
  1881. */
  1882. static inline hci_con_handle_t gatt_event_included_service_query_result_get_handle(const uint8_t *event)
  1883. {
  1884. return little_endian_read_16(event, 2);
  1885. }
  1886. /**
  1887. * @brief Get field include_handle from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
  1888. * @param event packet
  1889. * @return include_handle
  1890. * @note: btstack_type 2
  1891. */
  1892. static inline uint16_t gatt_event_included_service_query_result_get_include_handle(const uint8_t *event)
  1893. {
  1894. return little_endian_read_16(event, 4);
  1895. }
  1896. /**
  1897. * @brief Get field service from event GATT_EVENT_INCLUDED_SERVICE_QUERY_RESULT
  1898. * @param event packet
  1899. * @param Pointer to storage for service
  1900. * @note: btstack_type X
  1901. */
  1902. static inline void gatt_event_included_service_query_result_get_service(const uint8_t *event, gatt_client_service_t *service)
  1903. {
  1904. gatt_client_deserialize_service(event, 6, service);
  1905. }
  1906. #endif
  1907. #ifdef ENABLE_BLE
  1908. /**
  1909. * @brief Get field handle from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT
  1910. * @param event packet
  1911. * @return handle
  1912. * @note: btstack_type H
  1913. */
  1914. static inline hci_con_handle_t gatt_event_all_characteristic_descriptors_query_result_get_handle(const uint8_t *event)
  1915. {
  1916. return little_endian_read_16(event, 2);
  1917. }
  1918. /**
  1919. * @brief Get field characteristic_descriptor from event GATT_EVENT_ALL_CHARACTERISTIC_DESCRIPTORS_QUERY_RESULT
  1920. * @param event packet
  1921. * @param Pointer to storage for characteristic_descriptor
  1922. * @note: btstack_type Z
  1923. */
  1924. static inline void gatt_event_all_characteristic_descriptors_query_result_get_characteristic_descriptor(const uint8_t *event, gatt_client_characteristic_descriptor_t *characteristic_descriptor)
  1925. {
  1926. gatt_client_deserialize_characteristic_descriptor(event, 4, characteristic_descriptor);
  1927. }
  1928. #endif
  1929. #ifdef ENABLE_BLE
  1930. /**
  1931. * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
  1932. * @param event packet
  1933. * @return handle
  1934. * @note: btstack_type H
  1935. */
  1936. static inline hci_con_handle_t gatt_event_characteristic_value_query_result_get_handle(const uint8_t *event)
  1937. {
  1938. return little_endian_read_16(event, 2);
  1939. }
  1940. /**
  1941. * @brief Get field value_handle from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
  1942. * @param event packet
  1943. * @return value_handle
  1944. * @note: btstack_type 2
  1945. */
  1946. static inline uint16_t gatt_event_characteristic_value_query_result_get_value_handle(const uint8_t *event)
  1947. {
  1948. return little_endian_read_16(event, 4);
  1949. }
  1950. /**
  1951. * @brief Get field value_length from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
  1952. * @param event packet
  1953. * @return value_length
  1954. * @note: btstack_type L
  1955. */
  1956. static inline int gatt_event_characteristic_value_query_result_get_value_length(const uint8_t *event)
  1957. {
  1958. return little_endian_read_16(event, 6);
  1959. }
  1960. /**
  1961. * @brief Get field value from event GATT_EVENT_CHARACTERISTIC_VALUE_QUERY_RESULT
  1962. * @param event packet
  1963. * @return value
  1964. * @note: btstack_type V
  1965. */
  1966. static inline const uint8_t *gatt_event_characteristic_value_query_result_get_value(const uint8_t *event)
  1967. {
  1968. return &event[8];
  1969. }
  1970. #endif
  1971. #ifdef ENABLE_BLE
  1972. /**
  1973. * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
  1974. * @param event packet
  1975. * @return handle
  1976. * @note: btstack_type H
  1977. */
  1978. static inline hci_con_handle_t gatt_event_long_characteristic_value_query_result_get_handle(const uint8_t *event)
  1979. {
  1980. return little_endian_read_16(event, 2);
  1981. }
  1982. /**
  1983. * @brief Get field value_handle from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
  1984. * @param event packet
  1985. * @return value_handle
  1986. * @note: btstack_type 2
  1987. */
  1988. static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_handle(const uint8_t *event)
  1989. {
  1990. return little_endian_read_16(event, 4);
  1991. }
  1992. /**
  1993. * @brief Get field value_offset from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
  1994. * @param event packet
  1995. * @return value_offset
  1996. * @note: btstack_type 2
  1997. */
  1998. static inline uint16_t gatt_event_long_characteristic_value_query_result_get_value_offset(const uint8_t *event)
  1999. {
  2000. return little_endian_read_16(event, 6);
  2001. }
  2002. /**
  2003. * @brief Get field value_length from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
  2004. * @param event packet
  2005. * @return value_length
  2006. * @note: btstack_type L
  2007. */
  2008. static inline int gatt_event_long_characteristic_value_query_result_get_value_length(const uint8_t *event)
  2009. {
  2010. return little_endian_read_16(event, 8);
  2011. }
  2012. /**
  2013. * @brief Get field value from event GATT_EVENT_LONG_CHARACTERISTIC_VALUE_QUERY_RESULT
  2014. * @param event packet
  2015. * @return value
  2016. * @note: btstack_type V
  2017. */
  2018. static inline const uint8_t *gatt_event_long_characteristic_value_query_result_get_value(const uint8_t *event)
  2019. {
  2020. return &event[10];
  2021. }
  2022. #endif
  2023. #ifdef ENABLE_BLE
  2024. /**
  2025. * @brief Get field handle from event GATT_EVENT_NOTIFICATION
  2026. * @param event packet
  2027. * @return handle
  2028. * @note: btstack_type H
  2029. */
  2030. static inline hci_con_handle_t gatt_event_notification_get_handle(const uint8_t *event)
  2031. {
  2032. return little_endian_read_16(event, 2);
  2033. }
  2034. /**
  2035. * @brief Get field value_handle from event GATT_EVENT_NOTIFICATION
  2036. * @param event packet
  2037. * @return value_handle
  2038. * @note: btstack_type 2
  2039. */
  2040. static inline uint16_t gatt_event_notification_get_value_handle(const uint8_t *event)
  2041. {
  2042. return little_endian_read_16(event, 4);
  2043. }
  2044. /**
  2045. * @brief Get field value_length from event GATT_EVENT_NOTIFICATION
  2046. * @param event packet
  2047. * @return value_length
  2048. * @note: btstack_type L
  2049. */
  2050. static inline int gatt_event_notification_get_value_length(const uint8_t *event)
  2051. {
  2052. return little_endian_read_16(event, 6);
  2053. }
  2054. /**
  2055. * @brief Get field value from event GATT_EVENT_NOTIFICATION
  2056. * @param event packet
  2057. * @return value
  2058. * @note: btstack_type V
  2059. */
  2060. static inline const uint8_t *gatt_event_notification_get_value(const uint8_t *event)
  2061. {
  2062. return &event[8];
  2063. }
  2064. #endif
  2065. #ifdef ENABLE_BLE
  2066. /**
  2067. * @brief Get field handle from event GATT_EVENT_INDICATION
  2068. * @param event packet
  2069. * @return handle
  2070. * @note: btstack_type H
  2071. */
  2072. static inline hci_con_handle_t gatt_event_indication_get_handle(const uint8_t *event)
  2073. {
  2074. return little_endian_read_16(event, 2);
  2075. }
  2076. /**
  2077. * @brief Get field value_handle from event GATT_EVENT_INDICATION
  2078. * @param event packet
  2079. * @return value_handle
  2080. * @note: btstack_type 2
  2081. */
  2082. static inline uint16_t gatt_event_indication_get_value_handle(const uint8_t *event)
  2083. {
  2084. return little_endian_read_16(event, 4);
  2085. }
  2086. /**
  2087. * @brief Get field value_length from event GATT_EVENT_INDICATION
  2088. * @param event packet
  2089. * @return value_length
  2090. * @note: btstack_type L
  2091. */
  2092. static inline int gatt_event_indication_get_value_length(const uint8_t *event)
  2093. {
  2094. return little_endian_read_16(event, 6);
  2095. }
  2096. /**
  2097. * @brief Get field value from event GATT_EVENT_INDICATION
  2098. * @param event packet
  2099. * @return value
  2100. * @note: btstack_type V
  2101. */
  2102. static inline const uint8_t *gatt_event_indication_get_value(const uint8_t *event)
  2103. {
  2104. return &event[8];
  2105. }
  2106. #endif
  2107. #ifdef ENABLE_BLE
  2108. /**
  2109. * @brief Get field handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2110. * @param event packet
  2111. * @return handle
  2112. * @note: btstack_type H
  2113. */
  2114. static inline hci_con_handle_t gatt_event_characteristic_descriptor_query_result_get_handle(const uint8_t *event)
  2115. {
  2116. return little_endian_read_16(event, 2);
  2117. }
  2118. /**
  2119. * @brief Get field descriptor_handle from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2120. * @param event packet
  2121. * @return descriptor_handle
  2122. * @note: btstack_type 2
  2123. */
  2124. static inline uint16_t gatt_event_characteristic_descriptor_query_result_get_descriptor_handle(const uint8_t *event)
  2125. {
  2126. return little_endian_read_16(event, 4);
  2127. }
  2128. /**
  2129. * @brief Get field descriptor_length from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2130. * @param event packet
  2131. * @return descriptor_length
  2132. * @note: btstack_type L
  2133. */
  2134. static inline int gatt_event_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t *event)
  2135. {
  2136. return little_endian_read_16(event, 6);
  2137. }
  2138. /**
  2139. * @brief Get field descriptor from event GATT_EVENT_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2140. * @param event packet
  2141. * @return descriptor
  2142. * @note: btstack_type V
  2143. */
  2144. static inline const uint8_t *gatt_event_characteristic_descriptor_query_result_get_descriptor(const uint8_t *event)
  2145. {
  2146. return &event[8];
  2147. }
  2148. #endif
  2149. #ifdef ENABLE_BLE
  2150. /**
  2151. * @brief Get field handle from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2152. * @param event packet
  2153. * @return handle
  2154. * @note: btstack_type H
  2155. */
  2156. static inline hci_con_handle_t gatt_event_long_characteristic_descriptor_query_result_get_handle(const uint8_t *event)
  2157. {
  2158. return little_endian_read_16(event, 2);
  2159. }
  2160. /**
  2161. * @brief Get field descriptor_offset from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2162. * @param event packet
  2163. * @return descriptor_offset
  2164. * @note: btstack_type 2
  2165. */
  2166. static inline uint16_t gatt_event_long_characteristic_descriptor_query_result_get_descriptor_offset(const uint8_t *event)
  2167. {
  2168. return little_endian_read_16(event, 4);
  2169. }
  2170. /**
  2171. * @brief Get field descriptor_length from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2172. * @param event packet
  2173. * @return descriptor_length
  2174. * @note: btstack_type L
  2175. */
  2176. static inline int gatt_event_long_characteristic_descriptor_query_result_get_descriptor_length(const uint8_t *event)
  2177. {
  2178. return little_endian_read_16(event, 6);
  2179. }
  2180. /**
  2181. * @brief Get field descriptor from event GATT_EVENT_LONG_CHARACTERISTIC_DESCRIPTOR_QUERY_RESULT
  2182. * @param event packet
  2183. * @return descriptor
  2184. * @note: btstack_type V
  2185. */
  2186. static inline const uint8_t *gatt_event_long_characteristic_descriptor_query_result_get_descriptor(const uint8_t *event)
  2187. {
  2188. return &event[8];
  2189. }
  2190. #endif
  2191. #ifdef ENABLE_BLE
  2192. /**
  2193. * @brief Get field handle from event GATT_EVENT_MTU
  2194. * @param event packet
  2195. * @return handle
  2196. * @note: btstack_type H
  2197. */
  2198. static inline hci_con_handle_t gatt_event_mtu_get_handle(const uint8_t *event)
  2199. {
  2200. return little_endian_read_16(event, 2);
  2201. }
  2202. /**
  2203. * @brief Get field MTU from event GATT_EVENT_MTU
  2204. * @param event packet
  2205. * @return MTU
  2206. * @note: btstack_type 2
  2207. */
  2208. static inline uint16_t gatt_event_mtu_get_MTU(const uint8_t *event)
  2209. {
  2210. return little_endian_read_16(event, 4);
  2211. }
  2212. #endif
  2213. /**
  2214. * @brief Get field handle from event ATT_EVENT_MTU_EXCHANGE_COMPLETE
  2215. * @param event packet
  2216. * @return handle
  2217. * @note: btstack_type H
  2218. */
  2219. static inline hci_con_handle_t att_event_mtu_exchange_complete_get_handle(const uint8_t *event)
  2220. {
  2221. return little_endian_read_16(event, 2);
  2222. }
  2223. /**
  2224. * @brief Get field MTU from event ATT_EVENT_MTU_EXCHANGE_COMPLETE
  2225. * @param event packet
  2226. * @return MTU
  2227. * @note: btstack_type 2
  2228. */
  2229. static inline uint16_t att_event_mtu_exchange_complete_get_MTU(const uint8_t *event)
  2230. {
  2231. return little_endian_read_16(event, 4);
  2232. }
  2233. /**
  2234. * @brief Get field status from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
  2235. * @param event packet
  2236. * @return status
  2237. * @note: btstack_type 1
  2238. */
  2239. static inline uint8_t att_event_handle_value_indication_complete_get_status(const uint8_t *event)
  2240. {
  2241. return event[2];
  2242. }
  2243. /**
  2244. * @brief Get field conn_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
  2245. * @param event packet
  2246. * @return conn_handle
  2247. * @note: btstack_type H
  2248. */
  2249. static inline hci_con_handle_t att_event_handle_value_indication_complete_get_conn_handle(const uint8_t *event)
  2250. {
  2251. return little_endian_read_16(event, 3);
  2252. }
  2253. /**
  2254. * @brief Get field attribute_handle from event ATT_EVENT_HANDLE_VALUE_INDICATION_COMPLETE
  2255. * @param event packet
  2256. * @return attribute_handle
  2257. * @note: btstack_type 2
  2258. */
  2259. static inline uint16_t att_event_handle_value_indication_complete_get_attribute_handle(const uint8_t *event)
  2260. {
  2261. return little_endian_read_16(event, 5);
  2262. }
  2263. /**
  2264. * @brief Get field status from event BNEP_EVENT_SERVICE_REGISTERED
  2265. * @param event packet
  2266. * @return status
  2267. * @note: btstack_type 1
  2268. */
  2269. static inline uint8_t bnep_event_service_registered_get_status(const uint8_t *event)
  2270. {
  2271. return event[2];
  2272. }
  2273. /**
  2274. * @brief Get field service_uuid from event BNEP_EVENT_SERVICE_REGISTERED
  2275. * @param event packet
  2276. * @return service_uuid
  2277. * @note: btstack_type 2
  2278. */
  2279. static inline uint16_t bnep_event_service_registered_get_service_uuid(const uint8_t *event)
  2280. {
  2281. return little_endian_read_16(event, 3);
  2282. }
  2283. /**
  2284. * @brief Get field status from event BNEP_EVENT_CHANNEL_OPENED
  2285. * @param event packet
  2286. * @return status
  2287. * @note: btstack_type 1
  2288. */
  2289. static inline uint8_t bnep_event_channel_opened_get_status(const uint8_t *event)
  2290. {
  2291. return event[2];
  2292. }
  2293. /**
  2294. * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_OPENED
  2295. * @param event packet
  2296. * @return bnep_cid
  2297. * @note: btstack_type 2
  2298. */
  2299. static inline uint16_t bnep_event_channel_opened_get_bnep_cid(const uint8_t *event)
  2300. {
  2301. return little_endian_read_16(event, 3);
  2302. }
  2303. /**
  2304. * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_OPENED
  2305. * @param event packet
  2306. * @return source_uuid
  2307. * @note: btstack_type 2
  2308. */
  2309. static inline uint16_t bnep_event_channel_opened_get_source_uuid(const uint8_t *event)
  2310. {
  2311. return little_endian_read_16(event, 5);
  2312. }
  2313. /**
  2314. * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_OPENED
  2315. * @param event packet
  2316. * @return destination_uuid
  2317. * @note: btstack_type 2
  2318. */
  2319. static inline uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t *event)
  2320. {
  2321. return little_endian_read_16(event, 7);
  2322. }
  2323. /**
  2324. * @brief Get field mtu from event BNEP_EVENT_CHANNEL_OPENED
  2325. * @param event packet
  2326. * @return mtu
  2327. * @note: btstack_type 2
  2328. */
  2329. static inline uint16_t bnep_event_channel_opened_get_mtu(const uint8_t *event)
  2330. {
  2331. return little_endian_read_16(event, 9);
  2332. }
  2333. /**
  2334. * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_OPENED
  2335. * @param event packet
  2336. * @param Pointer to storage for remote_address
  2337. * @note: btstack_type B
  2338. */
  2339. static inline void bnep_event_channel_opened_get_remote_address(const uint8_t *event, bd_addr_t remote_address)
  2340. {
  2341. reverse_bd_addr(&event[11], remote_address);
  2342. }
  2343. /**
  2344. * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_CLOSED
  2345. * @param event packet
  2346. * @return bnep_cid
  2347. * @note: btstack_type 2
  2348. */
  2349. static inline uint16_t bnep_event_channel_closed_get_bnep_cid(const uint8_t *event)
  2350. {
  2351. return little_endian_read_16(event, 2);
  2352. }
  2353. /**
  2354. * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_CLOSED
  2355. * @param event packet
  2356. * @return source_uuid
  2357. * @note: btstack_type 2
  2358. */
  2359. static inline uint16_t bnep_event_channel_closed_get_source_uuid(const uint8_t *event)
  2360. {
  2361. return little_endian_read_16(event, 4);
  2362. }
  2363. /**
  2364. * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_CLOSED
  2365. * @param event packet
  2366. * @return destination_uuid
  2367. * @note: btstack_type 2
  2368. */
  2369. static inline uint16_t bnep_event_channel_closed_get_destination_uuid(const uint8_t *event)
  2370. {
  2371. return little_endian_read_16(event, 6);
  2372. }
  2373. /**
  2374. * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_CLOSED
  2375. * @param event packet
  2376. * @param Pointer to storage for remote_address
  2377. * @note: btstack_type B
  2378. */
  2379. static inline void bnep_event_channel_closed_get_remote_address(const uint8_t *event, bd_addr_t remote_address)
  2380. {
  2381. reverse_bd_addr(&event[8], remote_address);
  2382. }
  2383. /**
  2384. * @brief Get field bnep_cid from event BNEP_EVENT_CHANNEL_TIMEOUT
  2385. * @param event packet
  2386. * @return bnep_cid
  2387. * @note: btstack_type 2
  2388. */
  2389. static inline uint16_t bnep_event_channel_timeout_get_bnep_cid(const uint8_t *event)
  2390. {
  2391. return little_endian_read_16(event, 2);
  2392. }
  2393. /**
  2394. * @brief Get field source_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT
  2395. * @param event packet
  2396. * @return source_uuid
  2397. * @note: btstack_type 2
  2398. */
  2399. static inline uint16_t bnep_event_channel_timeout_get_source_uuid(const uint8_t *event)
  2400. {
  2401. return little_endian_read_16(event, 4);
  2402. }
  2403. /**
  2404. * @brief Get field destination_uuid from event BNEP_EVENT_CHANNEL_TIMEOUT
  2405. * @param event packet
  2406. * @return destination_uuid
  2407. * @note: btstack_type 2
  2408. */
  2409. static inline uint16_t bnep_event_channel_timeout_get_destination_uuid(const uint8_t *event)
  2410. {
  2411. return little_endian_read_16(event, 6);
  2412. }
  2413. /**
  2414. * @brief Get field remote_address from event BNEP_EVENT_CHANNEL_TIMEOUT
  2415. * @param event packet
  2416. * @param Pointer to storage for remote_address
  2417. * @note: btstack_type B
  2418. */
  2419. static inline void bnep_event_channel_timeout_get_remote_address(const uint8_t *event, bd_addr_t remote_address)
  2420. {
  2421. reverse_bd_addr(&event[8], remote_address);
  2422. }
  2423. /**
  2424. * @brief Get field channel_state from event BNEP_EVENT_CHANNEL_TIMEOUT
  2425. * @param event packet
  2426. * @return channel_state
  2427. * @note: btstack_type 1
  2428. */
  2429. static inline uint8_t bnep_event_channel_timeout_get_channel_state(const uint8_t *event)
  2430. {
  2431. return event[14];
  2432. }
  2433. /**
  2434. * @brief Get field bnep_cid from event BNEP_EVENT_CAN_SEND_NOW
  2435. * @param event packet
  2436. * @return bnep_cid
  2437. * @note: btstack_type 2
  2438. */
  2439. static inline uint16_t bnep_event_can_send_now_get_bnep_cid(const uint8_t *event)
  2440. {
  2441. return little_endian_read_16(event, 2);
  2442. }
  2443. /**
  2444. * @brief Get field source_uuid from event BNEP_EVENT_CAN_SEND_NOW
  2445. * @param event packet
  2446. * @return source_uuid
  2447. * @note: btstack_type 2
  2448. */
  2449. static inline uint16_t bnep_event_can_send_now_get_source_uuid(const uint8_t *event)
  2450. {
  2451. return little_endian_read_16(event, 4);
  2452. }
  2453. /**
  2454. * @brief Get field destination_uuid from event BNEP_EVENT_CAN_SEND_NOW
  2455. * @param event packet
  2456. * @return destination_uuid
  2457. * @note: btstack_type 2
  2458. */
  2459. static inline uint16_t bnep_event_can_send_now_get_destination_uuid(const uint8_t *event)
  2460. {
  2461. return little_endian_read_16(event, 6);
  2462. }
  2463. /**
  2464. * @brief Get field remote_address from event BNEP_EVENT_CAN_SEND_NOW
  2465. * @param event packet
  2466. * @param Pointer to storage for remote_address
  2467. * @note: btstack_type B
  2468. */
  2469. static inline void bnep_event_can_send_now_get_remote_address(const uint8_t *event, bd_addr_t remote_address)
  2470. {
  2471. reverse_bd_addr(&event[8], remote_address);
  2472. }
  2473. #ifdef ENABLE_BLE
  2474. /**
  2475. * @brief Get field handle from event SM_EVENT_JUST_WORKS_REQUEST
  2476. * @param event packet
  2477. * @return handle
  2478. * @note: btstack_type H
  2479. */
  2480. static inline hci_con_handle_t sm_event_just_works_request_get_handle(const uint8_t *event)
  2481. {
  2482. return little_endian_read_16(event, 2);
  2483. }
  2484. /**
  2485. * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_REQUEST
  2486. * @param event packet
  2487. * @return addr_type
  2488. * @note: btstack_type 1
  2489. */
  2490. static inline uint8_t sm_event_just_works_request_get_addr_type(const uint8_t *event)
  2491. {
  2492. return event[4];
  2493. }
  2494. /**
  2495. * @brief Get field address from event SM_EVENT_JUST_WORKS_REQUEST
  2496. * @param event packet
  2497. * @param Pointer to storage for address
  2498. * @note: btstack_type B
  2499. */
  2500. static inline void sm_event_just_works_request_get_address(const uint8_t *event, bd_addr_t address)
  2501. {
  2502. reverse_bd_addr(&event[5], address);
  2503. }
  2504. #endif
  2505. #ifdef ENABLE_BLE
  2506. /**
  2507. * @brief Get field handle from event SM_EVENT_JUST_WORKS_CANCEL
  2508. * @param event packet
  2509. * @return handle
  2510. * @note: btstack_type H
  2511. */
  2512. static inline hci_con_handle_t sm_event_just_works_cancel_get_handle(const uint8_t *event)
  2513. {
  2514. return little_endian_read_16(event, 2);
  2515. }
  2516. /**
  2517. * @brief Get field addr_type from event SM_EVENT_JUST_WORKS_CANCEL
  2518. * @param event packet
  2519. * @return addr_type
  2520. * @note: btstack_type 1
  2521. */
  2522. static inline uint8_t sm_event_just_works_cancel_get_addr_type(const uint8_t *event)
  2523. {
  2524. return event[4];
  2525. }
  2526. /**
  2527. * @brief Get field address from event SM_EVENT_JUST_WORKS_CANCEL
  2528. * @param event packet
  2529. * @param Pointer to storage for address
  2530. * @note: btstack_type B
  2531. */
  2532. static inline void sm_event_just_works_cancel_get_address(const uint8_t *event, bd_addr_t address)
  2533. {
  2534. reverse_bd_addr(&event[5], address);
  2535. }
  2536. #endif
  2537. #ifdef ENABLE_BLE
  2538. /**
  2539. * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
  2540. * @param event packet
  2541. * @return handle
  2542. * @note: btstack_type H
  2543. */
  2544. static inline hci_con_handle_t sm_event_passkey_display_number_get_handle(const uint8_t *event)
  2545. {
  2546. return little_endian_read_16(event, 2);
  2547. }
  2548. /**
  2549. * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
  2550. * @param event packet
  2551. * @return addr_type
  2552. * @note: btstack_type 1
  2553. */
  2554. static inline uint8_t sm_event_passkey_display_number_get_addr_type(const uint8_t *event)
  2555. {
  2556. return event[4];
  2557. }
  2558. /**
  2559. * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
  2560. * @param event packet
  2561. * @param Pointer to storage for address
  2562. * @note: btstack_type B
  2563. */
  2564. static inline void sm_event_passkey_display_number_get_address(const uint8_t *event, bd_addr_t address)
  2565. {
  2566. reverse_bd_addr(&event[5], address);
  2567. }
  2568. /**
  2569. * @brief Get field passkey from event SM_EVENT_PASSKEY_DISPLAY_NUMBER
  2570. * @param event packet
  2571. * @return passkey
  2572. * @note: btstack_type 4
  2573. */
  2574. static inline uint32_t sm_event_passkey_display_number_get_passkey(const uint8_t *event)
  2575. {
  2576. return little_endian_read_32(event, 11);
  2577. }
  2578. #endif
  2579. #ifdef ENABLE_BLE
  2580. /**
  2581. * @brief Get field handle from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
  2582. * @param event packet
  2583. * @return handle
  2584. * @note: btstack_type H
  2585. */
  2586. static inline hci_con_handle_t sm_event_passkey_display_cancel_get_handle(const uint8_t *event)
  2587. {
  2588. return little_endian_read_16(event, 2);
  2589. }
  2590. /**
  2591. * @brief Get field addr_type from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
  2592. * @param event packet
  2593. * @return addr_type
  2594. * @note: btstack_type 1
  2595. */
  2596. static inline uint8_t sm_event_passkey_display_cancel_get_addr_type(const uint8_t *event)
  2597. {
  2598. return event[4];
  2599. }
  2600. /**
  2601. * @brief Get field address from event SM_EVENT_PASSKEY_DISPLAY_CANCEL
  2602. * @param event packet
  2603. * @param Pointer to storage for address
  2604. * @note: btstack_type B
  2605. */
  2606. static inline void sm_event_passkey_display_cancel_get_address(const uint8_t *event, bd_addr_t address)
  2607. {
  2608. reverse_bd_addr(&event[5], address);
  2609. }
  2610. #endif
  2611. #ifdef ENABLE_BLE
  2612. /**
  2613. * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_NUMBER
  2614. * @param event packet
  2615. * @return handle
  2616. * @note: btstack_type H
  2617. */
  2618. static inline hci_con_handle_t sm_event_passkey_input_number_get_handle(const uint8_t *event)
  2619. {
  2620. return little_endian_read_16(event, 2);
  2621. }
  2622. /**
  2623. * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_NUMBER
  2624. * @param event packet
  2625. * @return addr_type
  2626. * @note: btstack_type 1
  2627. */
  2628. static inline uint8_t sm_event_passkey_input_number_get_addr_type(const uint8_t *event)
  2629. {
  2630. return event[4];
  2631. }
  2632. /**
  2633. * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_NUMBER
  2634. * @param event packet
  2635. * @param Pointer to storage for address
  2636. * @note: btstack_type B
  2637. */
  2638. static inline void sm_event_passkey_input_number_get_address(const uint8_t *event, bd_addr_t address)
  2639. {
  2640. reverse_bd_addr(&event[5], address);
  2641. }
  2642. #endif
  2643. #ifdef ENABLE_BLE
  2644. /**
  2645. * @brief Get field handle from event SM_EVENT_PASSKEY_INPUT_CANCEL
  2646. * @param event packet
  2647. * @return handle
  2648. * @note: btstack_type H
  2649. */
  2650. static inline hci_con_handle_t sm_event_passkey_input_cancel_get_handle(const uint8_t *event)
  2651. {
  2652. return little_endian_read_16(event, 2);
  2653. }
  2654. /**
  2655. * @brief Get field addr_type from event SM_EVENT_PASSKEY_INPUT_CANCEL
  2656. * @param event packet
  2657. * @return addr_type
  2658. * @note: btstack_type 1
  2659. */
  2660. static inline uint8_t sm_event_passkey_input_cancel_get_addr_type(const uint8_t *event)
  2661. {
  2662. return event[4];
  2663. }
  2664. /**
  2665. * @brief Get field address from event SM_EVENT_PASSKEY_INPUT_CANCEL
  2666. * @param event packet
  2667. * @param Pointer to storage for address
  2668. * @note: btstack_type B
  2669. */
  2670. static inline void sm_event_passkey_input_cancel_get_address(const uint8_t *event, bd_addr_t address)
  2671. {
  2672. reverse_bd_addr(&event[5], address);
  2673. }
  2674. #endif
  2675. #ifdef ENABLE_BLE
  2676. /**
  2677. * @brief Get field handle from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
  2678. * @param event packet
  2679. * @return handle
  2680. * @note: btstack_type H
  2681. */
  2682. static inline hci_con_handle_t sm_event_numeric_comparison_request_get_handle(const uint8_t *event)
  2683. {
  2684. return little_endian_read_16(event, 2);
  2685. }
  2686. /**
  2687. * @brief Get field addr_type from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
  2688. * @param event packet
  2689. * @return addr_type
  2690. * @note: btstack_type 1
  2691. */
  2692. static inline uint8_t sm_event_numeric_comparison_request_get_addr_type(const uint8_t *event)
  2693. {
  2694. return event[4];
  2695. }
  2696. /**
  2697. * @brief Get field address from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
  2698. * @param event packet
  2699. * @param Pointer to storage for address
  2700. * @note: btstack_type B
  2701. */
  2702. static inline void sm_event_numeric_comparison_request_get_address(const uint8_t *event, bd_addr_t address)
  2703. {
  2704. reverse_bd_addr(&event[5], address);
  2705. }
  2706. /**
  2707. * @brief Get field passkey from event SM_EVENT_NUMERIC_COMPARISON_REQUEST
  2708. * @param event packet
  2709. * @return passkey
  2710. * @note: btstack_type 4
  2711. */
  2712. static inline uint32_t sm_event_numeric_comparison_request_get_passkey(const uint8_t *event)
  2713. {
  2714. return little_endian_read_32(event, 11);
  2715. }
  2716. #endif
  2717. #ifdef ENABLE_BLE
  2718. /**
  2719. * @brief Get field handle from event SM_EVENT_NUMERIC_COMPARISON_CANCEL
  2720. * @param event packet
  2721. * @return handle
  2722. * @note: btstack_type H
  2723. */
  2724. static inline hci_con_handle_t sm_event_numeric_comparison_cancel_get_handle(const uint8_t *event)
  2725. {
  2726. return little_endian_read_16(event, 2);
  2727. }
  2728. /**
  2729. * @brief Get field addr_type from event SM_EVENT_NUMERIC_COMPARISON_CANCEL
  2730. * @param event packet
  2731. * @return addr_type
  2732. * @note: btstack_type 1
  2733. */
  2734. static inline uint8_t sm_event_numeric_comparison_cancel_get_addr_type(const uint8_t *event)
  2735. {
  2736. return event[4];
  2737. }
  2738. /**
  2739. * @brief Get field address from event SM_EVENT_NUMERIC_COMPARISON_CANCEL
  2740. * @param event packet
  2741. * @param Pointer to storage for address
  2742. * @note: btstack_type B
  2743. */
  2744. static inline void sm_event_numeric_comparison_cancel_get_address(const uint8_t *event, bd_addr_t address)
  2745. {
  2746. reverse_bd_addr(&event[5], address);
  2747. }
  2748. #endif
  2749. #ifdef ENABLE_BLE
  2750. /**
  2751. * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_STARTED
  2752. * @param event packet
  2753. * @return handle
  2754. * @note: btstack_type H
  2755. */
  2756. static inline hci_con_handle_t sm_event_identity_resolving_started_get_handle(const uint8_t *event)
  2757. {
  2758. return little_endian_read_16(event, 2);
  2759. }
  2760. /**
  2761. * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_STARTED
  2762. * @param event packet
  2763. * @return addr_type
  2764. * @note: btstack_type 1
  2765. */
  2766. static inline uint8_t sm_event_identity_resolving_started_get_addr_type(const uint8_t *event)
  2767. {
  2768. return event[4];
  2769. }
  2770. /**
  2771. * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_STARTED
  2772. * @param event packet
  2773. * @param Pointer to storage for address
  2774. * @note: btstack_type B
  2775. */
  2776. static inline void sm_event_identity_resolving_started_get_address(const uint8_t *event, bd_addr_t address)
  2777. {
  2778. reverse_bd_addr(&event[5], address);
  2779. }
  2780. #endif
  2781. #ifdef ENABLE_BLE
  2782. /**
  2783. * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_FAILED
  2784. * @param event packet
  2785. * @return handle
  2786. * @note: btstack_type H
  2787. */
  2788. static inline hci_con_handle_t sm_event_identity_resolving_failed_get_handle(const uint8_t *event)
  2789. {
  2790. return little_endian_read_16(event, 2);
  2791. }
  2792. /**
  2793. * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_FAILED
  2794. * @param event packet
  2795. * @return addr_type
  2796. * @note: btstack_type 1
  2797. */
  2798. static inline uint8_t sm_event_identity_resolving_failed_get_addr_type(const uint8_t *event)
  2799. {
  2800. return event[4];
  2801. }
  2802. /**
  2803. * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_FAILED
  2804. * @param event packet
  2805. * @param Pointer to storage for address
  2806. * @note: btstack_type B
  2807. */
  2808. static inline void sm_event_identity_resolving_failed_get_address(const uint8_t *event, bd_addr_t address)
  2809. {
  2810. reverse_bd_addr(&event[5], address);
  2811. }
  2812. #endif
  2813. #ifdef ENABLE_BLE
  2814. /**
  2815. * @brief Get field handle from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2816. * @param event packet
  2817. * @return handle
  2818. * @note: btstack_type H
  2819. */
  2820. static inline hci_con_handle_t sm_event_identity_resolving_succeeded_get_handle(const uint8_t *event)
  2821. {
  2822. return little_endian_read_16(event, 2);
  2823. }
  2824. /**
  2825. * @brief Get field addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2826. * @param event packet
  2827. * @return addr_type
  2828. * @note: btstack_type 1
  2829. */
  2830. static inline uint8_t sm_event_identity_resolving_succeeded_get_addr_type(const uint8_t *event)
  2831. {
  2832. return event[4];
  2833. }
  2834. /**
  2835. * @brief Get field address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2836. * @param event packet
  2837. * @param Pointer to storage for address
  2838. * @note: btstack_type B
  2839. */
  2840. static inline void sm_event_identity_resolving_succeeded_get_address(const uint8_t *event, bd_addr_t address)
  2841. {
  2842. reverse_bd_addr(&event[5], address);
  2843. }
  2844. /**
  2845. * @brief Get field identity_addr_type from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2846. * @param event packet
  2847. * @return identity_addr_type
  2848. * @note: btstack_type 1
  2849. */
  2850. static inline uint8_t sm_event_identity_resolving_succeeded_get_identity_addr_type(const uint8_t *event)
  2851. {
  2852. return event[11];
  2853. }
  2854. /**
  2855. * @brief Get field identity_address from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2856. * @param event packet
  2857. * @param Pointer to storage for identity_address
  2858. * @note: btstack_type B
  2859. */
  2860. static inline void sm_event_identity_resolving_succeeded_get_identity_address(const uint8_t *event, bd_addr_t identity_address)
  2861. {
  2862. reverse_bd_addr(&event[12], identity_address);
  2863. }
  2864. /**
  2865. * @brief Get field index_internal from event SM_EVENT_IDENTITY_RESOLVING_SUCCEEDED
  2866. * @param event packet
  2867. * @return index_internal
  2868. * @note: btstack_type 2
  2869. */
  2870. static inline uint16_t sm_event_identity_resolving_succeeded_get_index_internal(const uint8_t *event)
  2871. {
  2872. return little_endian_read_16(event, 18);
  2873. }
  2874. #endif
  2875. #ifdef ENABLE_BLE
  2876. /**
  2877. * @brief Get field handle from event SM_EVENT_AUTHORIZATION_REQUEST
  2878. * @param event packet
  2879. * @return handle
  2880. * @note: btstack_type H
  2881. */
  2882. static inline hci_con_handle_t sm_event_authorization_request_get_handle(const uint8_t *event)
  2883. {
  2884. return little_endian_read_16(event, 2);
  2885. }
  2886. /**
  2887. * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_REQUEST
  2888. * @param event packet
  2889. * @return addr_type
  2890. * @note: btstack_type 1
  2891. */
  2892. static inline uint8_t sm_event_authorization_request_get_addr_type(const uint8_t *event)
  2893. {
  2894. return event[4];
  2895. }
  2896. /**
  2897. * @brief Get field address from event SM_EVENT_AUTHORIZATION_REQUEST
  2898. * @param event packet
  2899. * @param Pointer to storage for address
  2900. * @note: btstack_type B
  2901. */
  2902. static inline void sm_event_authorization_request_get_address(const uint8_t *event, bd_addr_t address)
  2903. {
  2904. reverse_bd_addr(&event[5], address);
  2905. }
  2906. #endif
  2907. #ifdef ENABLE_BLE
  2908. /**
  2909. * @brief Get field handle from event SM_EVENT_AUTHORIZATION_RESULT
  2910. * @param event packet
  2911. * @return handle
  2912. * @note: btstack_type H
  2913. */
  2914. static inline hci_con_handle_t sm_event_authorization_result_get_handle(const uint8_t *event)
  2915. {
  2916. return little_endian_read_16(event, 2);
  2917. }
  2918. /**
  2919. * @brief Get field addr_type from event SM_EVENT_AUTHORIZATION_RESULT
  2920. * @param event packet
  2921. * @return addr_type
  2922. * @note: btstack_type 1
  2923. */
  2924. static inline uint8_t sm_event_authorization_result_get_addr_type(const uint8_t *event)
  2925. {
  2926. return event[4];
  2927. }
  2928. /**
  2929. * @brief Get field address from event SM_EVENT_AUTHORIZATION_RESULT
  2930. * @param event packet
  2931. * @param Pointer to storage for address
  2932. * @note: btstack_type B
  2933. */
  2934. static inline void sm_event_authorization_result_get_address(const uint8_t *event, bd_addr_t address)
  2935. {
  2936. reverse_bd_addr(&event[5], address);
  2937. }
  2938. /**
  2939. * @brief Get field authorization_result from event SM_EVENT_AUTHORIZATION_RESULT
  2940. * @param event packet
  2941. * @return authorization_result
  2942. * @note: btstack_type 1
  2943. */
  2944. static inline uint8_t sm_event_authorization_result_get_authorization_result(const uint8_t *event)
  2945. {
  2946. return event[11];
  2947. }
  2948. #endif
  2949. #ifdef ENABLE_BLE
  2950. /**
  2951. * @brief Get field handle from event SM_EVENT_KEYPRESS_NOTIFICATION
  2952. * @param event packet
  2953. * @return handle
  2954. * @note: btstack_type H
  2955. */
  2956. static inline hci_con_handle_t sm_event_keypress_notification_get_handle(const uint8_t *event)
  2957. {
  2958. return little_endian_read_16(event, 2);
  2959. }
  2960. /**
  2961. * @brief Get field action from event SM_EVENT_KEYPRESS_NOTIFICATION
  2962. * @param event packet
  2963. * @return action
  2964. * @note: btstack_type 1
  2965. */
  2966. static inline uint8_t sm_event_keypress_notification_get_action(const uint8_t *event)
  2967. {
  2968. return event[4];
  2969. }
  2970. #endif
  2971. #ifdef ENABLE_BLE
  2972. /**
  2973. * @brief Get field handle from event SM_EVENT_IDENTITY_CREATED
  2974. * @param event packet
  2975. * @return handle
  2976. * @note: btstack_type H
  2977. */
  2978. static inline hci_con_handle_t sm_event_identity_created_get_handle(const uint8_t *event)
  2979. {
  2980. return little_endian_read_16(event, 2);
  2981. }
  2982. /**
  2983. * @brief Get field addr_type from event SM_EVENT_IDENTITY_CREATED
  2984. * @param event packet
  2985. * @return addr_type
  2986. * @note: btstack_type 1
  2987. */
  2988. static inline uint8_t sm_event_identity_created_get_addr_type(const uint8_t *event)
  2989. {
  2990. return event[4];
  2991. }
  2992. /**
  2993. * @brief Get field address from event SM_EVENT_IDENTITY_CREATED
  2994. * @param event packet
  2995. * @param Pointer to storage for address
  2996. * @note: btstack_type B
  2997. */
  2998. static inline void sm_event_identity_created_get_address(const uint8_t *event, bd_addr_t address)
  2999. {
  3000. reverse_bd_addr(&event[5], address);
  3001. }
  3002. /**
  3003. * @brief Get field identity_addr_type from event SM_EVENT_IDENTITY_CREATED
  3004. * @param event packet
  3005. * @return identity_addr_type
  3006. * @note: btstack_type 1
  3007. */
  3008. static inline uint8_t sm_event_identity_created_get_identity_addr_type(const uint8_t *event)
  3009. {
  3010. return event[11];
  3011. }
  3012. /**
  3013. * @brief Get field identity_address from event SM_EVENT_IDENTITY_CREATED
  3014. * @param event packet
  3015. * @param Pointer to storage for identity_address
  3016. * @note: btstack_type B
  3017. */
  3018. static inline void sm_event_identity_created_get_identity_address(const uint8_t *event, bd_addr_t identity_address)
  3019. {
  3020. reverse_bd_addr(&event[12], identity_address);
  3021. }
  3022. #endif
  3023. /**
  3024. * @brief Get field handle from event GAP_EVENT_SECURITY_LEVEL
  3025. * @param event packet
  3026. * @return handle
  3027. * @note: btstack_type H
  3028. */
  3029. static inline hci_con_handle_t gap_event_security_level_get_handle(const uint8_t *event)
  3030. {
  3031. return little_endian_read_16(event, 2);
  3032. }
  3033. /**
  3034. * @brief Get field security_level from event GAP_EVENT_SECURITY_LEVEL
  3035. * @param event packet
  3036. * @return security_level
  3037. * @note: btstack_type 1
  3038. */
  3039. static inline uint8_t gap_event_security_level_get_security_level(const uint8_t *event)
  3040. {
  3041. return event[4];
  3042. }
  3043. /**
  3044. * @brief Get field status from event GAP_EVENT_DEDICATED_BONDING_COMPLETED
  3045. * @param event packet
  3046. * @return status
  3047. * @note: btstack_type 1
  3048. */
  3049. static inline uint8_t gap_event_dedicated_bonding_completed_get_status(const uint8_t *event)
  3050. {
  3051. return event[2];
  3052. }
  3053. /**
  3054. * @brief Get field address from event GAP_EVENT_DEDICATED_BONDING_COMPLETED
  3055. * @param event packet
  3056. * @param Pointer to storage for address
  3057. * @note: btstack_type B
  3058. */
  3059. static inline void gap_event_dedicated_bonding_completed_get_address(const uint8_t *event, bd_addr_t address)
  3060. {
  3061. reverse_bd_addr(&event[3], address);
  3062. }
  3063. /**
  3064. * @brief Get field advertising_event_type from event GAP_EVENT_ADVERTISING_REPORT
  3065. * @param event packet
  3066. * @return advertising_event_type
  3067. * @note: btstack_type 1
  3068. */
  3069. static inline uint8_t gap_event_advertising_report_get_advertising_event_type(const uint8_t *event)
  3070. {
  3071. return event[2];
  3072. }
  3073. /**
  3074. * @brief Get field address_type from event GAP_EVENT_ADVERTISING_REPORT
  3075. * @param event packet
  3076. * @return address_type
  3077. * @note: btstack_type 1
  3078. */
  3079. static inline uint8_t gap_event_advertising_report_get_address_type(const uint8_t *event)
  3080. {
  3081. return event[3];
  3082. }
  3083. /**
  3084. * @brief Get field address from event GAP_EVENT_ADVERTISING_REPORT
  3085. * @param event packet
  3086. * @param Pointer to storage for address
  3087. * @note: btstack_type B
  3088. */
  3089. static inline void gap_event_advertising_report_get_address(const uint8_t *event, bd_addr_t address)
  3090. {
  3091. reverse_bd_addr(&event[4], address);
  3092. }
  3093. /**
  3094. * @brief Get field rssi from event GAP_EVENT_ADVERTISING_REPORT
  3095. * @param event packet
  3096. * @return rssi
  3097. * @note: btstack_type 1
  3098. */
  3099. static inline uint8_t gap_event_advertising_report_get_rssi(const uint8_t *event)
  3100. {
  3101. return event[10];
  3102. }
  3103. /**
  3104. * @brief Get field data_length from event GAP_EVENT_ADVERTISING_REPORT
  3105. * @param event packet
  3106. * @return data_length
  3107. * @note: btstack_type J
  3108. */
  3109. static inline int gap_event_advertising_report_get_data_length(const uint8_t *event)
  3110. {
  3111. return event[11];
  3112. }
  3113. /**
  3114. * @brief Get field data from event GAP_EVENT_ADVERTISING_REPORT
  3115. * @param event packet
  3116. * @return data
  3117. * @note: btstack_type V
  3118. */
  3119. static inline const uint8_t *gap_event_advertising_report_get_data(const uint8_t *event)
  3120. {
  3121. return &event[12];
  3122. }
  3123. /**
  3124. * @brief Get field bd_addr from event GAP_EVENT_INQUIRY_RESULT
  3125. * @param event packet
  3126. * @param Pointer to storage for bd_addr
  3127. * @note: btstack_type B
  3128. */
  3129. static inline void gap_event_inquiry_result_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  3130. {
  3131. reverse_bd_addr(&event[2], bd_addr);
  3132. }
  3133. /**
  3134. * @brief Get field page_scan_repetition_mode from event GAP_EVENT_INQUIRY_RESULT
  3135. * @param event packet
  3136. * @return page_scan_repetition_mode
  3137. * @note: btstack_type 1
  3138. */
  3139. static inline uint8_t gap_event_inquiry_result_get_page_scan_repetition_mode(const uint8_t *event)
  3140. {
  3141. return event[8];
  3142. }
  3143. /**
  3144. * @brief Get field class_of_device from event GAP_EVENT_INQUIRY_RESULT
  3145. * @param event packet
  3146. * @return class_of_device
  3147. * @note: btstack_type 3
  3148. */
  3149. static inline uint32_t gap_event_inquiry_result_get_class_of_device(const uint8_t *event)
  3150. {
  3151. return little_endian_read_24(event, 9);
  3152. }
  3153. /**
  3154. * @brief Get field clock_offset from event GAP_EVENT_INQUIRY_RESULT
  3155. * @param event packet
  3156. * @return clock_offset
  3157. * @note: btstack_type 2
  3158. */
  3159. static inline uint16_t gap_event_inquiry_result_get_clock_offset(const uint8_t *event)
  3160. {
  3161. return little_endian_read_16(event, 12);
  3162. }
  3163. /**
  3164. * @brief Get field rssi_available from event GAP_EVENT_INQUIRY_RESULT
  3165. * @param event packet
  3166. * @return rssi_available
  3167. * @note: btstack_type 1
  3168. */
  3169. static inline uint8_t gap_event_inquiry_result_get_rssi_available(const uint8_t *event)
  3170. {
  3171. return event[14];
  3172. }
  3173. /**
  3174. * @brief Get field rssi from event GAP_EVENT_INQUIRY_RESULT
  3175. * @param event packet
  3176. * @return rssi
  3177. * @note: btstack_type 1
  3178. */
  3179. static inline uint8_t gap_event_inquiry_result_get_rssi(const uint8_t *event)
  3180. {
  3181. return event[15];
  3182. }
  3183. /**
  3184. * @brief Get field name_available from event GAP_EVENT_INQUIRY_RESULT
  3185. * @param event packet
  3186. * @return name_available
  3187. * @note: btstack_type 1
  3188. */
  3189. static inline uint8_t gap_event_inquiry_result_get_name_available(const uint8_t *event)
  3190. {
  3191. return event[16];
  3192. }
  3193. /**
  3194. * @brief Get field name_len from event GAP_EVENT_INQUIRY_RESULT
  3195. * @param event packet
  3196. * @return name_len
  3197. * @note: btstack_type J
  3198. */
  3199. static inline int gap_event_inquiry_result_get_name_len(const uint8_t *event)
  3200. {
  3201. return event[17];
  3202. }
  3203. /**
  3204. * @brief Get field name from event GAP_EVENT_INQUIRY_RESULT
  3205. * @param event packet
  3206. * @return name
  3207. * @note: btstack_type V
  3208. */
  3209. static inline const uint8_t *gap_event_inquiry_result_get_name(const uint8_t *event)
  3210. {
  3211. return &event[18];
  3212. }
  3213. /**
  3214. * @brief Get field status from event GAP_EVENT_INQUIRY_COMPLETE
  3215. * @param event packet
  3216. * @return status
  3217. * @note: btstack_type 1
  3218. */
  3219. static inline uint8_t gap_event_inquiry_complete_get_status(const uint8_t *event)
  3220. {
  3221. return event[2];
  3222. }
  3223. /**
  3224. * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3225. * @param event packet
  3226. * @return status
  3227. * @note: btstack_type 1
  3228. */
  3229. static inline uint8_t hci_subevent_le_connection_complete_get_status(const uint8_t *event)
  3230. {
  3231. return event[3];
  3232. }
  3233. /**
  3234. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3235. * @param event packet
  3236. * @return connection_handle
  3237. * @note: btstack_type H
  3238. */
  3239. static inline hci_con_handle_t hci_subevent_le_connection_complete_get_connection_handle(const uint8_t *event)
  3240. {
  3241. return little_endian_read_16(event, 4);
  3242. }
  3243. /**
  3244. * @brief Get field role from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3245. * @param event packet
  3246. * @return role
  3247. * @note: btstack_type 1
  3248. */
  3249. static inline uint8_t hci_subevent_le_connection_complete_get_role(const uint8_t *event)
  3250. {
  3251. return event[6];
  3252. }
  3253. /**
  3254. * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3255. * @param event packet
  3256. * @return peer_address_type
  3257. * @note: btstack_type 1
  3258. */
  3259. static inline uint8_t hci_subevent_le_connection_complete_get_peer_address_type(const uint8_t *event)
  3260. {
  3261. return event[7];
  3262. }
  3263. /**
  3264. * @brief Get field peer_address from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3265. * @param event packet
  3266. * @param Pointer to storage for peer_address
  3267. * @note: btstack_type B
  3268. */
  3269. static inline void hci_subevent_le_connection_complete_get_peer_address(const uint8_t *event, bd_addr_t peer_address)
  3270. {
  3271. reverse_bd_addr(&event[8], peer_address);
  3272. }
  3273. /**
  3274. * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3275. * @param event packet
  3276. * @return conn_interval
  3277. * @note: btstack_type 2
  3278. */
  3279. static inline uint16_t hci_subevent_le_connection_complete_get_conn_interval(const uint8_t *event)
  3280. {
  3281. return little_endian_read_16(event, 14);
  3282. }
  3283. /**
  3284. * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3285. * @param event packet
  3286. * @return conn_latency
  3287. * @note: btstack_type 2
  3288. */
  3289. static inline uint16_t hci_subevent_le_connection_complete_get_conn_latency(const uint8_t *event)
  3290. {
  3291. return little_endian_read_16(event, 16);
  3292. }
  3293. /**
  3294. * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3295. * @param event packet
  3296. * @return supervision_timeout
  3297. * @note: btstack_type 2
  3298. */
  3299. static inline uint16_t hci_subevent_le_connection_complete_get_supervision_timeout(const uint8_t *event)
  3300. {
  3301. return little_endian_read_16(event, 18);
  3302. }
  3303. /**
  3304. * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_CONNECTION_COMPLETE
  3305. * @param event packet
  3306. * @return master_clock_accuracy
  3307. * @note: btstack_type 1
  3308. */
  3309. static inline uint8_t hci_subevent_le_connection_complete_get_master_clock_accuracy(const uint8_t *event)
  3310. {
  3311. return event[20];
  3312. }
  3313. /**
  3314. * @brief Get field status from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE
  3315. * @param event packet
  3316. * @return status
  3317. * @note: btstack_type 1
  3318. */
  3319. static inline uint8_t hci_subevent_le_connection_update_complete_get_status(const uint8_t *event)
  3320. {
  3321. return event[3];
  3322. }
  3323. /**
  3324. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE
  3325. * @param event packet
  3326. * @return connection_handle
  3327. * @note: btstack_type H
  3328. */
  3329. static inline hci_con_handle_t hci_subevent_le_connection_update_complete_get_connection_handle(const uint8_t *event)
  3330. {
  3331. return little_endian_read_16(event, 4);
  3332. }
  3333. /**
  3334. * @brief Get field conn_interval from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE
  3335. * @param event packet
  3336. * @return conn_interval
  3337. * @note: btstack_type 2
  3338. */
  3339. static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_interval(const uint8_t *event)
  3340. {
  3341. return little_endian_read_16(event, 6);
  3342. }
  3343. /**
  3344. * @brief Get field conn_latency from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE
  3345. * @param event packet
  3346. * @return conn_latency
  3347. * @note: btstack_type 2
  3348. */
  3349. static inline uint16_t hci_subevent_le_connection_update_complete_get_conn_latency(const uint8_t *event)
  3350. {
  3351. return little_endian_read_16(event, 8);
  3352. }
  3353. /**
  3354. * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE
  3355. * @param event packet
  3356. * @return supervision_timeout
  3357. * @note: btstack_type 2
  3358. */
  3359. static inline uint16_t hci_subevent_le_connection_update_complete_get_supervision_timeout(const uint8_t *event)
  3360. {
  3361. return little_endian_read_16(event, 10);
  3362. }
  3363. /**
  3364. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE
  3365. * @param event packet
  3366. * @return connection_handle
  3367. * @note: btstack_type H
  3368. */
  3369. static inline hci_con_handle_t hci_subevent_le_read_remote_used_features_complete_get_connection_handle(const uint8_t *event)
  3370. {
  3371. return little_endian_read_16(event, 3);
  3372. }
  3373. /**
  3374. * @brief Get field random_number from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE
  3375. * @param event packet
  3376. * @return random_number
  3377. * @note: btstack_type D
  3378. */
  3379. static inline const uint8_t *hci_subevent_le_read_remote_used_features_complete_get_random_number(const uint8_t *event)
  3380. {
  3381. return (const uint8_t *) &event[5];
  3382. }
  3383. /**
  3384. * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_READ_REMOTE_USED_FEATURES_COMPLETE
  3385. * @param event packet
  3386. * @return encryption_diversifier
  3387. * @note: btstack_type 2
  3388. */
  3389. static inline uint16_t hci_subevent_le_read_remote_used_features_complete_get_encryption_diversifier(const uint8_t *event)
  3390. {
  3391. return little_endian_read_16(event, 13);
  3392. }
  3393. /**
  3394. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST
  3395. * @param event packet
  3396. * @return connection_handle
  3397. * @note: btstack_type H
  3398. */
  3399. static inline hci_con_handle_t hci_subevent_le_long_term_key_request_get_connection_handle(const uint8_t *event)
  3400. {
  3401. return little_endian_read_16(event, 3);
  3402. }
  3403. /**
  3404. * @brief Get field random_number from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST
  3405. * @param event packet
  3406. * @return random_number
  3407. * @note: btstack_type D
  3408. */
  3409. static inline const uint8_t *hci_subevent_le_long_term_key_request_get_random_number(const uint8_t *event)
  3410. {
  3411. return (const uint8_t *) &event[5];
  3412. }
  3413. /**
  3414. * @brief Get field encryption_diversifier from event HCI_SUBEVENT_LE_LONG_TERM_KEY_REQUEST
  3415. * @param event packet
  3416. * @return encryption_diversifier
  3417. * @note: btstack_type 2
  3418. */
  3419. static inline uint16_t hci_subevent_le_long_term_key_request_get_encryption_diversifier(const uint8_t *event)
  3420. {
  3421. return little_endian_read_16(event, 13);
  3422. }
  3423. /**
  3424. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST
  3425. * @param event packet
  3426. * @return connection_handle
  3427. * @note: btstack_type H
  3428. */
  3429. static inline hci_con_handle_t hci_subevent_le_remote_connection_parameter_request_get_connection_handle(const uint8_t *event)
  3430. {
  3431. return little_endian_read_16(event, 3);
  3432. }
  3433. /**
  3434. * @brief Get field interval_min from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST
  3435. * @param event packet
  3436. * @return interval_min
  3437. * @note: btstack_type 2
  3438. */
  3439. static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_min(const uint8_t *event)
  3440. {
  3441. return little_endian_read_16(event, 5);
  3442. }
  3443. /**
  3444. * @brief Get field interval_max from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST
  3445. * @param event packet
  3446. * @return interval_max
  3447. * @note: btstack_type 2
  3448. */
  3449. static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_interval_max(const uint8_t *event)
  3450. {
  3451. return little_endian_read_16(event, 7);
  3452. }
  3453. /**
  3454. * @brief Get field latency from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST
  3455. * @param event packet
  3456. * @return latency
  3457. * @note: btstack_type 2
  3458. */
  3459. static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_latency(const uint8_t *event)
  3460. {
  3461. return little_endian_read_16(event, 9);
  3462. }
  3463. /**
  3464. * @brief Get field timeout from event HCI_SUBEVENT_LE_REMOTE_CONNECTION_PARAMETER_REQUEST
  3465. * @param event packet
  3466. * @return timeout
  3467. * @note: btstack_type 2
  3468. */
  3469. static inline uint16_t hci_subevent_le_remote_connection_parameter_request_get_timeout(const uint8_t *event)
  3470. {
  3471. return little_endian_read_16(event, 11);
  3472. }
  3473. /**
  3474. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE
  3475. * @param event packet
  3476. * @return connection_handle
  3477. * @note: btstack_type H
  3478. */
  3479. static inline hci_con_handle_t hci_subevent_le_data_length_change_get_connection_handle(const uint8_t *event)
  3480. {
  3481. return little_endian_read_16(event, 3);
  3482. }
  3483. /**
  3484. * @brief Get field max_tx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE
  3485. * @param event packet
  3486. * @return max_tx_octets
  3487. * @note: btstack_type 2
  3488. */
  3489. static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_octets(const uint8_t *event)
  3490. {
  3491. return little_endian_read_16(event, 5);
  3492. }
  3493. /**
  3494. * @brief Get field max_tx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE
  3495. * @param event packet
  3496. * @return max_tx_time
  3497. * @note: btstack_type 2
  3498. */
  3499. static inline uint16_t hci_subevent_le_data_length_change_get_max_tx_time(const uint8_t *event)
  3500. {
  3501. return little_endian_read_16(event, 7);
  3502. }
  3503. /**
  3504. * @brief Get field max_rx_octets from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE
  3505. * @param event packet
  3506. * @return max_rx_octets
  3507. * @note: btstack_type 2
  3508. */
  3509. static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_octets(const uint8_t *event)
  3510. {
  3511. return little_endian_read_16(event, 9);
  3512. }
  3513. /**
  3514. * @brief Get field max_rx_time from event HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE
  3515. * @param event packet
  3516. * @return max_rx_time
  3517. * @note: btstack_type 2
  3518. */
  3519. static inline uint16_t hci_subevent_le_data_length_change_get_max_rx_time(const uint8_t *event)
  3520. {
  3521. return little_endian_read_16(event, 11);
  3522. }
  3523. /**
  3524. * @brief Get field status from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE
  3525. * @param event packet
  3526. * @return status
  3527. * @note: btstack_type 1
  3528. */
  3529. static inline uint8_t hci_subevent_le_read_local_p256_public_key_complete_get_status(const uint8_t *event)
  3530. {
  3531. return event[3];
  3532. }
  3533. /**
  3534. * @brief Get field dhkey_x from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE
  3535. * @param event packet
  3536. * @param Pointer to storage for dhkey_x
  3537. * @note: btstack_type Q
  3538. */
  3539. static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_x(const uint8_t *event, uint8_t *dhkey_x)
  3540. {
  3541. reverse_bytes(&event[4], dhkey_x, 32);
  3542. }
  3543. /**
  3544. * @brief Get field dhkey_y from event HCI_SUBEVENT_LE_READ_LOCAL_P256_PUBLIC_KEY_COMPLETE
  3545. * @param event packet
  3546. * @param Pointer to storage for dhkey_y
  3547. * @note: btstack_type Q
  3548. */
  3549. static inline void hci_subevent_le_read_local_p256_public_key_complete_get_dhkey_y(const uint8_t *event, uint8_t *dhkey_y)
  3550. {
  3551. reverse_bytes(&event[36], dhkey_y, 32);
  3552. }
  3553. /**
  3554. * @brief Get field status from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE
  3555. * @param event packet
  3556. * @return status
  3557. * @note: btstack_type 1
  3558. */
  3559. static inline uint8_t hci_subevent_le_generate_dhkey_complete_get_status(const uint8_t *event)
  3560. {
  3561. return event[3];
  3562. }
  3563. /**
  3564. * @brief Get field dhkey from event HCI_SUBEVENT_LE_GENERATE_DHKEY_COMPLETE
  3565. * @param event packet
  3566. * @param Pointer to storage for dhkey
  3567. * @note: btstack_type Q
  3568. */
  3569. static inline void hci_subevent_le_generate_dhkey_complete_get_dhkey(const uint8_t *event, uint8_t *dhkey)
  3570. {
  3571. reverse_bytes(&event[4], dhkey, 32);
  3572. }
  3573. /**
  3574. * @brief Get field status from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3575. * @param event packet
  3576. * @return status
  3577. * @note: btstack_type 1
  3578. */
  3579. static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_status(const uint8_t *event)
  3580. {
  3581. return event[3];
  3582. }
  3583. /**
  3584. * @brief Get field connection_handle from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3585. * @param event packet
  3586. * @return connection_handle
  3587. * @note: btstack_type H
  3588. */
  3589. static inline hci_con_handle_t hci_subevent_le_enhanced_connection_complete_get_connection_handle(const uint8_t *event)
  3590. {
  3591. return little_endian_read_16(event, 4);
  3592. }
  3593. /**
  3594. * @brief Get field role from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3595. * @param event packet
  3596. * @return role
  3597. * @note: btstack_type 1
  3598. */
  3599. static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_role(const uint8_t *event)
  3600. {
  3601. return event[6];
  3602. }
  3603. /**
  3604. * @brief Get field peer_address_type from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3605. * @param event packet
  3606. * @return peer_address_type
  3607. * @note: btstack_type 1
  3608. */
  3609. static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_peer_address_type(const uint8_t *event)
  3610. {
  3611. return event[7];
  3612. }
  3613. /**
  3614. * @brief Get field perr_addresss from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3615. * @param event packet
  3616. * @param Pointer to storage for perr_addresss
  3617. * @note: btstack_type B
  3618. */
  3619. static inline void hci_subevent_le_enhanced_connection_complete_get_peer_addresss(const uint8_t *event, bd_addr_t perr_addresss)
  3620. {
  3621. reverse_bd_addr(&event[8], perr_addresss);
  3622. }
  3623. static inline uint8_t *hci_subevent_le_enhanced_connection_complete_get_peer_addresss_ptr(const uint8_t *event)
  3624. {
  3625. return (uint8_t *)&event[8];
  3626. }
  3627. /**
  3628. * @brief Get field local_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3629. * @param event packet
  3630. * @param Pointer to storage for local_resolvable_private_addres
  3631. * @note: btstack_type B
  3632. */
  3633. static inline void hci_subevent_le_enhanced_connection_complete_get_local_resolvable_private_addres(const uint8_t *event, bd_addr_t local_resolvable_private_addres)
  3634. {
  3635. reverse_bd_addr(&event[14], local_resolvable_private_addres);
  3636. }
  3637. /**
  3638. * @brief Get field peer_resolvable_private_addres from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3639. * @param event packet
  3640. * @param Pointer to storage for peer_resolvable_private_addres
  3641. * @note: btstack_type B
  3642. */
  3643. static inline void hci_subevent_le_enhanced_connection_complete_get_peer_resolvable_private_addres(const uint8_t *event, bd_addr_t peer_resolvable_private_addres)
  3644. {
  3645. reverse_bd_addr(&event[20], peer_resolvable_private_addres);
  3646. }
  3647. /**
  3648. * @brief Get field conn_interval from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3649. * @param event packet
  3650. * @return conn_interval
  3651. * @note: btstack_type 2
  3652. */
  3653. static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_interval(const uint8_t *event)
  3654. {
  3655. return little_endian_read_16(event, 26);
  3656. }
  3657. /**
  3658. * @brief Get field conn_latency from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3659. * @param event packet
  3660. * @return conn_latency
  3661. * @note: btstack_type 2
  3662. */
  3663. static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_conn_latency(const uint8_t *event)
  3664. {
  3665. return little_endian_read_16(event, 28);
  3666. }
  3667. /**
  3668. * @brief Get field supervision_timeout from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3669. * @param event packet
  3670. * @return supervision_timeout
  3671. * @note: btstack_type 2
  3672. */
  3673. static inline uint16_t hci_subevent_le_enhanced_connection_complete_get_supervision_timeout(const uint8_t *event)
  3674. {
  3675. return little_endian_read_16(event, 30);
  3676. }
  3677. /**
  3678. * @brief Get field master_clock_accuracy from event HCI_SUBEVENT_LE_ENHANCED_CONNECTION_COMPLETE
  3679. * @param event packet
  3680. * @return master_clock_accuracy
  3681. * @note: btstack_type 1
  3682. */
  3683. static inline uint8_t hci_subevent_le_enhanced_connection_complete_get_master_clock_accuracy(const uint8_t *event)
  3684. {
  3685. return event[32];
  3686. }
  3687. /**
  3688. * @brief Get field status from event HSP_SUBEVENT_RFCOMM_CONNECTION_COMPLETE
  3689. * @param event packet
  3690. * @return status
  3691. * @note: btstack_type 1
  3692. */
  3693. static inline uint8_t hsp_subevent_rfcomm_connection_complete_get_status(const uint8_t *event)
  3694. {
  3695. return event[3];
  3696. }
  3697. /**
  3698. * @brief Get field status from event HSP_SUBEVENT_RFCOMM_DISCONNECTION_COMPLETE
  3699. * @param event packet
  3700. * @return status
  3701. * @note: btstack_type 1
  3702. */
  3703. static inline uint8_t hsp_subevent_rfcomm_disconnection_complete_get_status(const uint8_t *event)
  3704. {
  3705. return event[3];
  3706. }
  3707. /**
  3708. * @brief Get field status from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
  3709. * @param event packet
  3710. * @return status
  3711. * @note: btstack_type 1
  3712. */
  3713. static inline uint8_t hsp_subevent_audio_connection_complete_get_status(const uint8_t *event)
  3714. {
  3715. return event[3];
  3716. }
  3717. /**
  3718. * @brief Get field handle from event HSP_SUBEVENT_AUDIO_CONNECTION_COMPLETE
  3719. * @param event packet
  3720. * @return handle
  3721. * @note: btstack_type H
  3722. */
  3723. static inline hci_con_handle_t hsp_subevent_audio_connection_complete_get_handle(const uint8_t *event)
  3724. {
  3725. return little_endian_read_16(event, 4);
  3726. }
  3727. /**
  3728. * @brief Get field status from event HSP_SUBEVENT_AUDIO_DISCONNECTION_COMPLETE
  3729. * @param event packet
  3730. * @return status
  3731. * @note: btstack_type 1
  3732. */
  3733. static inline uint8_t hsp_subevent_audio_disconnection_complete_get_status(const uint8_t *event)
  3734. {
  3735. return event[3];
  3736. }
  3737. /**
  3738. * @brief Get field gain from event HSP_SUBEVENT_MICROPHONE_GAIN_CHANGED
  3739. * @param event packet
  3740. * @return gain
  3741. * @note: btstack_type 1
  3742. */
  3743. static inline uint8_t hsp_subevent_microphone_gain_changed_get_gain(const uint8_t *event)
  3744. {
  3745. return event[3];
  3746. }
  3747. /**
  3748. * @brief Get field gain from event HSP_SUBEVENT_SPEAKER_GAIN_CHANGED
  3749. * @param event packet
  3750. * @return gain
  3751. * @note: btstack_type 1
  3752. */
  3753. static inline uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t *event)
  3754. {
  3755. return event[3];
  3756. }
  3757. /**
  3758. * @brief Get field value_length from event HSP_SUBEVENT_HS_COMMAND
  3759. * @param event packet
  3760. * @return value_length
  3761. * @note: btstack_type J
  3762. */
  3763. static inline int hsp_subevent_hs_command_get_value_length(const uint8_t *event)
  3764. {
  3765. return event[3];
  3766. }
  3767. /**
  3768. * @brief Get field value from event HSP_SUBEVENT_HS_COMMAND
  3769. * @param event packet
  3770. * @return value
  3771. * @note: btstack_type V
  3772. */
  3773. static inline const uint8_t *hsp_subevent_hs_command_get_value(const uint8_t *event)
  3774. {
  3775. return &event[4];
  3776. }
  3777. /**
  3778. * @brief Get field value_length from event HSP_SUBEVENT_AG_INDICATION
  3779. * @param event packet
  3780. * @return value_length
  3781. * @note: btstack_type J
  3782. */
  3783. static inline int hsp_subevent_ag_indication_get_value_length(const uint8_t *event)
  3784. {
  3785. return event[3];
  3786. }
  3787. /**
  3788. * @brief Get field value from event HSP_SUBEVENT_AG_INDICATION
  3789. * @param event packet
  3790. * @return value
  3791. * @note: btstack_type V
  3792. */
  3793. static inline const uint8_t *hsp_subevent_ag_indication_get_value(const uint8_t *event)
  3794. {
  3795. return &event[4];
  3796. }
  3797. /**
  3798. * @brief Get field status from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED
  3799. * @param event packet
  3800. * @return status
  3801. * @note: btstack_type 1
  3802. */
  3803. static inline uint8_t hfp_subevent_service_level_connection_established_get_status(const uint8_t *event)
  3804. {
  3805. return event[3];
  3806. }
  3807. /**
  3808. * @brief Get field con_handle from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED
  3809. * @param event packet
  3810. * @return con_handle
  3811. * @note: btstack_type H
  3812. */
  3813. static inline hci_con_handle_t hfp_subevent_service_level_connection_established_get_con_handle(const uint8_t *event)
  3814. {
  3815. return little_endian_read_16(event, 4);
  3816. }
  3817. /**
  3818. * @brief Get field bd_addr from event HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED
  3819. * @param event packet
  3820. * @param Pointer to storage for bd_addr
  3821. * @note: btstack_type B
  3822. */
  3823. static inline void hfp_subevent_service_level_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  3824. {
  3825. reverse_bd_addr(&event[6], bd_addr);
  3826. }
  3827. /**
  3828. * @brief Get field status from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED
  3829. * @param event packet
  3830. * @return status
  3831. * @note: btstack_type 1
  3832. */
  3833. static inline uint8_t hfp_subevent_audio_connection_established_get_status(const uint8_t *event)
  3834. {
  3835. return event[3];
  3836. }
  3837. /**
  3838. * @brief Get field handle from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED
  3839. * @param event packet
  3840. * @return handle
  3841. * @note: btstack_type H
  3842. */
  3843. static inline hci_con_handle_t hfp_subevent_audio_connection_established_get_handle(const uint8_t *event)
  3844. {
  3845. return little_endian_read_16(event, 4);
  3846. }
  3847. /**
  3848. * @brief Get field bd_addr from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED
  3849. * @param event packet
  3850. * @param Pointer to storage for bd_addr
  3851. * @note: btstack_type B
  3852. */
  3853. static inline void hfp_subevent_audio_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  3854. {
  3855. reverse_bd_addr(&event[6], bd_addr);
  3856. }
  3857. /**
  3858. * @brief Get field negotiated_codec from event HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED
  3859. * @param event packet
  3860. * @return negotiated_codec
  3861. * @note: btstack_type 1
  3862. */
  3863. static inline uint8_t hfp_subevent_audio_connection_established_get_negotiated_codec(const uint8_t *event)
  3864. {
  3865. return event[12];
  3866. }
  3867. /**
  3868. * @brief Get field status from event HFP_SUBEVENT_COMPLETE
  3869. * @param event packet
  3870. * @return status
  3871. * @note: btstack_type 1
  3872. */
  3873. static inline uint8_t hfp_subevent_complete_get_status(const uint8_t *event)
  3874. {
  3875. return event[3];
  3876. }
  3877. /**
  3878. * @brief Get field indicator_index from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
  3879. * @param event packet
  3880. * @return indicator_index
  3881. * @note: btstack_type 1
  3882. */
  3883. static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_index(const uint8_t *event)
  3884. {
  3885. return event[3];
  3886. }
  3887. /**
  3888. * @brief Get field indicator_status from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
  3889. * @param event packet
  3890. * @return indicator_status
  3891. * @note: btstack_type 1
  3892. */
  3893. static inline uint8_t hfp_subevent_ag_indicator_status_changed_get_indicator_status(const uint8_t *event)
  3894. {
  3895. return event[4];
  3896. }
  3897. /**
  3898. * @brief Get field indicator_name from event HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED
  3899. * @param event packet
  3900. * @return indicator_name
  3901. * @note: btstack_type T
  3902. */
  3903. static inline const char *hfp_subevent_ag_indicator_status_changed_get_indicator_name(const uint8_t *event)
  3904. {
  3905. return (const char *) &event[5];
  3906. }
  3907. /**
  3908. * @brief Get field network_operator_mode from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
  3909. * @param event packet
  3910. * @return network_operator_mode
  3911. * @note: btstack_type 1
  3912. */
  3913. static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(const uint8_t *event)
  3914. {
  3915. return event[3];
  3916. }
  3917. /**
  3918. * @brief Get field network_operator_format from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
  3919. * @param event packet
  3920. * @return network_operator_format
  3921. * @note: btstack_type 1
  3922. */
  3923. static inline uint8_t hfp_subevent_network_operator_changed_get_network_operator_format(const uint8_t *event)
  3924. {
  3925. return event[4];
  3926. }
  3927. /**
  3928. * @brief Get field network_operator_name from event HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED
  3929. * @param event packet
  3930. * @return network_operator_name
  3931. * @note: btstack_type T
  3932. */
  3933. static inline const char *hfp_subevent_network_operator_changed_get_network_operator_name(const uint8_t *event)
  3934. {
  3935. return (const char *) &event[5];
  3936. }
  3937. /**
  3938. * @brief Get field error from event HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR
  3939. * @param event packet
  3940. * @return error
  3941. * @note: btstack_type 1
  3942. */
  3943. static inline uint8_t hfp_subevent_extended_audio_gateway_error_get_error(const uint8_t *event)
  3944. {
  3945. return event[3];
  3946. }
  3947. /**
  3948. * @brief Get field number from event HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER
  3949. * @param event packet
  3950. * @return number
  3951. * @note: btstack_type T
  3952. */
  3953. static inline const char *hfp_subevent_place_call_with_number_get_number(const uint8_t *event)
  3954. {
  3955. return (const char *) &event[3];
  3956. }
  3957. /**
  3958. * @brief Get field number from event HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG
  3959. * @param event packet
  3960. * @return number
  3961. * @note: btstack_type T
  3962. */
  3963. static inline const char *hfp_subevent_number_for_voice_tag_get_number(const uint8_t *event)
  3964. {
  3965. return (const char *) &event[3];
  3966. }
  3967. /**
  3968. * @brief Get field dtmf from event HFP_SUBEVENT_TRANSMIT_DTMF_CODES
  3969. * @param event packet
  3970. * @return dtmf
  3971. * @note: btstack_type T
  3972. */
  3973. static inline const char *hfp_subevent_transmit_dtmf_codes_get_dtmf(const uint8_t *event)
  3974. {
  3975. return (const char *) &event[3];
  3976. }
  3977. /**
  3978. * @brief Get field status from event HFP_SUBEVENT_SPEAKER_VOLUME
  3979. * @param event packet
  3980. * @return status
  3981. * @note: btstack_type 1
  3982. */
  3983. static inline uint8_t hfp_subevent_speaker_volume_get_status(const uint8_t *event)
  3984. {
  3985. return event[3];
  3986. }
  3987. /**
  3988. * @brief Get field gain from event HFP_SUBEVENT_SPEAKER_VOLUME
  3989. * @param event packet
  3990. * @return gain
  3991. * @note: btstack_type 1
  3992. */
  3993. static inline uint8_t hfp_subevent_speaker_volume_get_gain(const uint8_t *event)
  3994. {
  3995. return event[4];
  3996. }
  3997. /**
  3998. * @brief Get field status from event HFP_SUBEVENT_MICROPHONE_VOLUME
  3999. * @param event packet
  4000. * @return status
  4001. * @note: btstack_type 1
  4002. */
  4003. static inline uint8_t hfp_subevent_microphone_volume_get_status(const uint8_t *event)
  4004. {
  4005. return event[3];
  4006. }
  4007. /**
  4008. * @brief Get field gain from event HFP_SUBEVENT_MICROPHONE_VOLUME
  4009. * @param event packet
  4010. * @return gain
  4011. * @note: btstack_type 1
  4012. */
  4013. static inline uint8_t hfp_subevent_microphone_volume_get_gain(const uint8_t *event)
  4014. {
  4015. return event[4];
  4016. }
  4017. /**
  4018. * @brief Get field type from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION
  4019. * @param event packet
  4020. * @return type
  4021. * @note: btstack_type 1
  4022. */
  4023. static inline uint8_t hfp_subevent_call_waiting_notification_get_type(const uint8_t *event)
  4024. {
  4025. return event[3];
  4026. }
  4027. /**
  4028. * @brief Get field number from event HFP_SUBEVENT_CALL_WAITING_NOTIFICATION
  4029. * @param event packet
  4030. * @return number
  4031. * @note: btstack_type T
  4032. */
  4033. static inline const char *hfp_subevent_call_waiting_notification_get_number(const uint8_t *event)
  4034. {
  4035. return (const char *) &event[4];
  4036. }
  4037. /**
  4038. * @brief Get field type from event HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION
  4039. * @param event packet
  4040. * @return type
  4041. * @note: btstack_type 1
  4042. */
  4043. static inline uint8_t hfp_subevent_calling_line_identification_notification_get_type(const uint8_t *event)
  4044. {
  4045. return event[3];
  4046. }
  4047. /**
  4048. * @brief Get field number from event HFP_SUBEVENT_CALLING_LINE_IDENTIFICATION_NOTIFICATION
  4049. * @param event packet
  4050. * @return number
  4051. * @note: btstack_type T
  4052. */
  4053. static inline const char *hfp_subevent_calling_line_identification_notification_get_number(const uint8_t *event)
  4054. {
  4055. return (const char *) &event[4];
  4056. }
  4057. /**
  4058. * @brief Get field clcc_idx from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4059. * @param event packet
  4060. * @return clcc_idx
  4061. * @note: btstack_type 1
  4062. */
  4063. static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_idx(const uint8_t *event)
  4064. {
  4065. return event[3];
  4066. }
  4067. /**
  4068. * @brief Get field clcc_dir from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4069. * @param event packet
  4070. * @return clcc_dir
  4071. * @note: btstack_type 1
  4072. */
  4073. static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_dir(const uint8_t *event)
  4074. {
  4075. return event[4];
  4076. }
  4077. /**
  4078. * @brief Get field clcc_status from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4079. * @param event packet
  4080. * @return clcc_status
  4081. * @note: btstack_type 1
  4082. */
  4083. static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_status(const uint8_t *event)
  4084. {
  4085. return event[5];
  4086. }
  4087. /**
  4088. * @brief Get field clcc_mpty from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4089. * @param event packet
  4090. * @return clcc_mpty
  4091. * @note: btstack_type 1
  4092. */
  4093. static inline uint8_t hfp_subevent_enhanced_call_status_get_clcc_mpty(const uint8_t *event)
  4094. {
  4095. return event[6];
  4096. }
  4097. /**
  4098. * @brief Get field bnip_type from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4099. * @param event packet
  4100. * @return bnip_type
  4101. * @note: btstack_type 1
  4102. */
  4103. static inline uint8_t hfp_subevent_enhanced_call_status_get_bnip_type(const uint8_t *event)
  4104. {
  4105. return event[7];
  4106. }
  4107. /**
  4108. * @brief Get field bnip_number from event HFP_SUBEVENT_ENHANCED_CALL_STATUS
  4109. * @param event packet
  4110. * @return bnip_number
  4111. * @note: btstack_type T
  4112. */
  4113. static inline const char *hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t *event)
  4114. {
  4115. return (const char *) &event[8];
  4116. }
  4117. /**
  4118. * @brief Get field status from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
  4119. * @param event packet
  4120. * @return status
  4121. * @note: btstack_type 1
  4122. */
  4123. static inline uint8_t hfp_subevent_subscriber_number_information_get_status(const uint8_t *event)
  4124. {
  4125. return event[3];
  4126. }
  4127. /**
  4128. * @brief Get field bnip_type from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
  4129. * @param event packet
  4130. * @return bnip_type
  4131. * @note: btstack_type 1
  4132. */
  4133. static inline uint8_t hfp_subevent_subscriber_number_information_get_bnip_type(const uint8_t *event)
  4134. {
  4135. return event[4];
  4136. }
  4137. /**
  4138. * @brief Get field bnip_number from event HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION
  4139. * @param event packet
  4140. * @return bnip_number
  4141. * @note: btstack_type T
  4142. */
  4143. static inline const char *hfp_subevent_subscriber_number_information_get_bnip_number(const uint8_t *event)
  4144. {
  4145. return (const char *) &event[5];
  4146. }
  4147. /**
  4148. * @brief Get field value from event HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS
  4149. * @param event packet
  4150. * @return value
  4151. * @note: btstack_type T
  4152. */
  4153. static inline const char *hfp_subevent_response_and_hold_status_get_value(const uint8_t *event)
  4154. {
  4155. return (const char *) &event[3];
  4156. }
  4157. #ifdef ENABLE_BLE
  4158. /**
  4159. * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_CONNECTED
  4160. * @param event packet
  4161. * @return handle
  4162. * @note: btstack_type H
  4163. */
  4164. static inline hci_con_handle_t ancs_subevent_client_connected_get_handle(const uint8_t *event)
  4165. {
  4166. return little_endian_read_16(event, 3);
  4167. }
  4168. #endif
  4169. #ifdef ENABLE_BLE
  4170. /**
  4171. * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
  4172. * @param event packet
  4173. * @return handle
  4174. * @note: btstack_type H
  4175. */
  4176. static inline hci_con_handle_t ancs_subevent_client_notification_get_handle(const uint8_t *event)
  4177. {
  4178. return little_endian_read_16(event, 3);
  4179. }
  4180. /**
  4181. * @brief Get field attribute_id from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
  4182. * @param event packet
  4183. * @return attribute_id
  4184. * @note: btstack_type 2
  4185. */
  4186. static inline uint16_t ancs_subevent_client_notification_get_attribute_id(const uint8_t *event)
  4187. {
  4188. return little_endian_read_16(event, 5);
  4189. }
  4190. /**
  4191. * @brief Get field text from event ANCS_SUBEVENT_CLIENT_NOTIFICATION
  4192. * @param event packet
  4193. * @return text
  4194. * @note: btstack_type T
  4195. */
  4196. static inline const char *ancs_subevent_client_notification_get_text(const uint8_t *event)
  4197. {
  4198. return (const char *) &event[7];
  4199. }
  4200. #endif
  4201. #ifdef ENABLE_BLE
  4202. /**
  4203. * @brief Get field handle from event ANCS_SUBEVENT_CLIENT_DISCONNECTED
  4204. * @param event packet
  4205. * @return handle
  4206. * @note: btstack_type H
  4207. */
  4208. static inline hci_con_handle_t ancs_subevent_client_disconnected_get_handle(const uint8_t *event)
  4209. {
  4210. return little_endian_read_16(event, 3);
  4211. }
  4212. #endif
  4213. /**
  4214. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_ACCEPT
  4215. * @param event packet
  4216. * @return avdtp_cid
  4217. * @note: btstack_type 2
  4218. */
  4219. static inline uint16_t avdtp_subevent_signaling_accept_get_avdtp_cid(const uint8_t *event)
  4220. {
  4221. return little_endian_read_16(event, 3);
  4222. }
  4223. /**
  4224. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_ACCEPT
  4225. * @param event packet
  4226. * @return local_seid
  4227. * @note: btstack_type 1
  4228. */
  4229. static inline uint8_t avdtp_subevent_signaling_accept_get_local_seid(const uint8_t *event)
  4230. {
  4231. return event[5];
  4232. }
  4233. /**
  4234. * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_ACCEPT
  4235. * @param event packet
  4236. * @return signal_identifier
  4237. * @note: btstack_type 1
  4238. */
  4239. static inline uint8_t avdtp_subevent_signaling_accept_get_signal_identifier(const uint8_t *event)
  4240. {
  4241. return event[6];
  4242. }
  4243. /**
  4244. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_REJECT
  4245. * @param event packet
  4246. * @return avdtp_cid
  4247. * @note: btstack_type 2
  4248. */
  4249. static inline uint16_t avdtp_subevent_signaling_reject_get_avdtp_cid(const uint8_t *event)
  4250. {
  4251. return little_endian_read_16(event, 3);
  4252. }
  4253. /**
  4254. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_REJECT
  4255. * @param event packet
  4256. * @return local_seid
  4257. * @note: btstack_type 1
  4258. */
  4259. static inline uint8_t avdtp_subevent_signaling_reject_get_local_seid(const uint8_t *event)
  4260. {
  4261. return event[5];
  4262. }
  4263. /**
  4264. * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_REJECT
  4265. * @param event packet
  4266. * @return signal_identifier
  4267. * @note: btstack_type 1
  4268. */
  4269. static inline uint8_t avdtp_subevent_signaling_reject_get_signal_identifier(const uint8_t *event)
  4270. {
  4271. return event[6];
  4272. }
  4273. /**
  4274. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT
  4275. * @param event packet
  4276. * @return avdtp_cid
  4277. * @note: btstack_type 2
  4278. */
  4279. static inline uint16_t avdtp_subevent_signaling_general_reject_get_avdtp_cid(const uint8_t *event)
  4280. {
  4281. return little_endian_read_16(event, 3);
  4282. }
  4283. /**
  4284. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT
  4285. * @param event packet
  4286. * @return local_seid
  4287. * @note: btstack_type 1
  4288. */
  4289. static inline uint8_t avdtp_subevent_signaling_general_reject_get_local_seid(const uint8_t *event)
  4290. {
  4291. return event[5];
  4292. }
  4293. /**
  4294. * @brief Get field signal_identifier from event AVDTP_SUBEVENT_SIGNALING_GENERAL_REJECT
  4295. * @param event packet
  4296. * @return signal_identifier
  4297. * @note: btstack_type 1
  4298. */
  4299. static inline uint8_t avdtp_subevent_signaling_general_reject_get_signal_identifier(const uint8_t *event)
  4300. {
  4301. return event[6];
  4302. }
  4303. /**
  4304. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED
  4305. * @param event packet
  4306. * @return avdtp_cid
  4307. * @note: btstack_type 2
  4308. */
  4309. static inline uint16_t avdtp_subevent_signaling_connection_established_get_avdtp_cid(const uint8_t *event)
  4310. {
  4311. return little_endian_read_16(event, 3);
  4312. }
  4313. /**
  4314. * @brief Get field bd_addr from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED
  4315. * @param event packet
  4316. * @param Pointer to storage for bd_addr
  4317. * @note: btstack_type B
  4318. */
  4319. static inline void avdtp_subevent_signaling_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  4320. {
  4321. reverse_bd_addr(&event[5], bd_addr);
  4322. }
  4323. /**
  4324. * @brief Get field status from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED
  4325. * @param event packet
  4326. * @return status
  4327. * @note: btstack_type 1
  4328. */
  4329. static inline uint8_t avdtp_subevent_signaling_connection_established_get_status(const uint8_t *event)
  4330. {
  4331. return event[11];
  4332. }
  4333. /**
  4334. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_CONNECTION_RELEASED
  4335. * @param event packet
  4336. * @return avdtp_cid
  4337. * @note: btstack_type 2
  4338. */
  4339. static inline uint16_t avdtp_subevent_signaling_connection_released_get_avdtp_cid(const uint8_t *event)
  4340. {
  4341. return little_endian_read_16(event, 3);
  4342. }
  4343. /**
  4344. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND
  4345. * @param event packet
  4346. * @return avdtp_cid
  4347. * @note: btstack_type 2
  4348. */
  4349. static inline uint16_t avdtp_subevent_signaling_sep_found_get_avdtp_cid(const uint8_t *event)
  4350. {
  4351. return little_endian_read_16(event, 3);
  4352. }
  4353. /**
  4354. * @brief Get field remote_seid from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND
  4355. * @param event packet
  4356. * @return remote_seid
  4357. * @note: btstack_type 1
  4358. */
  4359. static inline uint8_t avdtp_subevent_signaling_sep_found_get_remote_seid(const uint8_t *event)
  4360. {
  4361. return event[5];
  4362. }
  4363. /**
  4364. * @brief Get field in_use from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND
  4365. * @param event packet
  4366. * @return in_use
  4367. * @note: btstack_type 1
  4368. */
  4369. static inline uint8_t avdtp_subevent_signaling_sep_found_get_in_use(const uint8_t *event)
  4370. {
  4371. return event[6];
  4372. }
  4373. /**
  4374. * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND
  4375. * @param event packet
  4376. * @return media_type
  4377. * @note: btstack_type 1
  4378. */
  4379. static inline uint8_t avdtp_subevent_signaling_sep_found_get_media_type(const uint8_t *event)
  4380. {
  4381. return event[7];
  4382. }
  4383. /**
  4384. * @brief Get field sep_type from event AVDTP_SUBEVENT_SIGNALING_SEP_FOUND
  4385. * @param event packet
  4386. * @return sep_type
  4387. * @note: btstack_type 1
  4388. */
  4389. static inline uint8_t avdtp_subevent_signaling_sep_found_get_sep_type(const uint8_t *event)
  4390. {
  4391. return event[8];
  4392. }
  4393. /**
  4394. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4395. * @param event packet
  4396. * @return avdtp_cid
  4397. * @note: btstack_type 2
  4398. */
  4399. static inline uint16_t avdtp_subevent_signaling_media_codec_sbc_capability_get_avdtp_cid(const uint8_t *event)
  4400. {
  4401. return little_endian_read_16(event, 3);
  4402. }
  4403. /**
  4404. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4405. * @param event packet
  4406. * @return local_seid
  4407. * @note: btstack_type 1
  4408. */
  4409. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_local_seid(const uint8_t *event)
  4410. {
  4411. return event[5];
  4412. }
  4413. /**
  4414. * @brief Get field remote_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4415. * @param event packet
  4416. * @return remote_seid
  4417. * @note: btstack_type 1
  4418. */
  4419. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_remote_seid(const uint8_t *event)
  4420. {
  4421. return event[6];
  4422. }
  4423. /**
  4424. * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4425. * @param event packet
  4426. * @return media_type
  4427. * @note: btstack_type 1
  4428. */
  4429. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_media_type(const uint8_t *event)
  4430. {
  4431. return event[7];
  4432. }
  4433. /**
  4434. * @brief Get field sampling_frequency_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4435. * @param event packet
  4436. * @return sampling_frequency_bitmap
  4437. * @note: btstack_type 1
  4438. */
  4439. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_sampling_frequency_bitmap(const uint8_t *event)
  4440. {
  4441. return event[8];
  4442. }
  4443. /**
  4444. * @brief Get field channel_mode_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4445. * @param event packet
  4446. * @return channel_mode_bitmap
  4447. * @note: btstack_type 1
  4448. */
  4449. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_channel_mode_bitmap(const uint8_t *event)
  4450. {
  4451. return event[9];
  4452. }
  4453. /**
  4454. * @brief Get field block_length_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4455. * @param event packet
  4456. * @return block_length_bitmap
  4457. * @note: btstack_type 1
  4458. */
  4459. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_block_length_bitmap(const uint8_t *event)
  4460. {
  4461. return event[10];
  4462. }
  4463. /**
  4464. * @brief Get field subbands_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4465. * @param event packet
  4466. * @return subbands_bitmap
  4467. * @note: btstack_type 1
  4468. */
  4469. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_subbands_bitmap(const uint8_t *event)
  4470. {
  4471. return event[11];
  4472. }
  4473. /**
  4474. * @brief Get field allocation_method_bitmap from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4475. * @param event packet
  4476. * @return allocation_method_bitmap
  4477. * @note: btstack_type 1
  4478. */
  4479. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_allocation_method_bitmap(const uint8_t *event)
  4480. {
  4481. return event[12];
  4482. }
  4483. /**
  4484. * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4485. * @param event packet
  4486. * @return min_bitpool_value
  4487. * @note: btstack_type 1
  4488. */
  4489. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(const uint8_t *event)
  4490. {
  4491. return event[13];
  4492. }
  4493. /**
  4494. * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CAPABILITY
  4495. * @param event packet
  4496. * @return max_bitpool_value
  4497. * @note: btstack_type 1
  4498. */
  4499. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_capability_get_max_bitpool_value(const uint8_t *event)
  4500. {
  4501. return event[14];
  4502. }
  4503. /**
  4504. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4505. * @param event packet
  4506. * @return avdtp_cid
  4507. * @note: btstack_type 2
  4508. */
  4509. static inline uint16_t avdtp_subevent_signaling_media_codec_other_capability_get_avdtp_cid(const uint8_t *event)
  4510. {
  4511. return little_endian_read_16(event, 3);
  4512. }
  4513. /**
  4514. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4515. * @param event packet
  4516. * @return local_seid
  4517. * @note: btstack_type 1
  4518. */
  4519. static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_local_seid(const uint8_t *event)
  4520. {
  4521. return event[5];
  4522. }
  4523. /**
  4524. * @brief Get field remote_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4525. * @param event packet
  4526. * @return remote_seid
  4527. * @note: btstack_type 1
  4528. */
  4529. static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_remote_seid(const uint8_t *event)
  4530. {
  4531. return event[6];
  4532. }
  4533. /**
  4534. * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4535. * @param event packet
  4536. * @return media_type
  4537. * @note: btstack_type 1
  4538. */
  4539. static inline uint8_t avdtp_subevent_signaling_media_codec_other_capability_get_media_type(const uint8_t *event)
  4540. {
  4541. return event[7];
  4542. }
  4543. /**
  4544. * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4545. * @param event packet
  4546. * @return media_codec_type
  4547. * @note: btstack_type 2
  4548. */
  4549. static inline uint16_t avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_type(const uint8_t *event)
  4550. {
  4551. return little_endian_read_16(event, 8);
  4552. }
  4553. /**
  4554. * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4555. * @param event packet
  4556. * @return media_codec_information_len
  4557. * @note: btstack_type L
  4558. */
  4559. static inline int avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information_len(const uint8_t *event)
  4560. {
  4561. return little_endian_read_16(event, 10);
  4562. }
  4563. /**
  4564. * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CAPABILITY
  4565. * @param event packet
  4566. * @return media_codec_information
  4567. * @note: btstack_type V
  4568. */
  4569. static inline const uint8_t *avdtp_subevent_signaling_media_codec_other_capability_get_media_codec_information(const uint8_t *event)
  4570. {
  4571. return &event[12];
  4572. }
  4573. /**
  4574. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4575. * @param event packet
  4576. * @return avdtp_cid
  4577. * @note: btstack_type 2
  4578. */
  4579. static inline uint16_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_avdtp_cid(const uint8_t *event)
  4580. {
  4581. return little_endian_read_16(event, 3);
  4582. }
  4583. /**
  4584. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4585. * @param event packet
  4586. * @return local_seid
  4587. * @note: btstack_type 1
  4588. */
  4589. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_local_seid(const uint8_t *event)
  4590. {
  4591. return event[5];
  4592. }
  4593. /**
  4594. * @brief Get field remote_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4595. * @param event packet
  4596. * @return remote_seid
  4597. * @note: btstack_type 1
  4598. */
  4599. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_remote_seid(const uint8_t *event)
  4600. {
  4601. return event[6];
  4602. }
  4603. /**
  4604. * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4605. * @param event packet
  4606. * @return reconfigure
  4607. * @note: btstack_type 1
  4608. */
  4609. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_reconfigure(const uint8_t *event)
  4610. {
  4611. return event[7];
  4612. }
  4613. /**
  4614. * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4615. * @param event packet
  4616. * @return media_type
  4617. * @note: btstack_type 1
  4618. */
  4619. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_media_type(const uint8_t *event)
  4620. {
  4621. return event[8];
  4622. }
  4623. /**
  4624. * @brief Get field sampling_frequency from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4625. * @param event packet
  4626. * @return sampling_frequency
  4627. * @note: btstack_type 2
  4628. */
  4629. static inline uint16_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_sampling_frequency(const uint8_t *event)
  4630. {
  4631. return little_endian_read_16(event, 9);
  4632. }
  4633. /**
  4634. * @brief Get field channel_mode from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4635. * @param event packet
  4636. * @return channel_mode
  4637. * @note: btstack_type 1
  4638. */
  4639. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(const uint8_t *event)
  4640. {
  4641. return event[11];
  4642. }
  4643. /**
  4644. * @brief Get field num_channels from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4645. * @param event packet
  4646. * @return num_channels
  4647. * @note: btstack_type 1
  4648. */
  4649. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_num_channels(const uint8_t *event)
  4650. {
  4651. return event[12];
  4652. }
  4653. /**
  4654. * @brief Get field block_length from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4655. * @param event packet
  4656. * @return block_length
  4657. * @note: btstack_type 1
  4658. */
  4659. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_block_length(const uint8_t *event)
  4660. {
  4661. return event[13];
  4662. }
  4663. /**
  4664. * @brief Get field subbands from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4665. * @param event packet
  4666. * @return subbands
  4667. * @note: btstack_type 1
  4668. */
  4669. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_subbands(const uint8_t *event)
  4670. {
  4671. return event[14];
  4672. }
  4673. /**
  4674. * @brief Get field allocation_method from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4675. * @param event packet
  4676. * @return allocation_method
  4677. * @note: btstack_type 1
  4678. */
  4679. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(const uint8_t *event)
  4680. {
  4681. return event[15];
  4682. }
  4683. /**
  4684. * @brief Get field min_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4685. * @param event packet
  4686. * @return min_bitpool_value
  4687. * @note: btstack_type 1
  4688. */
  4689. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(const uint8_t *event)
  4690. {
  4691. return event[16];
  4692. }
  4693. /**
  4694. * @brief Get field max_bitpool_value from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4695. * @param event packet
  4696. * @return max_bitpool_value
  4697. * @note: btstack_type 1
  4698. */
  4699. static inline uint8_t avdtp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(const uint8_t *event)
  4700. {
  4701. return event[17];
  4702. }
  4703. /**
  4704. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4705. * @param event packet
  4706. * @return avdtp_cid
  4707. * @note: btstack_type 2
  4708. */
  4709. static inline uint16_t avdtp_subevent_signaling_media_codec_other_configuration_get_avdtp_cid(const uint8_t *event)
  4710. {
  4711. return little_endian_read_16(event, 3);
  4712. }
  4713. /**
  4714. * @brief Get field local_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4715. * @param event packet
  4716. * @return local_seid
  4717. * @note: btstack_type 1
  4718. */
  4719. static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_local_seid(const uint8_t *event)
  4720. {
  4721. return event[5];
  4722. }
  4723. /**
  4724. * @brief Get field remote_seid from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4725. * @param event packet
  4726. * @return remote_seid
  4727. * @note: btstack_type 1
  4728. */
  4729. static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_remote_seid(const uint8_t *event)
  4730. {
  4731. return event[6];
  4732. }
  4733. /**
  4734. * @brief Get field reconfigure from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4735. * @param event packet
  4736. * @return reconfigure
  4737. * @note: btstack_type 1
  4738. */
  4739. static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_reconfigure(const uint8_t *event)
  4740. {
  4741. return event[7];
  4742. }
  4743. /**
  4744. * @brief Get field media_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4745. * @param event packet
  4746. * @return media_type
  4747. * @note: btstack_type 1
  4748. */
  4749. static inline uint8_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_type(const uint8_t *event)
  4750. {
  4751. return event[8];
  4752. }
  4753. /**
  4754. * @brief Get field media_codec_type from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4755. * @param event packet
  4756. * @return media_codec_type
  4757. * @note: btstack_type 2
  4758. */
  4759. static inline uint16_t avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_type(const uint8_t *event)
  4760. {
  4761. return little_endian_read_16(event, 9);
  4762. }
  4763. /**
  4764. * @brief Get field media_codec_information_len from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4765. * @param event packet
  4766. * @return media_codec_information_len
  4767. * @note: btstack_type L
  4768. */
  4769. static inline int avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information_len(const uint8_t *event)
  4770. {
  4771. return little_endian_read_16(event, 11);
  4772. }
  4773. /**
  4774. * @brief Get field media_codec_information from event AVDTP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  4775. * @param event packet
  4776. * @return media_codec_information
  4777. * @note: btstack_type V
  4778. */
  4779. static inline const uint8_t *avdtp_subevent_signaling_media_codec_other_configuration_get_media_codec_information(const uint8_t *event)
  4780. {
  4781. return &event[13];
  4782. }
  4783. /**
  4784. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED
  4785. * @param event packet
  4786. * @return avdtp_cid
  4787. * @note: btstack_type 2
  4788. */
  4789. static inline uint16_t avdtp_subevent_streaming_connection_established_get_avdtp_cid(const uint8_t *event)
  4790. {
  4791. return little_endian_read_16(event, 3);
  4792. }
  4793. /**
  4794. * @brief Get field bd_addr from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED
  4795. * @param event packet
  4796. * @param Pointer to storage for bd_addr
  4797. * @note: btstack_type B
  4798. */
  4799. static inline void avdtp_subevent_streaming_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  4800. {
  4801. reverse_bd_addr(&event[5], bd_addr);
  4802. }
  4803. /**
  4804. * @brief Get field local_seid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED
  4805. * @param event packet
  4806. * @return local_seid
  4807. * @note: btstack_type 1
  4808. */
  4809. static inline uint8_t avdtp_subevent_streaming_connection_established_get_local_seid(const uint8_t *event)
  4810. {
  4811. return event[11];
  4812. }
  4813. /**
  4814. * @brief Get field remote_seid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED
  4815. * @param event packet
  4816. * @return remote_seid
  4817. * @note: btstack_type 1
  4818. */
  4819. static inline uint8_t avdtp_subevent_streaming_connection_established_get_remote_seid(const uint8_t *event)
  4820. {
  4821. return event[12];
  4822. }
  4823. /**
  4824. * @brief Get field status from event AVDTP_SUBEVENT_STREAMING_CONNECTION_ESTABLISHED
  4825. * @param event packet
  4826. * @return status
  4827. * @note: btstack_type 1
  4828. */
  4829. static inline uint8_t avdtp_subevent_streaming_connection_established_get_status(const uint8_t *event)
  4830. {
  4831. return event[13];
  4832. }
  4833. /**
  4834. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED
  4835. * @param event packet
  4836. * @return avdtp_cid
  4837. * @note: btstack_type 2
  4838. */
  4839. static inline uint16_t avdtp_subevent_streaming_connection_released_get_avdtp_cid(const uint8_t *event)
  4840. {
  4841. return little_endian_read_16(event, 3);
  4842. }
  4843. /**
  4844. * @brief Get field local_seid from event AVDTP_SUBEVENT_STREAMING_CONNECTION_RELEASED
  4845. * @param event packet
  4846. * @return local_seid
  4847. * @note: btstack_type 1
  4848. */
  4849. static inline uint8_t avdtp_subevent_streaming_connection_released_get_local_seid(const uint8_t *event)
  4850. {
  4851. return event[5];
  4852. }
  4853. /**
  4854. * @brief Get field avdtp_cid from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
  4855. * @param event packet
  4856. * @return avdtp_cid
  4857. * @note: btstack_type 2
  4858. */
  4859. static inline uint16_t avdtp_subevent_streaming_can_send_media_packet_now_get_avdtp_cid(const uint8_t *event)
  4860. {
  4861. return little_endian_read_16(event, 3);
  4862. }
  4863. /**
  4864. * @brief Get field local_seid from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
  4865. * @param event packet
  4866. * @return local_seid
  4867. * @note: btstack_type 1
  4868. */
  4869. static inline uint8_t avdtp_subevent_streaming_can_send_media_packet_now_get_local_seid(const uint8_t *event)
  4870. {
  4871. return event[5];
  4872. }
  4873. /**
  4874. * @brief Get field sequence_number from event AVDTP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
  4875. * @param event packet
  4876. * @return sequence_number
  4877. * @note: btstack_type 2
  4878. */
  4879. static inline uint16_t avdtp_subevent_streaming_can_send_media_packet_now_get_sequence_number(const uint8_t *event)
  4880. {
  4881. return little_endian_read_16(event, 6);
  4882. }
  4883. /**
  4884. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
  4885. * @param event packet
  4886. * @return a2dp_cid
  4887. * @note: btstack_type 2
  4888. */
  4889. static inline uint16_t a2dp_subevent_streaming_can_send_media_packet_now_get_a2dp_cid(const uint8_t *event)
  4890. {
  4891. return little_endian_read_16(event, 3);
  4892. }
  4893. /**
  4894. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAMING_CAN_SEND_MEDIA_PACKET_NOW
  4895. * @param event packet
  4896. * @return local_seid
  4897. * @note: btstack_type 1
  4898. */
  4899. static inline uint8_t a2dp_subevent_streaming_can_send_media_packet_now_get_local_seid(const uint8_t *event)
  4900. {
  4901. return event[5];
  4902. }
  4903. /**
  4904. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4905. * @param event packet
  4906. * @return a2dp_cid
  4907. * @note: btstack_type 2
  4908. */
  4909. static inline uint16_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_a2dp_cid(const uint8_t *event)
  4910. {
  4911. return little_endian_read_16(event, 3);
  4912. }
  4913. /**
  4914. * @brief Get field int_seid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4915. * @param event packet
  4916. * @return int_seid
  4917. * @note: btstack_type 1
  4918. */
  4919. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_int_seid(const uint8_t *event)
  4920. {
  4921. return event[5];
  4922. }
  4923. /**
  4924. * @brief Get field acp_seid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4925. * @param event packet
  4926. * @return acp_seid
  4927. * @note: btstack_type 1
  4928. */
  4929. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_acp_seid(const uint8_t *event)
  4930. {
  4931. return event[6];
  4932. }
  4933. /**
  4934. * @brief Get field reconfigure from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4935. * @param event packet
  4936. * @return reconfigure
  4937. * @note: btstack_type 1
  4938. */
  4939. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_reconfigure(const uint8_t *event)
  4940. {
  4941. return event[7];
  4942. }
  4943. /**
  4944. * @brief Get field media_type from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4945. * @param event packet
  4946. * @return media_type
  4947. * @note: btstack_type 1
  4948. */
  4949. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_media_type(const uint8_t *event)
  4950. {
  4951. return event[8];
  4952. }
  4953. /**
  4954. * @brief Get field sampling_frequency from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4955. * @param event packet
  4956. * @return sampling_frequency
  4957. * @note: btstack_type 2
  4958. */
  4959. static inline uint16_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_sampling_frequency(const uint8_t *event)
  4960. {
  4961. return little_endian_read_16(event, 9);
  4962. }
  4963. /**
  4964. * @brief Get field channel_mode from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4965. * @param event packet
  4966. * @return channel_mode
  4967. * @note: btstack_type 1
  4968. */
  4969. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_channel_mode(const uint8_t *event)
  4970. {
  4971. return event[11];
  4972. }
  4973. /**
  4974. * @brief Get field num_channels from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4975. * @param event packet
  4976. * @return num_channels
  4977. * @note: btstack_type 1
  4978. */
  4979. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_num_channels(const uint8_t *event)
  4980. {
  4981. return event[12];
  4982. }
  4983. /**
  4984. * @brief Get field block_length from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4985. * @param event packet
  4986. * @return block_length
  4987. * @note: btstack_type 1
  4988. */
  4989. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_block_length(const uint8_t *event)
  4990. {
  4991. return event[13];
  4992. }
  4993. /**
  4994. * @brief Get field subbands from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  4995. * @param event packet
  4996. * @return subbands
  4997. * @note: btstack_type 1
  4998. */
  4999. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_subbands(const uint8_t *event)
  5000. {
  5001. return event[14];
  5002. }
  5003. /**
  5004. * @brief Get field allocation_method from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  5005. * @param event packet
  5006. * @return allocation_method
  5007. * @note: btstack_type 1
  5008. */
  5009. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_allocation_method(const uint8_t *event)
  5010. {
  5011. return event[15];
  5012. }
  5013. /**
  5014. * @brief Get field min_bitpool_value from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  5015. * @param event packet
  5016. * @return min_bitpool_value
  5017. * @note: btstack_type 1
  5018. */
  5019. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_min_bitpool_value(const uint8_t *event)
  5020. {
  5021. return event[16];
  5022. }
  5023. /**
  5024. * @brief Get field max_bitpool_value from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_SBC_CONFIGURATION
  5025. * @param event packet
  5026. * @return max_bitpool_value
  5027. * @note: btstack_type 1
  5028. */
  5029. static inline uint8_t a2dp_subevent_signaling_media_codec_sbc_configuration_get_max_bitpool_value(const uint8_t *event)
  5030. {
  5031. return event[17];
  5032. }
  5033. /**
  5034. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5035. * @param event packet
  5036. * @return a2dp_cid
  5037. * @note: btstack_type 2
  5038. */
  5039. static inline uint16_t a2dp_subevent_signaling_media_codec_other_configuration_get_a2dp_cid(const uint8_t *event)
  5040. {
  5041. return little_endian_read_16(event, 3);
  5042. }
  5043. /**
  5044. * @brief Get field int_seid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5045. * @param event packet
  5046. * @return int_seid
  5047. * @note: btstack_type 1
  5048. */
  5049. static inline uint8_t a2dp_subevent_signaling_media_codec_other_configuration_get_int_seid(const uint8_t *event)
  5050. {
  5051. return event[5];
  5052. }
  5053. /**
  5054. * @brief Get field acp_seid from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5055. * @param event packet
  5056. * @return acp_seid
  5057. * @note: btstack_type 1
  5058. */
  5059. static inline uint8_t a2dp_subevent_signaling_media_codec_other_configuration_get_acp_seid(const uint8_t *event)
  5060. {
  5061. return event[6];
  5062. }
  5063. /**
  5064. * @brief Get field reconfigure from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5065. * @param event packet
  5066. * @return reconfigure
  5067. * @note: btstack_type 1
  5068. */
  5069. static inline uint8_t a2dp_subevent_signaling_media_codec_other_configuration_get_reconfigure(const uint8_t *event)
  5070. {
  5071. return event[7];
  5072. }
  5073. /**
  5074. * @brief Get field media_type from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5075. * @param event packet
  5076. * @return media_type
  5077. * @note: btstack_type 1
  5078. */
  5079. static inline uint8_t a2dp_subevent_signaling_media_codec_other_configuration_get_media_type(const uint8_t *event)
  5080. {
  5081. return event[8];
  5082. }
  5083. /**
  5084. * @brief Get field media_codec_type from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5085. * @param event packet
  5086. * @return media_codec_type
  5087. * @note: btstack_type 2
  5088. */
  5089. static inline uint16_t a2dp_subevent_signaling_media_codec_other_configuration_get_media_codec_type(const uint8_t *event)
  5090. {
  5091. return little_endian_read_16(event, 9);
  5092. }
  5093. /**
  5094. * @brief Get field media_codec_information_len from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5095. * @param event packet
  5096. * @return media_codec_information_len
  5097. * @note: btstack_type L
  5098. */
  5099. static inline int a2dp_subevent_signaling_media_codec_other_configuration_get_media_codec_information_len(const uint8_t *event)
  5100. {
  5101. return little_endian_read_16(event, 11);
  5102. }
  5103. /**
  5104. * @brief Get field media_codec_information from event A2DP_SUBEVENT_SIGNALING_MEDIA_CODEC_OTHER_CONFIGURATION
  5105. * @param event packet
  5106. * @return media_codec_information
  5107. * @note: btstack_type V
  5108. */
  5109. static inline const uint8_t *a2dp_subevent_signaling_media_codec_other_configuration_get_media_codec_information(const uint8_t *event)
  5110. {
  5111. return &event[13];
  5112. }
  5113. /**
  5114. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_ESTABLISHED
  5115. * @param event packet
  5116. * @return a2dp_cid
  5117. * @note: btstack_type 2
  5118. */
  5119. static inline uint16_t a2dp_subevent_stream_established_get_a2dp_cid(const uint8_t *event)
  5120. {
  5121. return little_endian_read_16(event, 3);
  5122. }
  5123. /**
  5124. * @brief Get field bd_addr from event A2DP_SUBEVENT_STREAM_ESTABLISHED
  5125. * @param event packet
  5126. * @param Pointer to storage for bd_addr
  5127. * @note: btstack_type B
  5128. */
  5129. static inline void a2dp_subevent_stream_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  5130. {
  5131. reverse_bd_addr(&event[5], bd_addr);
  5132. }
  5133. /**
  5134. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_ESTABLISHED
  5135. * @param event packet
  5136. * @return local_seid
  5137. * @note: btstack_type 1
  5138. */
  5139. static inline uint8_t a2dp_subevent_stream_established_get_local_seid(const uint8_t *event)
  5140. {
  5141. return event[11];
  5142. }
  5143. /**
  5144. * @brief Get field remote_seid from event A2DP_SUBEVENT_STREAM_ESTABLISHED
  5145. * @param event packet
  5146. * @return remote_seid
  5147. * @note: btstack_type 1
  5148. */
  5149. static inline uint8_t a2dp_subevent_stream_established_get_remote_seid(const uint8_t *event)
  5150. {
  5151. return event[12];
  5152. }
  5153. /**
  5154. * @brief Get field status from event A2DP_SUBEVENT_STREAM_ESTABLISHED
  5155. * @param event packet
  5156. * @return status
  5157. * @note: btstack_type 1
  5158. */
  5159. static inline uint8_t a2dp_subevent_stream_established_get_status(const uint8_t *event)
  5160. {
  5161. return event[13];
  5162. }
  5163. /**
  5164. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_STARTED
  5165. * @param event packet
  5166. * @return a2dp_cid
  5167. * @note: btstack_type 2
  5168. */
  5169. static inline uint16_t a2dp_subevent_stream_started_get_a2dp_cid(const uint8_t *event)
  5170. {
  5171. return little_endian_read_16(event, 3);
  5172. }
  5173. /**
  5174. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_STARTED
  5175. * @param event packet
  5176. * @return local_seid
  5177. * @note: btstack_type 1
  5178. */
  5179. static inline uint8_t a2dp_subevent_stream_started_get_local_seid(const uint8_t *event)
  5180. {
  5181. return event[5];
  5182. }
  5183. /**
  5184. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_SUSPENDED
  5185. * @param event packet
  5186. * @return a2dp_cid
  5187. * @note: btstack_type 2
  5188. */
  5189. static inline uint16_t a2dp_subevent_stream_suspended_get_a2dp_cid(const uint8_t *event)
  5190. {
  5191. return little_endian_read_16(event, 3);
  5192. }
  5193. /**
  5194. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_SUSPENDED
  5195. * @param event packet
  5196. * @return local_seid
  5197. * @note: btstack_type 1
  5198. */
  5199. static inline uint8_t a2dp_subevent_stream_suspended_get_local_seid(const uint8_t *event)
  5200. {
  5201. return event[5];
  5202. }
  5203. /**
  5204. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_STOPPED
  5205. * @param event packet
  5206. * @return a2dp_cid
  5207. * @note: btstack_type 2
  5208. */
  5209. static inline uint16_t a2dp_subevent_stream_stopped_get_a2dp_cid(const uint8_t *event)
  5210. {
  5211. return little_endian_read_16(event, 3);
  5212. }
  5213. /**
  5214. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_STOPPED
  5215. * @param event packet
  5216. * @return local_seid
  5217. * @note: btstack_type 1
  5218. */
  5219. static inline uint8_t a2dp_subevent_stream_stopped_get_local_seid(const uint8_t *event)
  5220. {
  5221. return event[5];
  5222. }
  5223. /**
  5224. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_STREAM_RELEASED
  5225. * @param event packet
  5226. * @return a2dp_cid
  5227. * @note: btstack_type 2
  5228. */
  5229. static inline uint16_t a2dp_subevent_stream_released_get_a2dp_cid(const uint8_t *event)
  5230. {
  5231. return little_endian_read_16(event, 3);
  5232. }
  5233. /**
  5234. * @brief Get field local_seid from event A2DP_SUBEVENT_STREAM_RELEASED
  5235. * @param event packet
  5236. * @return local_seid
  5237. * @note: btstack_type 1
  5238. */
  5239. static inline uint8_t a2dp_subevent_stream_released_get_local_seid(const uint8_t *event)
  5240. {
  5241. return event[5];
  5242. }
  5243. /**
  5244. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_COMMAND_ACCEPTED
  5245. * @param event packet
  5246. * @return a2dp_cid
  5247. * @note: btstack_type 2
  5248. */
  5249. static inline uint16_t a2dp_subevent_command_accepted_get_a2dp_cid(const uint8_t *event)
  5250. {
  5251. return little_endian_read_16(event, 3);
  5252. }
  5253. /**
  5254. * @brief Get field local_seid from event A2DP_SUBEVENT_COMMAND_ACCEPTED
  5255. * @param event packet
  5256. * @return local_seid
  5257. * @note: btstack_type 1
  5258. */
  5259. static inline uint8_t a2dp_subevent_command_accepted_get_local_seid(const uint8_t *event)
  5260. {
  5261. return event[5];
  5262. }
  5263. /**
  5264. * @brief Get field signal_identifier from event A2DP_SUBEVENT_COMMAND_ACCEPTED
  5265. * @param event packet
  5266. * @return signal_identifier
  5267. * @note: btstack_type 1
  5268. */
  5269. static inline uint8_t a2dp_subevent_command_accepted_get_signal_identifier(const uint8_t *event)
  5270. {
  5271. return event[6];
  5272. }
  5273. /**
  5274. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_COMMAND_REJECTED
  5275. * @param event packet
  5276. * @return a2dp_cid
  5277. * @note: btstack_type 2
  5278. */
  5279. static inline uint16_t a2dp_subevent_command_rejected_get_a2dp_cid(const uint8_t *event)
  5280. {
  5281. return little_endian_read_16(event, 3);
  5282. }
  5283. /**
  5284. * @brief Get field local_seid from event A2DP_SUBEVENT_COMMAND_REJECTED
  5285. * @param event packet
  5286. * @return local_seid
  5287. * @note: btstack_type 1
  5288. */
  5289. static inline uint8_t a2dp_subevent_command_rejected_get_local_seid(const uint8_t *event)
  5290. {
  5291. return event[5];
  5292. }
  5293. /**
  5294. * @brief Get field signal_identifier from event A2DP_SUBEVENT_COMMAND_REJECTED
  5295. * @param event packet
  5296. * @return signal_identifier
  5297. * @note: btstack_type 1
  5298. */
  5299. static inline uint8_t a2dp_subevent_command_rejected_get_signal_identifier(const uint8_t *event)
  5300. {
  5301. return event[6];
  5302. }
  5303. /**
  5304. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_INCOMING_CONNECTION_ESTABLISHED
  5305. * @param event packet
  5306. * @return a2dp_cid
  5307. * @note: btstack_type 2
  5308. */
  5309. static inline uint16_t a2dp_subevent_incoming_connection_established_get_a2dp_cid(const uint8_t *event)
  5310. {
  5311. return little_endian_read_16(event, 3);
  5312. }
  5313. /**
  5314. * @brief Get field bd_addr from event A2DP_SUBEVENT_INCOMING_CONNECTION_ESTABLISHED
  5315. * @param event packet
  5316. * @param Pointer to storage for bd_addr
  5317. * @note: btstack_type B
  5318. */
  5319. static inline void a2dp_subevent_incoming_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  5320. {
  5321. reverse_bd_addr(&event[5], bd_addr);
  5322. }
  5323. /**
  5324. * @brief Get field a2dp_cid from event A2DP_SUBEVENT_SIGNALING_CONNECTION_RELEASED
  5325. * @param event packet
  5326. * @return a2dp_cid
  5327. * @note: btstack_type 2
  5328. */
  5329. static inline uint16_t a2dp_subevent_signaling_connection_released_get_a2dp_cid(const uint8_t *event)
  5330. {
  5331. return little_endian_read_16(event, 3);
  5332. }
  5333. /**
  5334. * @brief Get field status from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED
  5335. * @param event packet
  5336. * @return status
  5337. * @note: btstack_type 1
  5338. */
  5339. static inline uint8_t avrcp_subevent_connection_established_get_status(const uint8_t *event)
  5340. {
  5341. return event[3];
  5342. }
  5343. /**
  5344. * @brief Get field bd_addr from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED
  5345. * @param event packet
  5346. * @param Pointer to storage for bd_addr
  5347. * @note: btstack_type B
  5348. */
  5349. static inline void avrcp_subevent_connection_established_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  5350. {
  5351. reverse_bd_addr(&event[4], bd_addr);
  5352. }
  5353. /**
  5354. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_CONNECTION_ESTABLISHED
  5355. * @param event packet
  5356. * @return avrcp_cid
  5357. * @note: btstack_type 2
  5358. */
  5359. static inline uint16_t avrcp_subevent_connection_established_get_avrcp_cid(const uint8_t *event)
  5360. {
  5361. return little_endian_read_16(event, 10);
  5362. }
  5363. /**
  5364. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_CONNECTION_RELEASED
  5365. * @param event packet
  5366. * @return avrcp_cid
  5367. * @note: btstack_type 2
  5368. */
  5369. static inline uint16_t avrcp_subevent_connection_released_get_avrcp_cid(const uint8_t *event)
  5370. {
  5371. return little_endian_read_16(event, 3);
  5372. }
  5373. /**
  5374. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE
  5375. * @param event packet
  5376. * @return avrcp_cid
  5377. * @note: btstack_type 2
  5378. */
  5379. static inline uint16_t avrcp_subevent_shuffle_and_repeat_mode_get_avrcp_cid(const uint8_t *event)
  5380. {
  5381. return little_endian_read_16(event, 3);
  5382. }
  5383. /**
  5384. * @brief Get field command_type from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE
  5385. * @param event packet
  5386. * @return command_type
  5387. * @note: btstack_type 1
  5388. */
  5389. static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_command_type(const uint8_t *event)
  5390. {
  5391. return event[5];
  5392. }
  5393. /**
  5394. * @brief Get field repeat_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE
  5395. * @param event packet
  5396. * @return repeat_mode
  5397. * @note: btstack_type 1
  5398. */
  5399. static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_repeat_mode(const uint8_t *event)
  5400. {
  5401. return event[6];
  5402. }
  5403. /**
  5404. * @brief Get field shuffle_mode from event AVRCP_SUBEVENT_SHUFFLE_AND_REPEAT_MODE
  5405. * @param event packet
  5406. * @return shuffle_mode
  5407. * @note: btstack_type 1
  5408. */
  5409. static inline uint8_t avrcp_subevent_shuffle_and_repeat_mode_get_shuffle_mode(const uint8_t *event)
  5410. {
  5411. return event[7];
  5412. }
  5413. /**
  5414. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_PLAY_STATUS
  5415. * @param event packet
  5416. * @return avrcp_cid
  5417. * @note: btstack_type 2
  5418. */
  5419. static inline uint16_t avrcp_subevent_play_status_get_avrcp_cid(const uint8_t *event)
  5420. {
  5421. return little_endian_read_16(event, 3);
  5422. }
  5423. /**
  5424. * @brief Get field command_type from event AVRCP_SUBEVENT_PLAY_STATUS
  5425. * @param event packet
  5426. * @return command_type
  5427. * @note: btstack_type 1
  5428. */
  5429. static inline uint8_t avrcp_subevent_play_status_get_command_type(const uint8_t *event)
  5430. {
  5431. return event[5];
  5432. }
  5433. /**
  5434. * @brief Get field song_length from event AVRCP_SUBEVENT_PLAY_STATUS
  5435. * @param event packet
  5436. * @return song_length
  5437. * @note: btstack_type 4
  5438. */
  5439. static inline uint32_t avrcp_subevent_play_status_get_song_length(const uint8_t *event)
  5440. {
  5441. return little_endian_read_32(event, 6);
  5442. }
  5443. /**
  5444. * @brief Get field song_position from event AVRCP_SUBEVENT_PLAY_STATUS
  5445. * @param event packet
  5446. * @return song_position
  5447. * @note: btstack_type 4
  5448. */
  5449. static inline uint32_t avrcp_subevent_play_status_get_song_position(const uint8_t *event)
  5450. {
  5451. return little_endian_read_32(event, 10);
  5452. }
  5453. /**
  5454. * @brief Get field play_status from event AVRCP_SUBEVENT_PLAY_STATUS
  5455. * @param event packet
  5456. * @return play_status
  5457. * @note: btstack_type 1
  5458. */
  5459. static inline uint8_t avrcp_subevent_play_status_get_play_status(const uint8_t *event)
  5460. {
  5461. return event[14];
  5462. }
  5463. /**
  5464. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED
  5465. * @param event packet
  5466. * @return avrcp_cid
  5467. * @note: btstack_type 2
  5468. */
  5469. static inline uint16_t avrcp_subevent_notification_playback_status_changed_get_avrcp_cid(const uint8_t *event)
  5470. {
  5471. return little_endian_read_16(event, 3);
  5472. }
  5473. /**
  5474. * @brief Get field command_type from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED
  5475. * @param event packet
  5476. * @return command_type
  5477. * @note: btstack_type 1
  5478. */
  5479. static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_command_type(const uint8_t *event)
  5480. {
  5481. return event[5];
  5482. }
  5483. /**
  5484. * @brief Get field play_status from event AVRCP_SUBEVENT_NOTIFICATION_PLAYBACK_STATUS_CHANGED
  5485. * @param event packet
  5486. * @return play_status
  5487. * @note: btstack_type 1
  5488. */
  5489. static inline uint8_t avrcp_subevent_notification_playback_status_changed_get_play_status(const uint8_t *event)
  5490. {
  5491. return event[6];
  5492. }
  5493. /**
  5494. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED
  5495. * @param event packet
  5496. * @return avrcp_cid
  5497. * @note: btstack_type 2
  5498. */
  5499. static inline uint16_t avrcp_subevent_notification_track_changed_get_avrcp_cid(const uint8_t *event)
  5500. {
  5501. return little_endian_read_16(event, 3);
  5502. }
  5503. /**
  5504. * @brief Get field command_type from event AVRCP_SUBEVENT_NOTIFICATION_TRACK_CHANGED
  5505. * @param event packet
  5506. * @return command_type
  5507. * @note: btstack_type 1
  5508. */
  5509. static inline uint8_t avrcp_subevent_notification_track_changed_get_command_type(const uint8_t *event)
  5510. {
  5511. return event[5];
  5512. }
  5513. /**
  5514. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED
  5515. * @param event packet
  5516. * @return avrcp_cid
  5517. * @note: btstack_type 2
  5518. */
  5519. static inline uint16_t avrcp_subevent_notification_now_playing_content_changed_get_avrcp_cid(const uint8_t *event)
  5520. {
  5521. return little_endian_read_16(event, 3);
  5522. }
  5523. /**
  5524. * @brief Get field command_type from event AVRCP_SUBEVENT_NOTIFICATION_NOW_PLAYING_CONTENT_CHANGED
  5525. * @param event packet
  5526. * @return command_type
  5527. * @note: btstack_type 1
  5528. */
  5529. static inline uint8_t avrcp_subevent_notification_now_playing_content_changed_get_command_type(const uint8_t *event)
  5530. {
  5531. return event[5];
  5532. }
  5533. /**
  5534. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED
  5535. * @param event packet
  5536. * @return avrcp_cid
  5537. * @note: btstack_type 2
  5538. */
  5539. static inline uint16_t avrcp_subevent_notification_available_players_changed_get_avrcp_cid(const uint8_t *event)
  5540. {
  5541. return little_endian_read_16(event, 3);
  5542. }
  5543. /**
  5544. * @brief Get field command_type from event AVRCP_SUBEVENT_NOTIFICATION_AVAILABLE_PLAYERS_CHANGED
  5545. * @param event packet
  5546. * @return command_type
  5547. * @note: btstack_type 1
  5548. */
  5549. static inline uint8_t avrcp_subevent_notification_available_players_changed_get_command_type(const uint8_t *event)
  5550. {
  5551. return event[5];
  5552. }
  5553. /**
  5554. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED
  5555. * @param event packet
  5556. * @return avrcp_cid
  5557. * @note: btstack_type 2
  5558. */
  5559. static inline uint16_t avrcp_subevent_notification_volume_changed_get_avrcp_cid(const uint8_t *event)
  5560. {
  5561. return little_endian_read_16(event, 3);
  5562. }
  5563. /**
  5564. * @brief Get field command_type from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED
  5565. * @param event packet
  5566. * @return command_type
  5567. * @note: btstack_type 1
  5568. */
  5569. static inline uint8_t avrcp_subevent_notification_volume_changed_get_command_type(const uint8_t *event)
  5570. {
  5571. return event[5];
  5572. }
  5573. /**
  5574. * @brief Get field absolute_volume from event AVRCP_SUBEVENT_NOTIFICATION_VOLUME_CHANGED
  5575. * @param event packet
  5576. * @return absolute_volume
  5577. * @note: btstack_type 1
  5578. */
  5579. static inline uint8_t avrcp_subevent_notification_volume_changed_get_absolute_volume(const uint8_t *event)
  5580. {
  5581. return event[6];
  5582. }
  5583. /**
  5584. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE
  5585. * @param event packet
  5586. * @return avrcp_cid
  5587. * @note: btstack_type 2
  5588. */
  5589. static inline uint16_t avrcp_subevent_set_absolute_volume_response_get_avrcp_cid(const uint8_t *event)
  5590. {
  5591. return little_endian_read_16(event, 3);
  5592. }
  5593. /**
  5594. * @brief Get field command_type from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE
  5595. * @param event packet
  5596. * @return command_type
  5597. * @note: btstack_type 1
  5598. */
  5599. static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_command_type(const uint8_t *event)
  5600. {
  5601. return event[5];
  5602. }
  5603. /**
  5604. * @brief Get field absolute_volume from event AVRCP_SUBEVENT_SET_ABSOLUTE_VOLUME_RESPONSE
  5605. * @param event packet
  5606. * @return absolute_volume
  5607. * @note: btstack_type 1
  5608. */
  5609. static inline uint8_t avrcp_subevent_set_absolute_volume_response_get_absolute_volume(const uint8_t *event)
  5610. {
  5611. return event[6];
  5612. }
  5613. /**
  5614. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE
  5615. * @param event packet
  5616. * @return avrcp_cid
  5617. * @note: btstack_type 2
  5618. */
  5619. static inline uint16_t avrcp_subevent_enable_notification_complete_get_avrcp_cid(const uint8_t *event)
  5620. {
  5621. return little_endian_read_16(event, 3);
  5622. }
  5623. /**
  5624. * @brief Get field command_type from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE
  5625. * @param event packet
  5626. * @return command_type
  5627. * @note: btstack_type 1
  5628. */
  5629. static inline uint8_t avrcp_subevent_enable_notification_complete_get_command_type(const uint8_t *event)
  5630. {
  5631. return event[5];
  5632. }
  5633. /**
  5634. * @brief Get field notification_id from event AVRCP_SUBEVENT_ENABLE_NOTIFICATION_COMPLETE
  5635. * @param event packet
  5636. * @return notification_id
  5637. * @note: btstack_type 1
  5638. */
  5639. static inline uint8_t avrcp_subevent_enable_notification_complete_get_notification_id(const uint8_t *event)
  5640. {
  5641. return event[6];
  5642. }
  5643. /**
  5644. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_OPERATION_START
  5645. * @param event packet
  5646. * @return avrcp_cid
  5647. * @note: btstack_type 2
  5648. */
  5649. static inline uint16_t avrcp_subevent_operation_start_get_avrcp_cid(const uint8_t *event)
  5650. {
  5651. return little_endian_read_16(event, 3);
  5652. }
  5653. /**
  5654. * @brief Get field command_type from event AVRCP_SUBEVENT_OPERATION_START
  5655. * @param event packet
  5656. * @return command_type
  5657. * @note: btstack_type 1
  5658. */
  5659. static inline uint8_t avrcp_subevent_operation_start_get_command_type(const uint8_t *event)
  5660. {
  5661. return event[5];
  5662. }
  5663. /**
  5664. * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_START
  5665. * @param event packet
  5666. * @return operation_id
  5667. * @note: btstack_type 1
  5668. */
  5669. static inline uint8_t avrcp_subevent_operation_start_get_operation_id(const uint8_t *event)
  5670. {
  5671. return event[6];
  5672. }
  5673. /**
  5674. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_OPERATION_COMPLETE
  5675. * @param event packet
  5676. * @return avrcp_cid
  5677. * @note: btstack_type 2
  5678. */
  5679. static inline uint16_t avrcp_subevent_operation_complete_get_avrcp_cid(const uint8_t *event)
  5680. {
  5681. return little_endian_read_16(event, 3);
  5682. }
  5683. /**
  5684. * @brief Get field command_type from event AVRCP_SUBEVENT_OPERATION_COMPLETE
  5685. * @param event packet
  5686. * @return command_type
  5687. * @note: btstack_type 1
  5688. */
  5689. static inline uint8_t avrcp_subevent_operation_complete_get_command_type(const uint8_t *event)
  5690. {
  5691. return event[5];
  5692. }
  5693. /**
  5694. * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION_COMPLETE
  5695. * @param event packet
  5696. * @return operation_id
  5697. * @note: btstack_type 1
  5698. */
  5699. static inline uint8_t avrcp_subevent_operation_complete_get_operation_id(const uint8_t *event)
  5700. {
  5701. return event[6];
  5702. }
  5703. /**
  5704. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE
  5705. * @param event packet
  5706. * @return avrcp_cid
  5707. * @note: btstack_type 2
  5708. */
  5709. static inline uint16_t avrcp_subevent_player_application_value_response_get_avrcp_cid(const uint8_t *event)
  5710. {
  5711. return little_endian_read_16(event, 3);
  5712. }
  5713. /**
  5714. * @brief Get field command_type from event AVRCP_SUBEVENT_PLAYER_APPLICATION_VALUE_RESPONSE
  5715. * @param event packet
  5716. * @return command_type
  5717. * @note: btstack_type 1
  5718. */
  5719. static inline uint8_t avrcp_subevent_player_application_value_response_get_command_type(const uint8_t *event)
  5720. {
  5721. return event[5];
  5722. }
  5723. /**
  5724. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_COMPANY_IDS_QUERY
  5725. * @param event packet
  5726. * @return avrcp_cid
  5727. * @note: btstack_type 2
  5728. */
  5729. static inline uint16_t avrcp_subevent_company_ids_query_get_avrcp_cid(const uint8_t *event)
  5730. {
  5731. return little_endian_read_16(event, 3);
  5732. }
  5733. /**
  5734. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_EVENT_IDS_QUERY
  5735. * @param event packet
  5736. * @return avrcp_cid
  5737. * @note: btstack_type 2
  5738. */
  5739. static inline uint16_t avrcp_subevent_event_ids_query_get_avrcp_cid(const uint8_t *event)
  5740. {
  5741. return little_endian_read_16(event, 3);
  5742. }
  5743. /**
  5744. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_PLAY_STATUS_QUERY
  5745. * @param event packet
  5746. * @return avrcp_cid
  5747. * @note: btstack_type 2
  5748. */
  5749. static inline uint16_t avrcp_subevent_play_status_query_get_avrcp_cid(const uint8_t *event)
  5750. {
  5751. return little_endian_read_16(event, 3);
  5752. }
  5753. /**
  5754. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_OPERATION
  5755. * @param event packet
  5756. * @return avrcp_cid
  5757. * @note: btstack_type 2
  5758. */
  5759. static inline uint16_t avrcp_subevent_operation_get_avrcp_cid(const uint8_t *event)
  5760. {
  5761. return little_endian_read_16(event, 3);
  5762. }
  5763. /**
  5764. * @brief Get field operation_id from event AVRCP_SUBEVENT_OPERATION
  5765. * @param event packet
  5766. * @return operation_id
  5767. * @note: btstack_type 1
  5768. */
  5769. static inline uint8_t avrcp_subevent_operation_get_operation_id(const uint8_t *event)
  5770. {
  5771. return event[5];
  5772. }
  5773. /**
  5774. * @brief Get field operands_length from event AVRCP_SUBEVENT_OPERATION
  5775. * @param event packet
  5776. * @return operands_length
  5777. * @note: btstack_type 1
  5778. */
  5779. static inline uint8_t avrcp_subevent_operation_get_operands_length(const uint8_t *event)
  5780. {
  5781. return event[6];
  5782. }
  5783. /**
  5784. * @brief Get field operand from event AVRCP_SUBEVENT_OPERATION
  5785. * @param event packet
  5786. * @return operand
  5787. * @note: btstack_type 1
  5788. */
  5789. static inline uint8_t avrcp_subevent_operation_get_operand(const uint8_t *event)
  5790. {
  5791. return event[7];
  5792. }
  5793. /**
  5794. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO
  5795. * @param event packet
  5796. * @return avrcp_cid
  5797. * @note: btstack_type 2
  5798. */
  5799. static inline uint16_t avrcp_subevent_now_playing_track_info_get_avrcp_cid(const uint8_t *event)
  5800. {
  5801. return little_endian_read_16(event, 3);
  5802. }
  5803. /**
  5804. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO
  5805. * @param event packet
  5806. * @return command_type
  5807. * @note: btstack_type 1
  5808. */
  5809. static inline uint8_t avrcp_subevent_now_playing_track_info_get_command_type(const uint8_t *event)
  5810. {
  5811. return event[5];
  5812. }
  5813. /**
  5814. * @brief Get field track from event AVRCP_SUBEVENT_NOW_PLAYING_TRACK_INFO
  5815. * @param event packet
  5816. * @return track
  5817. * @note: btstack_type 1
  5818. */
  5819. static inline uint8_t avrcp_subevent_now_playing_track_info_get_track(const uint8_t *event)
  5820. {
  5821. return event[6];
  5822. }
  5823. /**
  5824. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO
  5825. * @param event packet
  5826. * @return avrcp_cid
  5827. * @note: btstack_type 2
  5828. */
  5829. static inline uint16_t avrcp_subevent_now_playing_total_tracks_info_get_avrcp_cid(const uint8_t *event)
  5830. {
  5831. return little_endian_read_16(event, 3);
  5832. }
  5833. /**
  5834. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO
  5835. * @param event packet
  5836. * @return command_type
  5837. * @note: btstack_type 1
  5838. */
  5839. static inline uint8_t avrcp_subevent_now_playing_total_tracks_info_get_command_type(const uint8_t *event)
  5840. {
  5841. return event[5];
  5842. }
  5843. /**
  5844. * @brief Get field total_tracks from event AVRCP_SUBEVENT_NOW_PLAYING_TOTAL_TRACKS_INFO
  5845. * @param event packet
  5846. * @return total_tracks
  5847. * @note: btstack_type 1
  5848. */
  5849. static inline uint8_t avrcp_subevent_now_playing_total_tracks_info_get_total_tracks(const uint8_t *event)
  5850. {
  5851. return event[6];
  5852. }
  5853. /**
  5854. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO
  5855. * @param event packet
  5856. * @return avrcp_cid
  5857. * @note: btstack_type 2
  5858. */
  5859. static inline uint16_t avrcp_subevent_now_playing_song_length_ms_info_get_avrcp_cid(const uint8_t *event)
  5860. {
  5861. return little_endian_read_16(event, 3);
  5862. }
  5863. /**
  5864. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO
  5865. * @param event packet
  5866. * @return command_type
  5867. * @note: btstack_type 1
  5868. */
  5869. static inline uint8_t avrcp_subevent_now_playing_song_length_ms_info_get_command_type(const uint8_t *event)
  5870. {
  5871. return event[5];
  5872. }
  5873. /**
  5874. * @brief Get field song_length from event AVRCP_SUBEVENT_NOW_PLAYING_SONG_LENGTH_MS_INFO
  5875. * @param event packet
  5876. * @return song_length
  5877. * @note: btstack_type 4
  5878. */
  5879. static inline uint32_t avrcp_subevent_now_playing_song_length_ms_info_get_song_length(const uint8_t *event)
  5880. {
  5881. return little_endian_read_32(event, 6);
  5882. }
  5883. /**
  5884. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO
  5885. * @param event packet
  5886. * @return avrcp_cid
  5887. * @note: btstack_type 2
  5888. */
  5889. static inline uint16_t avrcp_subevent_now_playing_title_info_get_avrcp_cid(const uint8_t *event)
  5890. {
  5891. return little_endian_read_16(event, 3);
  5892. }
  5893. /**
  5894. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO
  5895. * @param event packet
  5896. * @return command_type
  5897. * @note: btstack_type 1
  5898. */
  5899. static inline uint8_t avrcp_subevent_now_playing_title_info_get_command_type(const uint8_t *event)
  5900. {
  5901. return event[5];
  5902. }
  5903. /**
  5904. * @brief Get field value_len from event AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO
  5905. * @param event packet
  5906. * @return value_len
  5907. * @note: btstack_type J
  5908. */
  5909. static inline int avrcp_subevent_now_playing_title_info_get_value_len(const uint8_t *event)
  5910. {
  5911. return event[6];
  5912. }
  5913. /**
  5914. * @brief Get field value from event AVRCP_SUBEVENT_NOW_PLAYING_TITLE_INFO
  5915. * @param event packet
  5916. * @return value
  5917. * @note: btstack_type V
  5918. */
  5919. static inline const uint8_t *avrcp_subevent_now_playing_title_info_get_value(const uint8_t *event)
  5920. {
  5921. return &event[7];
  5922. }
  5923. /**
  5924. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO
  5925. * @param event packet
  5926. * @return avrcp_cid
  5927. * @note: btstack_type 2
  5928. */
  5929. static inline uint16_t avrcp_subevent_now_playing_artist_info_get_avrcp_cid(const uint8_t *event)
  5930. {
  5931. return little_endian_read_16(event, 3);
  5932. }
  5933. /**
  5934. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO
  5935. * @param event packet
  5936. * @return command_type
  5937. * @note: btstack_type 1
  5938. */
  5939. static inline uint8_t avrcp_subevent_now_playing_artist_info_get_command_type(const uint8_t *event)
  5940. {
  5941. return event[5];
  5942. }
  5943. /**
  5944. * @brief Get field value_len from event AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO
  5945. * @param event packet
  5946. * @return value_len
  5947. * @note: btstack_type J
  5948. */
  5949. static inline int avrcp_subevent_now_playing_artist_info_get_value_len(const uint8_t *event)
  5950. {
  5951. return event[6];
  5952. }
  5953. /**
  5954. * @brief Get field value from event AVRCP_SUBEVENT_NOW_PLAYING_ARTIST_INFO
  5955. * @param event packet
  5956. * @return value
  5957. * @note: btstack_type V
  5958. */
  5959. static inline const uint8_t *avrcp_subevent_now_playing_artist_info_get_value(const uint8_t *event)
  5960. {
  5961. return &event[7];
  5962. }
  5963. /**
  5964. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO
  5965. * @param event packet
  5966. * @return avrcp_cid
  5967. * @note: btstack_type 2
  5968. */
  5969. static inline uint16_t avrcp_subevent_now_playing_album_info_get_avrcp_cid(const uint8_t *event)
  5970. {
  5971. return little_endian_read_16(event, 3);
  5972. }
  5973. /**
  5974. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO
  5975. * @param event packet
  5976. * @return command_type
  5977. * @note: btstack_type 1
  5978. */
  5979. static inline uint8_t avrcp_subevent_now_playing_album_info_get_command_type(const uint8_t *event)
  5980. {
  5981. return event[5];
  5982. }
  5983. /**
  5984. * @brief Get field value_len from event AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO
  5985. * @param event packet
  5986. * @return value_len
  5987. * @note: btstack_type J
  5988. */
  5989. static inline int avrcp_subevent_now_playing_album_info_get_value_len(const uint8_t *event)
  5990. {
  5991. return event[6];
  5992. }
  5993. /**
  5994. * @brief Get field value from event AVRCP_SUBEVENT_NOW_PLAYING_ALBUM_INFO
  5995. * @param event packet
  5996. * @return value
  5997. * @note: btstack_type V
  5998. */
  5999. static inline const uint8_t *avrcp_subevent_now_playing_album_info_get_value(const uint8_t *event)
  6000. {
  6001. return &event[7];
  6002. }
  6003. /**
  6004. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO
  6005. * @param event packet
  6006. * @return avrcp_cid
  6007. * @note: btstack_type 2
  6008. */
  6009. static inline uint16_t avrcp_subevent_now_playing_genre_info_get_avrcp_cid(const uint8_t *event)
  6010. {
  6011. return little_endian_read_16(event, 3);
  6012. }
  6013. /**
  6014. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO
  6015. * @param event packet
  6016. * @return command_type
  6017. * @note: btstack_type 1
  6018. */
  6019. static inline uint8_t avrcp_subevent_now_playing_genre_info_get_command_type(const uint8_t *event)
  6020. {
  6021. return event[5];
  6022. }
  6023. /**
  6024. * @brief Get field value_len from event AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO
  6025. * @param event packet
  6026. * @return value_len
  6027. * @note: btstack_type J
  6028. */
  6029. static inline int avrcp_subevent_now_playing_genre_info_get_value_len(const uint8_t *event)
  6030. {
  6031. return event[6];
  6032. }
  6033. /**
  6034. * @brief Get field value from event AVRCP_SUBEVENT_NOW_PLAYING_GENRE_INFO
  6035. * @param event packet
  6036. * @return value
  6037. * @note: btstack_type V
  6038. */
  6039. static inline const uint8_t *avrcp_subevent_now_playing_genre_info_get_value(const uint8_t *event)
  6040. {
  6041. return &event[7];
  6042. }
  6043. /**
  6044. * @brief Get field avrcp_cid from event AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE
  6045. * @param event packet
  6046. * @return avrcp_cid
  6047. * @note: btstack_type 2
  6048. */
  6049. static inline uint16_t avrcp_subevent_now_playing_info_done_get_avrcp_cid(const uint8_t *event)
  6050. {
  6051. return little_endian_read_16(event, 3);
  6052. }
  6053. /**
  6054. * @brief Get field command_type from event AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE
  6055. * @param event packet
  6056. * @return command_type
  6057. * @note: btstack_type 1
  6058. */
  6059. static inline uint8_t avrcp_subevent_now_playing_info_done_get_command_type(const uint8_t *event)
  6060. {
  6061. return event[5];
  6062. }
  6063. /**
  6064. * @brief Get field status from event AVRCP_SUBEVENT_NOW_PLAYING_INFO_DONE
  6065. * @param event packet
  6066. * @return status
  6067. * @note: btstack_type 1
  6068. */
  6069. static inline uint8_t avrcp_subevent_now_playing_info_done_get_status(const uint8_t *event)
  6070. {
  6071. return event[6];
  6072. }
  6073. /**
  6074. * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_OPENED
  6075. * @param event packet
  6076. * @return goep_cid
  6077. * @note: btstack_type 2
  6078. */
  6079. static inline uint16_t goep_subevent_connection_opened_get_goep_cid(const uint8_t *event)
  6080. {
  6081. return little_endian_read_16(event, 3);
  6082. }
  6083. /**
  6084. * @brief Get field status from event GOEP_SUBEVENT_CONNECTION_OPENED
  6085. * @param event packet
  6086. * @return status
  6087. * @note: btstack_type 1
  6088. */
  6089. static inline uint8_t goep_subevent_connection_opened_get_status(const uint8_t *event)
  6090. {
  6091. return event[5];
  6092. }
  6093. /**
  6094. * @brief Get field bd_addr from event GOEP_SUBEVENT_CONNECTION_OPENED
  6095. * @param event packet
  6096. * @param Pointer to storage for bd_addr
  6097. * @note: btstack_type B
  6098. */
  6099. static inline void goep_subevent_connection_opened_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  6100. {
  6101. reverse_bd_addr(&event[6], bd_addr);
  6102. }
  6103. /**
  6104. * @brief Get field con_handle from event GOEP_SUBEVENT_CONNECTION_OPENED
  6105. * @param event packet
  6106. * @return con_handle
  6107. * @note: btstack_type H
  6108. */
  6109. static inline hci_con_handle_t goep_subevent_connection_opened_get_con_handle(const uint8_t *event)
  6110. {
  6111. return little_endian_read_16(event, 12);
  6112. }
  6113. /**
  6114. * @brief Get field incoming from event GOEP_SUBEVENT_CONNECTION_OPENED
  6115. * @param event packet
  6116. * @return incoming
  6117. * @note: btstack_type 1
  6118. */
  6119. static inline uint8_t goep_subevent_connection_opened_get_incoming(const uint8_t *event)
  6120. {
  6121. return event[14];
  6122. }
  6123. /**
  6124. * @brief Get field goep_cid from event GOEP_SUBEVENT_CONNECTION_CLOSED
  6125. * @param event packet
  6126. * @return goep_cid
  6127. * @note: btstack_type 2
  6128. */
  6129. static inline uint16_t goep_subevent_connection_closed_get_goep_cid(const uint8_t *event)
  6130. {
  6131. return little_endian_read_16(event, 3);
  6132. }
  6133. /**
  6134. * @brief Get field goep_cid from event GOEP_SUBEVENT_CAN_SEND_NOW
  6135. * @param event packet
  6136. * @return goep_cid
  6137. * @note: btstack_type 2
  6138. */
  6139. static inline uint16_t goep_subevent_can_send_now_get_goep_cid(const uint8_t *event)
  6140. {
  6141. return little_endian_read_16(event, 3);
  6142. }
  6143. /**
  6144. * @brief Get field pbap_cid from event PBAP_SUBEVENT_CONNECTION_OPENED
  6145. * @param event packet
  6146. * @return pbap_cid
  6147. * @note: btstack_type 2
  6148. */
  6149. static inline uint16_t pbap_subevent_connection_opened_get_pbap_cid(const uint8_t *event)
  6150. {
  6151. return little_endian_read_16(event, 3);
  6152. }
  6153. /**
  6154. * @brief Get field status from event PBAP_SUBEVENT_CONNECTION_OPENED
  6155. * @param event packet
  6156. * @return status
  6157. * @note: btstack_type 1
  6158. */
  6159. static inline uint8_t pbap_subevent_connection_opened_get_status(const uint8_t *event)
  6160. {
  6161. return event[5];
  6162. }
  6163. /**
  6164. * @brief Get field bd_addr from event PBAP_SUBEVENT_CONNECTION_OPENED
  6165. * @param event packet
  6166. * @param Pointer to storage for bd_addr
  6167. * @note: btstack_type B
  6168. */
  6169. static inline void pbap_subevent_connection_opened_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  6170. {
  6171. reverse_bd_addr(&event[6], bd_addr);
  6172. }
  6173. /**
  6174. * @brief Get field con_handle from event PBAP_SUBEVENT_CONNECTION_OPENED
  6175. * @param event packet
  6176. * @return con_handle
  6177. * @note: btstack_type H
  6178. */
  6179. static inline hci_con_handle_t pbap_subevent_connection_opened_get_con_handle(const uint8_t *event)
  6180. {
  6181. return little_endian_read_16(event, 12);
  6182. }
  6183. /**
  6184. * @brief Get field incoming from event PBAP_SUBEVENT_CONNECTION_OPENED
  6185. * @param event packet
  6186. * @return incoming
  6187. * @note: btstack_type 1
  6188. */
  6189. static inline uint8_t pbap_subevent_connection_opened_get_incoming(const uint8_t *event)
  6190. {
  6191. return event[14];
  6192. }
  6193. /**
  6194. * @brief Get field goep_cid from event PBAP_SUBEVENT_CONNECTION_CLOSED
  6195. * @param event packet
  6196. * @return goep_cid
  6197. * @note: btstack_type 2
  6198. */
  6199. static inline uint16_t pbap_subevent_connection_closed_get_goep_cid(const uint8_t *event)
  6200. {
  6201. return little_endian_read_16(event, 3);
  6202. }
  6203. /**
  6204. * @brief Get field goep_cid from event PBAP_SUBEVENT_OPERATION_COMPLETED
  6205. * @param event packet
  6206. * @return goep_cid
  6207. * @note: btstack_type 2
  6208. */
  6209. static inline uint16_t pbap_subevent_operation_completed_get_goep_cid(const uint8_t *event)
  6210. {
  6211. return little_endian_read_16(event, 3);
  6212. }
  6213. /**
  6214. * @brief Get field status from event PBAP_SUBEVENT_OPERATION_COMPLETED
  6215. * @param event packet
  6216. * @return status
  6217. * @note: btstack_type 1
  6218. */
  6219. static inline uint8_t pbap_subevent_operation_completed_get_status(const uint8_t *event)
  6220. {
  6221. return event[5];
  6222. }
  6223. /**
  6224. * @brief Get field hid_cid from event HID_SUBEVENT_CONNECTION_OPENED
  6225. * @param event packet
  6226. * @return hid_cid
  6227. * @note: btstack_type 2
  6228. */
  6229. static inline uint16_t hid_subevent_connection_opened_get_hid_cid(const uint8_t *event)
  6230. {
  6231. return little_endian_read_16(event, 3);
  6232. }
  6233. /**
  6234. * @brief Get field status from event HID_SUBEVENT_CONNECTION_OPENED
  6235. * @param event packet
  6236. * @return status
  6237. * @note: btstack_type 1
  6238. */
  6239. static inline uint8_t hid_subevent_connection_opened_get_status(const uint8_t *event)
  6240. {
  6241. return event[5];
  6242. }
  6243. /**
  6244. * @brief Get field bd_addr from event HID_SUBEVENT_CONNECTION_OPENED
  6245. * @param event packet
  6246. * @param Pointer to storage for bd_addr
  6247. * @note: btstack_type B
  6248. */
  6249. static inline void hid_subevent_connection_opened_get_bd_addr(const uint8_t *event, bd_addr_t bd_addr)
  6250. {
  6251. reverse_bd_addr(&event[6], bd_addr);
  6252. }
  6253. /**
  6254. * @brief Get field con_handle from event HID_SUBEVENT_CONNECTION_OPENED
  6255. * @param event packet
  6256. * @return con_handle
  6257. * @note: btstack_type H
  6258. */
  6259. static inline hci_con_handle_t hid_subevent_connection_opened_get_con_handle(const uint8_t *event)
  6260. {
  6261. return little_endian_read_16(event, 12);
  6262. }
  6263. /**
  6264. * @brief Get field incoming from event HID_SUBEVENT_CONNECTION_OPENED
  6265. * @param event packet
  6266. * @return incoming
  6267. * @note: btstack_type 1
  6268. */
  6269. static inline uint8_t hid_subevent_connection_opened_get_incoming(const uint8_t *event)
  6270. {
  6271. return event[14];
  6272. }
  6273. /**
  6274. * @brief Get field hid_cid from event HID_SUBEVENT_CONNECTION_CLOSED
  6275. * @param event packet
  6276. * @return hid_cid
  6277. * @note: btstack_type 2
  6278. */
  6279. static inline uint16_t hid_subevent_connection_closed_get_hid_cid(const uint8_t *event)
  6280. {
  6281. return little_endian_read_16(event, 3);
  6282. }
  6283. /**
  6284. * @brief Get field hid_cid from event HID_SUBEVENT_CAN_SEND_NOW
  6285. * @param event packet
  6286. * @return hid_cid
  6287. * @note: btstack_type 2
  6288. */
  6289. static inline uint16_t hid_subevent_can_send_now_get_hid_cid(const uint8_t *event)
  6290. {
  6291. return little_endian_read_16(event, 3);
  6292. }
  6293. /**
  6294. * @brief Get field con_handle from event HIDS_SUBEVENT_CAN_SEND_NOW
  6295. * @param event packet
  6296. * @return con_handle
  6297. * @note: btstack_type 2
  6298. */
  6299. static inline uint16_t hids_subevent_can_send_now_get_con_handle(const uint8_t *event)
  6300. {
  6301. return little_endian_read_16(event, 3);
  6302. }
  6303. /**
  6304. * @brief Get field con_handle from event HIDS_SUBEVENT_PROTOCOL_MODE
  6305. * @param event packet
  6306. * @return con_handle
  6307. * @note: btstack_type 2
  6308. */
  6309. static inline uint16_t hids_subevent_protocol_mode_get_con_handle(const uint8_t *event)
  6310. {
  6311. return little_endian_read_16(event, 3);
  6312. }
  6313. /**
  6314. * @brief Get field protocol_mode from event HIDS_SUBEVENT_PROTOCOL_MODE
  6315. * @param event packet
  6316. * @return protocol_mode
  6317. * @note: btstack_type 1
  6318. */
  6319. static inline uint8_t hids_subevent_protocol_mode_get_protocol_mode(const uint8_t *event)
  6320. {
  6321. return event[5];
  6322. }
  6323. /**
  6324. * @brief Get field con_handle from event HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE
  6325. * @param event packet
  6326. * @return con_handle
  6327. * @note: btstack_type 2
  6328. */
  6329. static inline uint16_t hids_subevent_boot_mouse_input_report_enable_get_con_handle(const uint8_t *event)
  6330. {
  6331. return little_endian_read_16(event, 3);
  6332. }
  6333. /**
  6334. * @brief Get field enable from event HIDS_SUBEVENT_BOOT_MOUSE_INPUT_REPORT_ENABLE
  6335. * @param event packet
  6336. * @return enable
  6337. * @note: btstack_type 1
  6338. */
  6339. static inline uint8_t hids_subevent_boot_mouse_input_report_enable_get_enable(const uint8_t *event)
  6340. {
  6341. return event[5];
  6342. }
  6343. /**
  6344. * @brief Get field con_handle from event HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE
  6345. * @param event packet
  6346. * @return con_handle
  6347. * @note: btstack_type 2
  6348. */
  6349. static inline uint16_t hids_subevent_boot_keyboard_input_report_enable_get_con_handle(const uint8_t *event)
  6350. {
  6351. return little_endian_read_16(event, 3);
  6352. }
  6353. /**
  6354. * @brief Get field enable from event HIDS_SUBEVENT_BOOT_KEYBOARD_INPUT_REPORT_ENABLE
  6355. * @param event packet
  6356. * @return enable
  6357. * @note: btstack_type 1
  6358. */
  6359. static inline uint8_t hids_subevent_boot_keyboard_input_report_enable_get_enable(const uint8_t *event)
  6360. {
  6361. return event[5];
  6362. }
  6363. /**
  6364. * @brief Get field con_handle from event HIDS_SUBEVENT_INPUT_REPORT_ENABLE
  6365. * @param event packet
  6366. * @return con_handle
  6367. * @note: btstack_type 2
  6368. */
  6369. static inline uint16_t hids_subevent_input_report_enable_get_con_handle(const uint8_t *event)
  6370. {
  6371. return little_endian_read_16(event, 3);
  6372. }
  6373. /**
  6374. * @brief Get field enable from event HIDS_SUBEVENT_INPUT_REPORT_ENABLE
  6375. * @param event packet
  6376. * @return enable
  6377. * @note: btstack_type 1
  6378. */
  6379. static inline uint8_t hids_subevent_input_report_enable_get_enable(const uint8_t *event)
  6380. {
  6381. return event[5];
  6382. }
  6383. static inline uint8_t hci_event_le_meta_get_phy_update_complete_status(const uint8_t *event)
  6384. {
  6385. return event[3];
  6386. }
  6387. static inline uint8_t hci_event_le_meta_get_phy_update_complete_tx_phy(const uint8_t *event)
  6388. {
  6389. return event[6];
  6390. }
  6391. static inline uint8_t hci_event_le_meta_get_phy_update_complete_rx_phy(const uint8_t *event)
  6392. {
  6393. return event[7];
  6394. }
  6395. /* API_END */
  6396. #if defined __cplusplus
  6397. }
  6398. #endif
  6399. #endif // __BTSTACK_EVENT_H