| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491 |
- // SPDX-License-Identifier: GPL-2.0-or-later
- /*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2014 Intel Corporation. All rights reserved.
- *
- *
- */
- #ifdef HAVE_CONFIG_H
- #include <config.h>
- #endif
- #include <unistd.h>
- #include <stdlib.h>
- #include <stdbool.h>
- #include <inttypes.h>
- #include <string.h>
- #include <fcntl.h>
- #include <sys/socket.h>
- #include <glib.h>
- #include "lib/bluetooth.h"
- #include "lib/uuid.h"
- #include "src/shared/util.h"
- #include "src/shared/att.h"
- #include "src/shared/gatt-helpers.h"
- #include "src/shared/queue.h"
- #include "src/shared/gatt-db.h"
- #include "src/shared/gatt-server.h"
- #include "src/shared/gatt-client.h"
- #include "src/shared/tester.h"
- struct test_pdu {
- bool valid;
- uint8_t *data;
- size_t size;
- };
- enum context_type {
- ATT,
- CLIENT,
- SERVER
- };
- struct test_data {
- char *test_name;
- struct test_pdu *pdu_list;
- enum context_type context_type;
- bt_uuid_t *uuid;
- struct gatt_db *source_db;
- const void *step;
- };
- struct context {
- struct bt_gatt_client *client;
- struct bt_gatt_server *server;
- struct bt_att *att;
- struct gatt_db *client_db;
- struct gatt_db *server_db;
- guint source;
- guint process;
- int fd;
- unsigned int pdu_offset;
- const struct test_data *data;
- struct bt_gatt_request *req;
- };
- #define data(args...) ((const unsigned char[]) { args })
- #define raw_pdu(args...) \
- { \
- .valid = true, \
- .data = g_memdup(data(args), sizeof(data(args))), \
- .size = sizeof(data(args)), \
- }
- #define false_pdu() \
- { \
- .valid = false, \
- }
- #define define_test(name, function, type, bt_uuid, db, \
- test_step, args...) \
- do { \
- const struct test_pdu pdus[] = { \
- args, { } \
- }; \
- static struct test_data data; \
- data.test_name = g_strdup(name); \
- data.context_type = type; \
- data.uuid = bt_uuid; \
- data.step = test_step; \
- data.source_db = db; \
- data.pdu_list = g_memdup(pdus, sizeof(pdus)); \
- tester_add(name, &data, NULL, function, NULL); \
- } while (0)
- #define define_test_att(name, function, bt_uuid, test_step, args...) \
- define_test(name, function, ATT, bt_uuid, NULL, test_step, args)
- #define define_test_client(name, function, source_db, test_step, args...)\
- define_test(name, function, CLIENT, NULL, source_db, test_step, args)
- #define define_test_server(name, function, source_db, test_step, args...)\
- define_test(name, function, SERVER, NULL, source_db, test_step, args)
- #define MTU_EXCHANGE_CLIENT_PDUS \
- raw_pdu(0x02, 0x00, 0x02), \
- raw_pdu(0x03, 0x00, 0x02)
- #define READ_SERVER_FEAT_PDUS \
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x3a, 0x2b), \
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a)
- #define CLIENT_INIT_PDUS \
- MTU_EXCHANGE_CLIENT_PDUS, \
- READ_SERVER_FEAT_PDUS
- #define SERVICE_DATA_1_PDUS \
- CLIENT_INIT_PDUS, \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x04, 0x00, 0x01, 0x18),\
- raw_pdu(0x10, 0x05, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x05, 0x00, 0x08, 0x00, 0x0d, 0x18),\
- raw_pdu(0x10, 0x09, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x01, 0x10, 0x09, 0x00, 0x0a), \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), \
- raw_pdu(0x01, 0x10, 0x01, 0x00, 0x0a), \
- raw_pdu(0x08, 0x01, 0x00, 0x08, 0x00, 0x02, 0x28), \
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a), \
- raw_pdu(0x08, 0x01, 0x00, 0x08, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x02, 0x03, 0x00, 0x00, \
- 0x2a), \
- raw_pdu(0x08, 0x03, 0x00, 0x08, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x06, 0x00, 0x0a, 0x07, 0x00, 0x29, \
- 0x2a), \
- raw_pdu(0x08, 0x07, 0x00, 0x08, 0x00, 0x03, 0x28), \
- raw_pdu(0x01, 0x08, 0x07, 0x00, 0x0a), \
- raw_pdu(0x04, 0x04, 0x00, 0x04, 0x00), \
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x01, 0x29), \
- raw_pdu(0x04, 0x08, 0x00, 0x08, 0x00), \
- raw_pdu(0x05, 0x01, 0x08, 0x00, 0x01, 0x29)
- #define SERVICE_DATA_2_PDUS \
- CLIENT_INIT_PDUS, \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x04, 0x00, 0x01, 0x18),\
- raw_pdu(0x10, 0x05, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x05, 0x00, 0x0a, 0x00, 0x0d, 0x18),\
- raw_pdu(0x10, 0x0b, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x01, 0x10, 0x0b, 0x00, 0x0a), \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), \
- raw_pdu(0x01, 0x10, 0x01, 0x00, 0x0a), \
- raw_pdu(0x08, 0x01, 0x00, 0x0a, 0x00, 0x02, 0x28), \
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a), \
- raw_pdu(0x08, 0x01, 0x00, 0x0a, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0x02, 0x03, 0x00, 0x00, \
- 0x2a), \
- raw_pdu(0x08, 0x03, 0x00, 0x0a, 0x00, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x07, 0x00, 0x0a, 0x08, 0x00, 0x29, \
- 0x2a), \
- raw_pdu(0x08, 0x08, 0x00, 0x0a, 0x00, 0x03, 0x28), \
- raw_pdu(0x01, 0x08, 0x08, 0x00, 0x0a), \
- raw_pdu(0x04, 0x04, 0x00, 0x04, 0x00), \
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x01, 0x29), \
- raw_pdu(0x04, 0x09, 0x00, 0x0a, 0x00), \
- raw_pdu(0x05, 0x01, 0x0a, 0x00, 0x01, 0x29)
- #define SERVICE_DATA_3_PDUS \
- CLIENT_INIT_PDUS, \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x00, 0x01, 0x21, 0x01, 0x00, 0x18, \
- 0x00, 0x02, 0x00, 0x02, 0x01, 0x18), \
- raw_pdu(0x10, 0x01, 0x02, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x00, 0x03, 0x20, 0x03, 0x0d, 0x18),\
- raw_pdu(0x10, 0x21, 0x03, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x01, 0x10, 0x21, 0x03, 0x0a), \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), \
- raw_pdu(0x01, 0x10, 0x01, 0x00, 0x0a), \
- raw_pdu(0x08, 0x00, 0x01, 0x20, 0x03, 0x02, 0x28), \
- raw_pdu(0x01, 0x08, 0x00, 0x01, 0x0a), \
- raw_pdu(0x08, 0x00, 0x01, 0x20, 0x03, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x10, 0x01, 0x02, 0x11, 0x01, 0x00, \
- 0x2a, 0x20, 0x01, 0x02, 0x21, 0x01, 0x01, 0x2a),\
- raw_pdu(0x08, 0x21, 0x01, 0x20, 0x03, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x10, 0x03, 0x0a, 0x11, 0x03, 0x29, \
- 0x2a), \
- raw_pdu(0x08, 0x11, 0x03, 0x20, 0x03, 0x03, 0x28), \
- raw_pdu(0x01, 0x08, 0x11, 0x03, 0x0a), \
- raw_pdu(0x04, 0x12, 0x01, 0x1f, 0x01), \
- raw_pdu(0x01, 0x04, 0x12, 0x01, 0x0a), \
- raw_pdu(0x04, 0x12, 0x03, 0x20, 0x03), \
- raw_pdu(0x05, 0x01, 0x20, 0x03, 0x02, 0x29)
- #define PRIMARY_DISC_SMALL_DB \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x10, 0xF0, 0x18, 0xF0, 0x00, 0x18, \
- 0xFF, 0xFF, 0xFF, 0xFF, 0x0a, 0x18)
- #define PRIMARY_DISC_LARGE_DB_1 \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x10, 0x00, 0x13, 0x00, 0x01, 0x18, \
- 0x20, 0x00, 0x29, 0x00, 0x0A, 0xA0, \
- 0x30, 0x00, 0x32, 0x00, 0x0B, 0xA0), \
- raw_pdu(0x10, 0x33, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x40, 0x00, 0x46, 0x00, 0x00, 0x18, \
- 0x50, 0x00, 0x52, 0x00, 0x0B, 0xA0, \
- 0x60, 0x00, 0x6B, 0x00, 0x0B, 0xA0), \
- raw_pdu(0x10, 0x6C, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0x70, 0x00, 0x76, 0x00, 0x0B, 0xA0, \
- 0x80, 0x00, 0x86, 0x00, 0x0B, 0xA0), \
- raw_pdu(0x10, 0x86, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x14, 0x90, 0x00, 0x96, 0x00, \
- 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, \
- 0x00, 0x00, 0x00, 0x00, 0x0C, 0xA0, 0x00, 0x00),\
- raw_pdu(0x10, 0x97, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x06, 0xa0, 0x00, 0xb1, 0x00, 0x0f, 0xa0),\
- raw_pdu(0x10, 0xb2, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x11, 0x14, 0xC0, 0x00, 0xDD, 0x00, \
- 0xef, 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, \
- 0x00, 0x00, 0x00, 0x00, 0x0C, 0xA0, 0x00, 0x00),\
- raw_pdu(0x10, 0xde, 0x00, 0xff, 0xff, 0x00, 0x28), \
- raw_pdu(0x01, 0x10, 0xde, 0x00, 0x0a)
- #define SECONDARY_DISC_SMALL_DB \
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x01, 0x28), \
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x10, 0x00, 0x0a, 0x18),\
- raw_pdu(0x10, 0x11, 0x00, 0xff, 0xff, 0x01, 0x28), \
- raw_pdu(0x01, 0x10, 0x11, 0x00, 0x0a)
- #define INCLUDE_DISC_SMALL_DB \
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28), \
- raw_pdu(0x09, 0x08, 0x11, 0xf0, 0x01, 0x00, 0x0f, 0x00, \
- 0x0a, 0x18), \
- raw_pdu(0x08, 0x12, 0xf0, 0xff, 0xff, 0x02, 0x28), \
- raw_pdu(0x01, 0x08, 0x12, 0xf0, 0x0a)
- #define CHARACTERISTIC_DISC_SMALL_DB \
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29, \
- 0x2a, 0x07, 0x00, 0x22, 0x08, 0x00, 0x28, 0x2a),\
- raw_pdu(0x08, 0x08, 0x00, 0xff, 0xff, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00, \
- 0x2a), \
- raw_pdu(0x08, 0x13, 0xf0, 0xff, 0xff, 0x03, 0x28), \
- raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef, \
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00, \
- 0x00, 0x00, 0x00, 0x09, 0xB0, 0x00, 0x00), \
- raw_pdu(0x08, 0x15, 0xf0, 0xff, 0xff, 0x03, 0x28), \
- raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01, \
- 0x2a), \
- raw_pdu(0x08, 0x18, 0xf0, 0xff, 0xff, 0x03, 0x28), \
- raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a)
- #define DESCRIPTOR_DISC_SMALL_DB \
- raw_pdu(0x04, 0x04, 0x00, 0x06, 0x00), \
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x02, 0x29, 0x05, 0x00, \
- 0x01, 0x29), \
- raw_pdu(0x04, 0x06, 0x00, 0x06, 0x00), \
- raw_pdu(0x05, 0x01, 0x06, 0x00, 0x00, 0x29), \
- raw_pdu(0x0a, 0x06, 0x00), \
- raw_pdu(0x0b, 0x01, 0x00), \
- raw_pdu(0x04, 0x09, 0x00, 0x10, 0x00), \
- raw_pdu(0x05, 0x01, 0x09, 0x00, 0x02, 0x29), \
- raw_pdu(0x04, 0x0a, 0x00, 0x10, 0x00), \
- raw_pdu(0x01, 0x04, 0x0a, 0x00, 0x0a), \
- raw_pdu(0x04, 0x16, 0xf0, 0x16, 0xf0), \
- raw_pdu(0x05, 0x01, 0x16, 0xf0, 0x00, 0x29), \
- raw_pdu(0x0a, 0x16, 0xf0), \
- raw_pdu(0x0b, 0x01, 0x00)
- #define SMALL_DB_DISCOVERY_PDUS \
- PRIMARY_DISC_SMALL_DB, \
- SECONDARY_DISC_SMALL_DB, \
- INCLUDE_DISC_SMALL_DB, \
- CHARACTERISTIC_DISC_SMALL_DB, \
- DESCRIPTOR_DISC_SMALL_DB
- #define SERVER_MTU_EXCHANGE_PDU raw_pdu(0x02, 0x17, 0x00)
- static bt_uuid_t uuid_16 = {
- .type = BT_UUID16,
- .value.u16 = 0x1800
- };
- static bt_uuid_t uuid_char_16 = {
- .type = BT_UUID16,
- .value.u16 = 0x2a0d
- };
- static bt_uuid_t uuid_128 = {
- .type = BT_UUID128,
- .value.u128.data = {0x00, 0x00, 0x18, 0x0d, 0x00, 0x00, 0x10, 0x00,
- 0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb}
- };
- static bt_uuid_t uuid_char_128 = {
- .type = BT_UUID128,
- .value.u128.data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}
- };
- static void test_free(gconstpointer user_data)
- {
- const struct test_data *data = user_data;
- struct test_pdu *pdu;
- int i;
- for (i = 0; (pdu = &data->pdu_list[i]) && pdu->valid; i++)
- g_free(pdu->data);
- g_free(data->test_name);
- g_free(data->pdu_list);
- }
- typedef void (*test_step_t)(struct context *context);
- struct test_step {
- test_step_t func;
- test_step_t post_func;
- uint16_t handle;
- uint16_t end_handle;
- uint8_t uuid[16];
- uint8_t expected_att_ecode;
- const uint8_t *value;
- uint16_t length;
- };
- static void destroy_context(struct context *context)
- {
- if (context->source > 0)
- g_source_remove(context->source);
- if (context->req)
- bt_gatt_request_unref(context->req);
- bt_gatt_client_unref(context->client);
- bt_gatt_server_unref(context->server);
- gatt_db_unref(context->client_db);
- gatt_db_unref(context->server_db);
- if (context->att)
- bt_att_unref(context->att);
- test_free(context->data);
- g_free(context);
- }
- static gboolean context_quit(gpointer user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- if (context->process > 0)
- g_source_remove(context->process);
- if (step && step->post_func)
- step->post_func(context);
- if (context->data->pdu_list[context->pdu_offset].valid)
- tester_test_abort();
- else
- tester_test_passed();
- destroy_context(context);
- return FALSE;
- }
- static void test_debug(const char *str, void *user_data)
- {
- const char *prefix = user_data;
- tester_debug("%s%s", prefix, str);
- }
- static gboolean send_pdu(gpointer user_data)
- {
- struct context *context = user_data;
- const struct test_pdu *pdu;
- ssize_t len;
- pdu = &context->data->pdu_list[context->pdu_offset++];
- len = write(context->fd, pdu->data, pdu->size);
- tester_monitor('<', 0x0004, 0x0000, pdu->data, len);
- g_assert_cmpint(len, ==, pdu->size);
- context->process = 0;
- pdu = &context->data->pdu_list[context->pdu_offset];
- if (pdu->valid && (pdu->size == 0)) {
- test_debug("(no action expected)", "GATT: ");
- context->pdu_offset++;
- /* Quit the context if we processed the last PDU */
- if (!context->data->pdu_list[context->pdu_offset].valid) {
- context_quit(context);
- return FALSE;
- }
- return send_pdu(context);
- }
- return FALSE;
- }
- static void context_process(struct context *context)
- {
- /* Quit the context if we processed the last PDU */
- if (!context->data->pdu_list[context->pdu_offset].valid) {
- context_quit(context);
- return;
- }
- context->process = g_idle_add(send_pdu, context);
- }
- static gboolean test_handler(GIOChannel *channel, GIOCondition cond,
- gpointer user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- const struct test_pdu *pdu;
- unsigned char buf[512];
- ssize_t len;
- int fd;
- pdu = &context->data->pdu_list[context->pdu_offset++];
- if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
- context->source = 0;
- g_print("%s: cond %x\n", __func__, cond);
- return FALSE;
- }
- fd = g_io_channel_unix_get_fd(channel);
- len = read(fd, buf, sizeof(buf));
- g_assert(len > 0);
- tester_monitor('>', 0x0004, 0x0000, buf, len);
- util_hexdump('=', pdu->data, pdu->size, test_debug, "PDU: ");
- g_assert_cmpint(len, ==, pdu->size);
- g_assert(memcmp(buf, pdu->data, pdu->size) == 0);
- /* Empty client PDU means to trigger something out-of-band. */
- pdu = &context->data->pdu_list[context->pdu_offset];
- if (pdu->valid && (pdu->size == 0)) {
- context->pdu_offset++;
- test_debug("triggering server action", "Empty client pdu: ");
- g_assert(step && step->func);
- step->func(context);
- return TRUE;
- }
- context_process(context);
- return TRUE;
- }
- static void print_debug(const char *str, void *user_data)
- {
- const char *prefix = user_data;
- tester_debug("%s%s", prefix, str);
- }
- struct db_attribute_test_data {
- struct gatt_db_attribute *match;
- bool found;
- };
- static bool matching_desc_data(struct gatt_db_attribute *a,
- struct gatt_db_attribute *b)
- {
- uint16_t a_handle, b_handle;
- const bt_uuid_t *a_uuid, *b_uuid;
- a_handle = gatt_db_attribute_get_handle(a);
- b_handle = gatt_db_attribute_get_handle(b);
- a_uuid = gatt_db_attribute_get_type(a);
- b_uuid = gatt_db_attribute_get_type(b);
- return a_handle == b_handle && !bt_uuid_cmp(a_uuid, b_uuid);
- }
- static void find_matching_desc(struct gatt_db_attribute *source_desc_attr,
- void *user_data)
- {
- struct db_attribute_test_data *desc_test_data = user_data;
- if (desc_test_data->found)
- return;
- desc_test_data->found = matching_desc_data(desc_test_data->match,
- source_desc_attr);
- }
- static void match_descs(struct gatt_db_attribute *client_desc_attr,
- void *user_data)
- {
- struct gatt_db_attribute *source_char_attr = user_data;
- struct db_attribute_test_data desc_test_data;
- desc_test_data.match = client_desc_attr;
- desc_test_data.found = false;
- gatt_db_service_foreach_desc(source_char_attr, find_matching_desc,
- &desc_test_data);
- g_assert(desc_test_data.found);
- }
- static bool matching_char_data(struct gatt_db_attribute *a,
- struct gatt_db_attribute *b)
- {
- uint16_t a_handle, b_handle, a_value_handle, b_value_handle;
- uint8_t a_properties, b_properties;
- bt_uuid_t a_uuid, b_uuid;
- gatt_db_attribute_get_char_data(a, &a_handle, &a_value_handle,
- &a_properties, NULL, &a_uuid);
- gatt_db_attribute_get_char_data(b, &b_handle, &b_value_handle,
- &b_properties, NULL, &b_uuid);
- return a_handle == b_handle && a_value_handle == b_value_handle &&
- a_properties == b_properties &&
- !bt_uuid_cmp(&a_uuid, &b_uuid);
- }
- static void find_matching_char(struct gatt_db_attribute *source_char_attr,
- void *user_data)
- {
- struct db_attribute_test_data *char_test_data = user_data;
- if (char_test_data->found)
- return;
- if (matching_char_data(char_test_data->match, source_char_attr)) {
- gatt_db_service_foreach_desc(char_test_data->match, match_descs,
- source_char_attr);
- char_test_data->found = true;
- }
- }
- static void match_chars(struct gatt_db_attribute *client_char_attr,
- void *user_data)
- {
- struct gatt_db_attribute *source_serv_attr = user_data;
- struct db_attribute_test_data char_test_data;
- char_test_data.match = client_char_attr;
- char_test_data.found = false;
- gatt_db_service_foreach_char(source_serv_attr, find_matching_char,
- &char_test_data);
- g_assert(char_test_data.found);
- }
- static bool matching_service_data(struct gatt_db_attribute *a,
- struct gatt_db_attribute *b)
- {
- uint16_t a_start, b_start, a_end, b_end;
- bool a_primary, b_primary;
- bt_uuid_t a_uuid, b_uuid;
- gatt_db_attribute_get_service_data(a, &a_start, &a_end, &a_primary,
- &a_uuid);
- gatt_db_attribute_get_service_data(b, &b_start, &b_end, &b_primary,
- &b_uuid);
- return a_start == b_start && a_end == b_end && a_primary == b_primary &&
- !bt_uuid_cmp(&a_uuid, &b_uuid);
- }
- static void find_matching_service(struct gatt_db_attribute *source_serv_attr,
- void *user_data)
- {
- struct db_attribute_test_data *serv_test_data = user_data;
- if (serv_test_data->found)
- return;
- if (matching_service_data(serv_test_data->match, source_serv_attr)) {
- gatt_db_service_foreach_char(serv_test_data->match, match_chars,
- source_serv_attr);
- serv_test_data->found = true;
- }
- }
- static void match_services(struct gatt_db_attribute *client_serv_attr,
- void *user_data)
- {
- struct gatt_db *source_db = user_data;
- struct db_attribute_test_data serv_test_data;
- serv_test_data.match = client_serv_attr;
- serv_test_data.found = false;
- gatt_db_foreach_service(source_db, NULL,
- find_matching_service, &serv_test_data);
- g_assert(serv_test_data.found);
- }
- static void client_ready_cb(bool success, uint8_t att_ecode, void *user_data)
- {
- struct context *context = user_data;
- g_assert(success);
- if (!context->data->source_db) {
- context_quit(context);
- return;
- }
- g_assert(context->client);
- g_assert(context->client_db);
- gatt_db_foreach_service(context->client_db, NULL, match_services,
- context->data->source_db);
- if (context->data->step) {
- const struct test_step *step = context->data->step;
- /* Auto elevate security for test that don't expect error */
- if (!step->expected_att_ecode)
- bt_att_set_security(context->att, BT_ATT_SECURITY_AUTO);
- step->func(context);
- return;
- }
- context_quit(context);
- }
- static struct context *create_context(uint16_t mtu, gconstpointer data)
- {
- struct context *context = g_new0(struct context, 1);
- const struct test_data *test_data = data;
- GIOChannel *channel;
- int err, sv[2];
- err = socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sv);
- g_assert(err == 0);
- context->att = bt_att_new(sv[0], false);
- g_assert(context->att);
- switch (test_data->context_type) {
- case ATT:
- bt_att_set_debug(context->att, 1, print_debug, "bt_att:", NULL);
- bt_gatt_exchange_mtu(context->att, mtu, NULL, NULL, NULL);
- break;
- case SERVER:
- context->server_db = gatt_db_ref(test_data->source_db);
- g_assert(context->server_db);
- context->server = bt_gatt_server_new(context->server_db,
- context->att, mtu, 0);
- g_assert(context->server);
- bt_gatt_server_set_debug(context->server, print_debug,
- "bt_gatt_server:", NULL);
- break;
- case CLIENT:
- context->client_db = gatt_db_new();
- g_assert(context->client_db);
- context->client = bt_gatt_client_new(context->client_db,
- context->att, mtu, 0);
- g_assert(context->client);
- bt_gatt_client_set_debug(context->client, print_debug,
- "bt_gatt_client:", NULL);
- bt_gatt_client_ready_register(context->client, client_ready_cb,
- context, NULL);
- break;
- default:
- break;
- }
- channel = g_io_channel_unix_new(sv[1]);
- g_io_channel_set_close_on_unref(channel, TRUE);
- g_io_channel_set_encoding(channel, NULL, NULL);
- g_io_channel_set_buffered(channel, FALSE);
- context->source = g_io_add_watch(channel,
- G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- test_handler, context);
- g_assert(context->source > 0);
- g_io_channel_unref(channel);
- context->fd = sv[1];
- context->data = data;
- return context;
- }
- static void generic_search_cb(bool success, uint8_t att_ecode,
- struct bt_gatt_result *result,
- void *user_data)
- {
- struct context *context = user_data;
- bt_gatt_request_unref(context->req);
- context->req = NULL;
- g_assert(success);
- context_quit(context);
- }
- static void test_read_cb(bool success, uint8_t att_ecode,
- const uint8_t *value, uint16_t length,
- void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- g_assert(att_ecode == step->expected_att_ecode);
- if (success) {
- g_assert(length == step->length);
- g_assert(memcmp(value, step->value, length) == 0);
- }
- context_quit(context);
- }
- static void test_read(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_read_value(context->client, step->handle,
- test_read_cb, context, NULL));
- }
- static const uint8_t read_data_1[] = {0x01, 0x02, 0x03};
- static const struct test_step test_read_1 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_read_2 = {
- .handle = 0x0000,
- .func = test_read,
- .expected_att_ecode = 0x01,
- };
- static const struct test_step test_read_3 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0x02,
- };
- static const struct test_step test_read_4 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0x08,
- };
- static const struct test_step test_read_5 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0x05,
- };
- static const struct test_step test_read_6 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0x0c,
- };
- static const struct test_step test_read_7 = {
- .handle = 0x0004,
- .func = test_read,
- .expected_att_ecode = 0x00,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_read_8 = {
- .handle = 0x0004,
- .func = test_read,
- .expected_att_ecode = 0x02,
- };
- static const struct test_step test_read_9 = {
- .handle = 0x0004,
- .func = test_read,
- .expected_att_ecode = 0x08,
- };
- static const struct test_step test_read_10 = {
- .handle = 0x0004,
- .func = test_read,
- .expected_att_ecode = 0x05,
- };
- static const struct test_step test_read_11 = {
- .handle = 0x0004,
- .func = test_read,
- .expected_att_ecode = 0x0c,
- };
- static const struct test_step test_read_12 = {
- .handle = 0x0003,
- .func = test_read,
- .expected_att_ecode = 0x80,
- };
- static void test_write_cb(bool success, uint8_t att_ecode, void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- g_assert(att_ecode == step->expected_att_ecode);
- context_quit(context);
- }
- static void test_write(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_write_value(context->client, step->handle,
- step->value, step->length, test_write_cb,
- context, NULL));
- }
- static const uint8_t write_data_1[] = {0x01, 0x02, 0x03};
- static const struct test_step test_write_1 = {
- .handle = 0x0007,
- .func = test_write,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_2 = {
- .handle = 0x0000,
- .func = test_write,
- .expected_att_ecode = 0x01,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_3 = {
- .handle = 0x0007,
- .func = test_write,
- .expected_att_ecode = 0x03,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_4 = {
- .handle = 0x0007,
- .func = test_write,
- .expected_att_ecode = 0x08,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_5 = {
- .handle = 0x0007,
- .func = test_write,
- .expected_att_ecode = 0x05,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_6 = {
- .handle = 0x0007,
- .func = test_write,
- .expected_att_ecode = 0x0c,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_7 = {
- .handle = 0x0008,
- .func = test_write,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_8 = {
- .handle = 0x0000,
- .func = test_write,
- .expected_att_ecode = 0x01,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_9 = {
- .handle = 0x0008,
- .func = test_write,
- .expected_att_ecode = 0x03,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_10 = {
- .handle = 0x0008,
- .func = test_write,
- .expected_att_ecode = 0x08,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_11 = {
- .handle = 0x0008,
- .func = test_write,
- .expected_att_ecode = 0x05,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_write_12 = {
- .handle = 0x0008,
- .func = test_write,
- .expected_att_ecode = 0x0c,
- .value = write_data_1,
- .length = 0x03
- };
- static void test_write_without_response(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_write_without_response(context->client,
- step->handle,
- false, step->value,
- step->length));
- }
- static const struct test_step test_write_without_response_1 = {
- .handle = 0x0007,
- .func = test_write_without_response,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static bool local_counter(uint32_t *sign_cnt, void *user_data)
- {
- static uint32_t cnt = 0;
- *sign_cnt = cnt++;
- return true;
- }
- static void test_signed_write(struct context *context)
- {
- const struct test_step *step = context->data->step;
- uint8_t key[16] = {0xD8, 0x51, 0x59, 0x48, 0x45, 0x1F, 0xEA, 0x32, 0x0D,
- 0xC0, 0x5A, 0x2E, 0x88, 0x30, 0x81, 0x88 };
- if (!bt_att_has_crypto(context->att)) {
- context_quit(context);
- return;
- }
- g_assert(bt_att_set_local_key(context->att, key, local_counter,
- context));
- g_assert(bt_gatt_client_write_without_response(context->client,
- step->handle,
- true, step->value,
- step->length));
- }
- static const struct test_step test_signed_write_1 = {
- .handle = 0x0007,
- .func = test_signed_write,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static void test_signed_write_seclevel(struct context *context)
- {
- const struct test_step *step = context->data->step;
- uint8_t key[16] = {0xD8, 0x51, 0x59, 0x48, 0x45, 0x1F, 0xEA, 0x32, 0x0D,
- 0xC0, 0x5A, 0x2E, 0x88, 0x30, 0x81, 0x88 };
- g_assert(bt_att_set_local_key(context->att, key, local_counter,
- context));
- g_assert(bt_att_set_security(context->att, BT_ATT_SECURITY_MEDIUM));
- g_assert(bt_gatt_client_write_without_response(context->client,
- step->handle,
- true, step->value,
- step->length));
- }
- static const struct test_step test_signed_write_seclevel_1 = {
- .handle = 0x0007,
- .func = test_signed_write_seclevel,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static void test_long_write_cb(bool success, bool reliable_error,
- uint8_t att_ecode, void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- g_assert(att_ecode == step->expected_att_ecode);
- context_quit(context);
- }
- static void test_long_write(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_write_long_value(context->client, false,
- step->handle, 0, step->value,
- step->length, test_long_write_cb,
- context, NULL));
- }
- /* The maximum length of an attribute value shall be 512 octets. */
- static const uint8_t long_data_2[512] = { [0 ... 511] = 0xff };
- static const struct test_step test_long_write_1 = {
- .handle = 0x0007,
- .func = test_long_write,
- .expected_att_ecode = 0,
- .value = long_data_2,
- .length = sizeof(long_data_2)
- };
- static const struct test_step test_long_write_2 = {
- .handle = 0x0000,
- .func = test_long_write,
- .expected_att_ecode = 0x01,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_3 = {
- .handle = 0x0003,
- .func = test_long_write,
- .expected_att_ecode = 0x03,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_4 = {
- .handle = 0x0007,
- .func = test_long_write,
- .expected_att_ecode = 0x08,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_5 = {
- .handle = 0x0007,
- .func = test_long_write,
- .expected_att_ecode = 0x05,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_6 = {
- .handle = 0x0007,
- .func = test_long_write,
- .expected_att_ecode = 0x0c,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_7 = {
- .handle = 0x0008,
- .func = test_long_write,
- .expected_att_ecode = 0,
- .value = long_data_2,
- .length = sizeof(long_data_2)
- };
- static const struct test_step test_long_write_8 = {
- .handle = 0x0000,
- .func = test_long_write,
- .expected_att_ecode = 0x01,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_9 = {
- .handle = 0x0008,
- .func = test_long_write,
- .expected_att_ecode = 0x03,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_10 = {
- .handle = 0x0008,
- .func = test_long_write,
- .expected_att_ecode = 0x08,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_11 = {
- .handle = 0x0008,
- .func = test_long_write,
- .expected_att_ecode = 0x05,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_write_12 = {
- .handle = 0x0008,
- .func = test_long_write,
- .expected_att_ecode = 0x0c,
- .value = write_data_1,
- .length = 0x03
- };
- static void test_reliable_write_cb(bool success, bool reliable_error,
- uint8_t att_ecode, void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- g_assert(att_ecode == step->expected_att_ecode);
- g_assert(!reliable_error);
- context_quit(context);
- }
- static void test_reliable_write(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_write_long_value(context->client, true,
- step->handle, 0, step->value,
- step->length, test_reliable_write_cb,
- context, NULL));
- }
- static const struct test_step test_reliable_write_1 = {
- .handle = 0x0007,
- .func = test_reliable_write,
- .expected_att_ecode = 0,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_reliable_write_2 = {
- .handle = 0x0000,
- .func = test_reliable_write,
- .expected_att_ecode = 0x01,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_reliable_write_3 = {
- .handle = 0x0003,
- .func = test_reliable_write,
- .expected_att_ecode = 0x03,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_reliable_write_4 = {
- .handle = 0x0007,
- .func = test_reliable_write,
- .expected_att_ecode = 0x08,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_reliable_write_5 = {
- .handle = 0x0007,
- .func = test_reliable_write,
- .expected_att_ecode = 0x05,
- .value = write_data_1,
- .length = 0x03
- };
- static const struct test_step test_reliable_write_6 = {
- .handle = 0x0007,
- .func = test_reliable_write,
- .expected_att_ecode = 0x0c,
- .value = write_data_1,
- .length = 0x03
- };
- static void att_write_cb(struct gatt_db_attribute *att, int err,
- void *user_data)
- {
- g_assert(!err);
- }
- static struct gatt_db_attribute *
- add_char_with_value(struct gatt_db_attribute *service_att, uint16_t handle,
- bt_uuid_t *uuid, uint32_t att_permissions,
- uint8_t char_properties, const void *value,
- size_t len)
- {
- struct gatt_db_attribute *attrib;
- if (handle)
- attrib = gatt_db_service_insert_characteristic(service_att,
- handle, uuid,
- att_permissions,
- char_properties,
- NULL, NULL,
- NULL);
- else
- attrib = gatt_db_service_add_characteristic(service_att, uuid,
- att_permissions,
- char_properties,
- NULL, NULL,
- NULL);
- g_assert(attrib != NULL);
- gatt_db_attribute_write(attrib, 0, value, len, 0x00, NULL,
- att_write_cb, NULL);
- return attrib;
- }
- static struct gatt_db_attribute *
- add_desc_with_value(struct gatt_db_attribute *att, uint16_t handle,
- bt_uuid_t *uuid, uint32_t att_perms,
- const uint8_t *value, size_t len)
- {
- struct gatt_db_attribute *desc_att;
- if (handle)
- desc_att = gatt_db_service_insert_descriptor(att, handle, uuid,
- att_perms, NULL, NULL,
- NULL);
- else
- desc_att = gatt_db_service_add_descriptor(att, uuid, att_perms,
- NULL, NULL, NULL);
- gatt_db_attribute_write(desc_att, 0, value, len, 0x00, NULL,
- att_write_cb, NULL);
- return desc_att;
- }
- enum gatt_type {
- PRIMARY,
- SECONDARY,
- INCLUDE,
- CHARACTERISTIC,
- DESCRIPTOR
- };
- struct att_handle_spec {
- uint16_t handle;
- const char *uuid;
- enum gatt_type type;
- uint8_t char_properties;
- uint32_t att_permissions;
- const uint8_t *value;
- size_t len;
- bool valid;
- };
- #define PRIMARY_SERVICE(start_handle, srv_uuid, num_handles) \
- { \
- .valid = true, \
- .handle = start_handle, \
- .type = PRIMARY, \
- .uuid = srv_uuid, \
- .len = num_handles, \
- }
- #define SECONDARY_SERVICE(start_handle, srv_uuid, num_handles) \
- { \
- .valid = true, \
- .handle = start_handle, \
- .type = SECONDARY, \
- .uuid = srv_uuid, \
- .len = num_handles, \
- }
- #define INCLUDE(include_handle) \
- { \
- .valid = true, \
- .type = INCLUDE, \
- .handle = include_handle, \
- }
- #define STR(x) #x
- #define CHARACTERISTIC(chr_uuid, permissions, properties, bytes...) \
- { \
- .valid = true, \
- .type = CHARACTERISTIC, \
- .uuid = STR(chr_uuid), \
- .att_permissions = permissions, \
- .char_properties = properties, \
- .value = data(bytes), \
- .len = sizeof(data(bytes)), \
- }
- #define CHARACTERISTIC_STR(chr_uuid, permissions, properties, string) \
- { \
- .valid = true, \
- .type = CHARACTERISTIC, \
- .uuid = STR(chr_uuid), \
- .att_permissions = permissions, \
- .char_properties = properties, \
- .value = (uint8_t *)string, \
- .len = strlen(string), \
- }
- #define DESCRIPTOR(desc_uuid, permissions, bytes...) \
- { \
- .valid = true, \
- .type = DESCRIPTOR, \
- .uuid = STR(desc_uuid), \
- .att_permissions = permissions, \
- .value = data(bytes), \
- .len = sizeof(data(bytes)), \
- }
- #define DESCRIPTOR_STR(desc_uuid, permissions, string) \
- { \
- .valid = true, \
- .type = DESCRIPTOR, \
- .uuid = STR(desc_uuid), \
- .att_permissions = permissions, \
- .value = (uint8_t *)string, \
- .len = strlen(string), \
- }
- static struct gatt_db *make_db(const struct att_handle_spec *spec)
- {
- struct gatt_db *db = gatt_db_new();
- struct gatt_db_attribute *att, *include_att;
- bt_uuid_t uuid;
- att = include_att = NULL;
- for (; spec->valid; spec++) {
- switch (spec->type) {
- case PRIMARY:
- case SECONDARY:
- bt_string_to_uuid(&uuid, spec->uuid);
- if (att)
- gatt_db_service_set_active(att, true);
- att = gatt_db_insert_service(db, spec->handle, &uuid,
- spec->type == PRIMARY, spec->len);
- break;
- case INCLUDE:
- include_att = gatt_db_get_attribute(db, spec->handle);
- gatt_db_service_add_included(att, include_att);
- break;
- case CHARACTERISTIC:
- bt_string_to_uuid(&uuid, spec->uuid);
- add_char_with_value(att, spec->handle, &uuid,
- spec->att_permissions,
- spec->char_properties,
- spec->value, spec->len);
- break;
- case DESCRIPTOR:
- bt_string_to_uuid(&uuid, spec->uuid);
- add_desc_with_value(att, spec->handle, &uuid,
- spec->att_permissions,
- spec->value, spec->len);
- break;
- };
- }
- if (att)
- gatt_db_service_set_active(att, true);
- return db;
- }
- static struct gatt_db *make_service_data_1_db(void)
- {
- const struct att_handle_spec specs[] = {
- PRIMARY_SERVICE(0x0001, GATT_UUID, 4),
- CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, "BlueZ"),
- DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ,
- "Device Name"),
- PRIMARY_SERVICE(0x0005, HEART_RATE_UUID, 4),
- CHARACTERISTIC_STR(GATT_CHARAC_MANUFACTURER_NAME_STRING,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE, ""),
- DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ,
- "Manufacturer Name"),
- { }
- };
- return make_db(specs);
- }
- #define CHARACTERISTIC_STR_AT(chr_handle, chr_uuid, permissions, properties, \
- string) \
- { \
- .valid = true, \
- .handle = chr_handle, \
- .type = CHARACTERISTIC, \
- .uuid = STR(chr_uuid), \
- .att_permissions = permissions, \
- .char_properties = properties, \
- .value = (uint8_t *)string, \
- .len = strlen(string), \
- }
- #define DESCRIPTOR_STR_AT(desc_handle, desc_uuid, permissions, string) \
- { \
- .valid = true, \
- .handle = desc_handle, \
- .type = DESCRIPTOR, \
- .uuid = STR(desc_uuid), \
- .att_permissions = permissions, \
- .value = (uint8_t *)string, \
- .len = strlen(string), \
- }
- static struct gatt_db *make_service_data_2_db(void)
- {
- const struct att_handle_spec specs[] = {
- PRIMARY_SERVICE(0x0001, GATT_UUID, 4),
- CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, "BlueZ"),
- DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ,
- "Device Name"),
- PRIMARY_SERVICE(0x0005, HEART_RATE_UUID, 6),
- CHARACTERISTIC_STR_AT(0x0008,
- GATT_CHARAC_MANUFACTURER_NAME_STRING,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE, ""),
- DESCRIPTOR_STR_AT(0x000a, GATT_CHARAC_USER_DESC_UUID,
- BT_ATT_PERM_READ, "Manufacturer Name"),
- { }
- };
- return make_db(specs);
- }
- #define CHARACTERISTIC_AT(chr_handle, chr_uuid, permissions, properties, \
- bytes...) \
- { \
- .valid = true, \
- .handle = chr_handle, \
- .type = CHARACTERISTIC, \
- .uuid = STR(chr_uuid), \
- .att_permissions = permissions, \
- .char_properties = properties, \
- .value = data(bytes), \
- .len = sizeof(data(bytes)), \
- }
- #define DESCRIPTOR_AT(desc_handle, desc_uuid, permissions, bytes...) \
- { \
- .valid = true, \
- .handle = desc_handle, \
- .type = DESCRIPTOR, \
- .uuid = STR(desc_uuid), \
- .att_permissions = permissions, \
- .value = data(bytes), \
- .len = sizeof(data(bytes)), \
- }
- static struct gatt_db *make_service_data_3_db(void)
- {
- const struct att_handle_spec specs[] = {
- PRIMARY_SERVICE(0x0100, GAP_UUID, 0x0121 - 0x0100 + 1),
- CHARACTERISTIC_STR_AT(0x0111, GATT_CHARAC_DEVICE_NAME,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, "BlueZ"),
- CHARACTERISTIC_AT(0x0121, GATT_CHARAC_APPEARANCE,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, 0x00, 0x00),
- PRIMARY_SERVICE(0x0200, GATT_UUID, 0x0200 - 0x0200 + 1),
- PRIMARY_SERVICE(0x0300, HEART_RATE_UUID, 0x0320 - 0x0300 + 1),
- CHARACTERISTIC_STR_AT(0x0311,
- GATT_CHARAC_MANUFACTURER_NAME_STRING,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE, ""),
- DESCRIPTOR_AT(0x0320, GATT_CLIENT_CHARAC_CFG_UUID,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x00, 0x00),
- { }
- };
- return make_db(specs);
- }
- /*
- * Defined Test database 1:
- * Tiny database fits into a single minimum sized-pdu.
- * Satisfies requirements:
- * 3. At least one primary service at the MAX handle
- * 7. at least one service uuid with multiple instances
- * 8. Some simple services, some with included services
- * 9. an instance where handle of included service comes before the including
- * service
- * 11. Simple characteristics (no desc) and complex characteristics
- * (multiple descriptors)
- * 12. Instances of complex chars with 16-bit and 128-bit uuids
- * (although not in scrambled order)
- */
- static struct gatt_db *make_test_spec_small_db(void)
- {
- const struct att_handle_spec specs[] = {
- SECONDARY_SERVICE(0x0001, DEVICE_INFORMATION_UUID, 16),
- CHARACTERISTIC_STR(GATT_CHARAC_MANUFACTURER_NAME_STRING,
- BT_ATT_PERM_READ |
- BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_NOTIFY |
- BT_GATT_CHRC_PROP_INDICATE |
- BT_GATT_CHRC_PROP_EXT_PROP,
- "BlueZ"),
- DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ |
- BT_ATT_PERM_WRITE, 0x00, 0x00),
- DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID, BT_ATT_PERM_READ,
- "Manufacturer Name"),
- DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01,
- 0x00),
- CHARACTERISTIC_STR(GATT_CHARAC_SOFTWARE_REVISION_STRING,
- BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_INDICATE,
- "5.59"),
- DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID, BT_ATT_PERM_READ
- | BT_ATT_PERM_WRITE, 0x00, 0x00),
- PRIMARY_SERVICE(0xF010, GAP_UUID, 9),
- INCLUDE(0x0001),
- CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ,
- "BlueZ Unit Tester"),
- CHARACTERISTIC(0000B009-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_EXT_PROP, 0x09),
- DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01,
- 0x00),
- CHARACTERISTIC(GATT_CHARAC_APPEARANCE, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, 0x00, 0x00),
- PRIMARY_SERVICE(0xFFFF, DEVICE_INFORMATION_UUID, 1),
- { }
- };
- return make_db(specs);
- }
- /*
- * Defined Test database 2:
- * Large Database with 128-bit services at the end
- * Satisfies requirements:
- * 4. at least one primary service without any include or characteristic
- * at the max handle.
- * 6. at least one secondary service
- * 7. at least one each of 16-bit and 128-bit UUID with multiple instances
- * 8. some simple services, some some with included services
- * 9. one instance where an included service comes before the including
- * 10. one or more services with both 16-bit and 128-bit service UUIDs
- * 11. simple and complex characteristics
- * 12. complex chars with 16-bit and 128-bit uuids
- */
- #define STRING_512BYTES "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "11111222223333344444555556666677777888889999900000" \
- "111112222233"
- static struct gatt_db *make_test_spec_large_db_1(void)
- {
- const struct att_handle_spec specs[] = {
- PRIMARY_SERVICE(0x0080, "a00b", 7),
- CHARACTERISTIC(0xb008, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE |
- BT_GATT_CHRC_PROP_EXT_PROP,
- 0x08),
- DESCRIPTOR(0xb015, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x01),
- DESCRIPTOR(0xb016, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x02),
- DESCRIPTOR(0xb017, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE |
- BT_ATT_PERM_ENCRYPT, 0x03),
- DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01,
- 0x00),
- SECONDARY_SERVICE(0x0001, "a00d", 6),
- INCLUDE(0x0080),
- CHARACTERISTIC(0xb00c, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x0C),
- CHARACTERISTIC(0000b00b-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ, 0x0B),
- PRIMARY_SERVICE(0x0010, GATT_UUID, 4),
- CHARACTERISTIC(GATT_CHARAC_SERVICE_CHANGED, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_INDICATE,
- 0x01, 0x00, 0xFF, 0xFF),
- DESCRIPTOR(GATT_CLIENT_CHARAC_CFG_UUID,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x00, 0x00),
- PRIMARY_SERVICE(0x0020, "a00a", 10),
- INCLUDE(0x0001),
- CHARACTERISTIC(0xb001, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x01),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- STRING_512BYTES),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_WRITE,
- "1111122222333334444455555"
- "6666677777888889999900000"),
- CHARACTERISTIC(0xb003, BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_WRITE, 0x03),
- PRIMARY_SERVICE(0x0030, "a00b", 3),
- CHARACTERISTIC(0xb007, BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_WRITE, 0x07),
- PRIMARY_SERVICE(0x0040, GAP_UUID, 7),
- CHARACTERISTIC_STR(GATT_CHARAC_DEVICE_NAME, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ,
- "Test Database"),
- CHARACTERISTIC(GATT_CHARAC_APPEARANCE, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, 17),
- CHARACTERISTIC(GATT_CHARAC_PERIPHERAL_PREF_CONN,
- BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x64, 0x00, 0xC8, 0x00, 0x00, 0x00, 0x07, 0xD0),
- PRIMARY_SERVICE(0x0050, "a00b", 3),
- CHARACTERISTIC(0xb006, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE |
- BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP |
- BT_GATT_CHRC_PROP_NOTIFY |
- BT_GATT_CHRC_PROP_INDICATE, 0x06),
- PRIMARY_SERVICE(0x0060, "a00b", 12),
- CHARACTERISTIC(0xb004, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ | BT_GATT_CHRC_PROP_WRITE, 0x04),
- CHARACTERISTIC(0xb004, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ | BT_GATT_CHRC_PROP_WRITE, 0x04),
- DESCRIPTOR(GATT_SERVER_CHARAC_CFG_UUID,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x00, 0x00),
- CHARACTERISTIC(0xb004, 0, 0, 0x04),
- DESCRIPTOR(0xb012, 0, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00, 0x11, 0x22, 0x33,
- 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0x11,
- 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
- 0x00, 0x11, 0x22, 0x33),
- CHARACTERISTIC(0xb004, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x04),
- DESCRIPTOR(0xb012, BT_ATT_PERM_READ, 0x11, 0x22, 0x33, 0x44,
- 0x55, 0x66, 0x77, 0x88, 0x99, 0x00, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
- 0x77, 0x88, 0x99, 0x00, 0x11, 0x22, 0x33),
- PRIMARY_SERVICE(0x0070, "a00b", 7),
- CHARACTERISTIC(0xb005, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE |
- BT_GATT_CHRC_PROP_EXT_PROP,
- 0x05),
- DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x03,
- 0x00),
- DESCRIPTOR_STR(GATT_CHARAC_USER_DESC_UUID,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
- DESCRIPTOR(GATT_CHARAC_FMT_UUID, 0x04, 0x00, 0x01, 0x30, 0x01,
- 0x11, 0x31),
- DESCRIPTOR(0000d5d4-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ, 0x44),
- /* 0x0080 service defined earlier, included in 0x0001 */
- PRIMARY_SERVICE(0x0090, "0000a00c-0000-0000-0123-456789abcdef",
- 7),
- INCLUDE(0x0001),
- CHARACTERISTIC(0000b009-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE |
- BT_GATT_CHRC_PROP_EXT_PROP, 0x09),
- DESCRIPTOR(GATT_CHARAC_EXT_PROPER_UUID, BT_ATT_PERM_READ, 0x01,
- 0x00),
- DESCRIPTOR(0000d9d2-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_READ | BT_ATT_PERM_WRITE, 0x22),
- DESCRIPTOR(0000d9d3-0000-0000-0123-456789abcdef,
- BT_ATT_PERM_WRITE, 0x33),
- PRIMARY_SERVICE(0x00a0, "a00f", 18),
- CHARACTERISTIC_STR(0xb00e, BT_ATT_PERM_READ,
- BT_GATT_CHRC_PROP_READ, "Length is "),
- DESCRIPTOR(GATT_CHARAC_FMT_UUID, BT_ATT_PERM_READ, 0x19, 0x00,
- 0x00, 0x30, 0x01, 0x00, 0x00),
- CHARACTERISTIC(0xb00f, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE, 0x65),
- DESCRIPTOR(GATT_CHARAC_FMT_UUID, BT_ATT_PERM_READ, 0x04, 0x00,
- 0x01, 0x27, 0x01, 0x01, 0x00),
- CHARACTERISTIC(0xb006, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- 0x34, 0x12),
- DESCRIPTOR(GATT_CHARAC_FMT_UUID, BT_ATT_PERM_READ, 0x06, 0x00,
- 0x10, 0x27, 0x01, 0x02, 0x00),
- CHARACTERISTIC(0xb007, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- 0x04, 0x03, 0x02, 0x01),
- DESCRIPTOR(GATT_CHARAC_FMT_UUID, BT_ATT_PERM_READ, 0x08, 0x00,
- 0x17, 0x27, 0x01, 0x03, 0x00),
- CHARACTERISTIC(0xb010, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x65, 0x34, 0x12, 0x04, 0x03, 0x02,
- 0x01),
- DESCRIPTOR(GATT_CHARAC_AGREG_FMT_UUID, BT_ATT_PERM_READ, 0xA6,
- 0x00, 0xa9, 0x00, 0xac, 0x00),
- CHARACTERISTIC(0xb011, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_AUTH, 0x012),
- PRIMARY_SERVICE(0x00C0, "0000a00c-0000-0000-0123-456789abcdef",
- 30),
- CHARACTERISTIC(0xb00a, BT_ATT_PERM_READ, BT_GATT_CHRC_PROP_READ,
- 0x0A),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "111112222233333444445"),
- DESCRIPTOR(0xb012, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "2222233333444445555566"),
- DESCRIPTOR(0xb013, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11,
- 0x22),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "33333444445555566666777"),
- DESCRIPTOR(0xb014, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11,
- 0x22, 0x33),
- CHARACTERISTIC(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33),
- DESCRIPTOR(0xb012, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33),
- CHARACTERISTIC(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44),
- DESCRIPTOR(0xb013, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44),
- CHARACTERISTIC(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55),
- DESCRIPTOR(0xb014, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "1111122222333334444455555"
- "666667777788888999"),
- DESCRIPTOR(0xb012, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "2222233333444445555566666"
- "7777788888999990000"),
- DESCRIPTOR(0xb013, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44),
- CHARACTERISTIC_STR(0xb002, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- BT_GATT_CHRC_PROP_READ |
- BT_GATT_CHRC_PROP_WRITE,
- "3333344444555556666677777"
- "88888999990000011111"),
- DESCRIPTOR(0xb014, BT_ATT_PERM_READ | BT_ATT_PERM_WRITE,
- 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88,
- 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12,
- 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x11, 0x22,
- 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00,
- 0x11, 0x22, 0x33, 0x44, 0x55),
- { }
- };
- return make_db(specs);
- }
- static void test_client(gconstpointer data)
- {
- create_context(512, data);
- }
- static void test_server(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- ssize_t len;
- const struct test_pdu pdu = SERVER_MTU_EXCHANGE_PDU;
- len = write(context->fd, pdu.data, pdu.size);
- g_assert_cmpint(len, ==, pdu.size);
- tester_monitor('<', 0x0004, 0x0000, pdu.data, len);
- g_free(pdu.data);
- }
- static void test_search_primary(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- const struct test_data *test_data = data;
- context->req = bt_gatt_discover_all_primary_services(context->att,
- test_data->uuid,
- generic_search_cb,
- context, NULL);
- }
- static void test_search_included(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- context->req = bt_gatt_discover_included_services(context->att,
- 0x0001, 0xffff,
- generic_search_cb,
- context, NULL);
- }
- static void test_search_chars(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- context->req = bt_gatt_discover_characteristics(context->att,
- 0x0010, 0x0020,
- generic_search_cb,
- context, NULL);
- g_assert(context->req);
- }
- static void test_search_descs(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- context->req = bt_gatt_discover_descriptors(context->att,
- 0x0013, 0x0016,
- generic_search_cb,
- context, NULL);
- g_assert(context->req);
- }
- static const struct test_step test_read_by_type_1 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x0a,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_read_by_type_2 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x02,
- };
- static const struct test_step test_read_by_type_3 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x0a,
- };
- static const struct test_step test_read_by_type_4 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x08,
- };
- static const struct test_step test_read_by_type_5 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x05,
- };
- static const struct test_step test_read_by_type_6 = {
- .handle = 0x0001,
- .end_handle = 0xffff,
- .expected_att_ecode = 0x0c,
- };
- static void multiple_read_cb(bool success, uint8_t att_ecode,
- const uint8_t *value, uint16_t length,
- void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- g_assert_cmpint(att_ecode, ==, step->expected_att_ecode);
- if (success) {
- g_assert_cmpint(length, ==, step->length);
- g_assert(memcmp(value, step->value, length) == 0);
- }
- context_quit(context);
- }
- static void test_multiple_read(struct context *context)
- {
- const struct test_step *step = context->data->step;
- uint16_t handles[2];
- handles[0] = step->handle;
- handles[1] = step->end_handle;
- g_assert(bt_gatt_client_read_multiple(context->client, handles, 2,
- multiple_read_cb, context,
- NULL));
- }
- static const struct test_step test_multiple_read_1 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_multiple_read_2 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .expected_att_ecode = 0x02
- };
- static const struct test_step test_multiple_read_3 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .expected_att_ecode = 0x01
- };
- static const struct test_step test_multiple_read_4 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .expected_att_ecode = 0x08
- };
- static const struct test_step test_multiple_read_5 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .expected_att_ecode = 0x05
- };
- static const struct test_step test_multiple_read_6 = {
- .handle = 0x0003,
- .end_handle = 0x0007,
- .func = test_multiple_read,
- .expected_att_ecode = 0x0c
- };
- static void read_by_type_cb(bool success, uint8_t att_ecode,
- struct bt_gatt_result *result,
- void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- struct bt_gatt_iter iter;
- g_assert(att_ecode == step->expected_att_ecode);
- if (success) {
- uint16_t length, handle;
- const uint8_t *value;
- g_assert(bt_gatt_iter_init(&iter, result));
- g_assert(bt_gatt_iter_next_read_by_type(&iter, &handle, &length,
- &value));
- g_assert(length == step->length);
- g_assert(!memcmp(value, step->value, length));
- g_assert(!bt_gatt_iter_next_read_by_type(&iter, &handle,
- &length, &value));
- }
- context_quit(context);
- }
- static void test_read_by_type(gconstpointer data)
- {
- struct context *context = create_context(512, data);
- const struct test_data *test_data = data;
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_read_by_type(context->att, step->handle,
- step->end_handle, test_data->uuid,
- read_by_type_cb, context, NULL));
- }
- static void test_long_read(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_read_long_value(context->client, step->handle,
- 0, multiple_read_cb, context,
- NULL));
- }
- static const struct test_step test_long_read_1 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_read_2 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0,
- .value = long_data_2,
- .length = sizeof(long_data_2)
- };
- static const struct test_step test_long_read_3 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0x02
- };
- static const struct test_step test_long_read_4 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0x07
- };
- static const struct test_step test_long_read_5 = {
- .handle = 0x0000,
- .func = test_long_read,
- .expected_att_ecode = 0x01
- };
- static const struct test_step test_long_read_6 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0x08
- };
- static const struct test_step test_long_read_7 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0x05
- };
- static const struct test_step test_long_read_8 = {
- .handle = 0x0003,
- .func = test_long_read,
- .expected_att_ecode = 0x0c
- };
- /* Descriptor test data's */
- static const struct test_step test_long_read_9 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0,
- .value = read_data_1,
- .length = 0x03
- };
- static const struct test_step test_long_read_10 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0,
- .value = long_data_2,
- .length = sizeof(long_data_2)
- };
- static const struct test_step test_long_read_11 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0x02
- };
- static const struct test_step test_long_read_12 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0x07
- };
- static const struct test_step test_long_read_13 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0x08
- };
- static const struct test_step test_long_read_14 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0x05
- };
- static const struct test_step test_long_read_15 = {
- .handle = 0x0004,
- .func = test_long_read,
- .expected_att_ecode = 0x0c
- };
- static void notification_cb(uint16_t value_handle, const uint8_t *value,
- uint16_t length, void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- if (value_handle == step->handle) {
- g_assert_cmpint(length, ==, step->length);
- g_assert(memcmp(value, step->value, length) == 0);
- context_quit(context);
- }
- }
- static void notification_register_cb(uint16_t att_ecode, void *user_data)
- {
- g_assert(!att_ecode);
- }
- static void test_notification(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_register_notify(context->client, step->handle,
- notification_register_cb,
- notification_cb, context,
- NULL));
- }
- static const struct test_step test_notification_1 = {
- .handle = 0x0003,
- .func = test_notification,
- .value = read_data_1,
- .length = 0x03,
- };
- static void test_server_notification(struct context *context)
- {
- const struct test_step *step = context->data->step;
- bt_gatt_server_send_notification(context->server, step->handle,
- step->value, step->length, false);
- }
- static const struct test_step test_notification_server_1 = {
- .handle = 0x0003,
- .func = test_server_notification,
- .value = read_data_1,
- .length = 0x03,
- };
- static uint8_t indication_received;
- static void test_indication_cb(void *user_data)
- {
- struct context *context = user_data;
- indication_received = 1;
- context_quit(context);
- }
- static void test_server_indication_confirm(struct context *context)
- {
- g_assert(indication_received == 1);
- }
- static void indication_cb(uint16_t value_handle, const uint8_t *value,
- uint16_t length, void *user_data)
- {
- struct context *context = user_data;
- const struct test_step *step = context->data->step;
- if (value_handle == step->handle) {
- g_assert_cmpint(length, ==, step->length);
- g_assert(memcmp(value, step->value, length) == 0);
- }
- }
- static void test_indication(struct context *context)
- {
- const struct test_step *step = context->data->step;
- g_assert(bt_gatt_client_register_notify(context->client, step->handle,
- notification_register_cb,
- indication_cb, context,
- NULL));
- }
- static const struct test_step test_indication_1 = {
- .handle = 0x0008,
- .func = test_indication,
- .value = read_data_1,
- .length = 0x03,
- };
- static void test_server_indication(struct context *context)
- {
- const struct test_step *step = context->data->step;
- bt_gatt_server_send_indication(context->server, step->handle,
- step->value, step->length,
- test_indication_cb,
- context, NULL);
- }
- static const struct test_step test_indication_server_1 = {
- .handle = 0x0003,
- .func = test_server_indication,
- .post_func = test_server_indication_confirm,
- .value = read_data_1,
- .length = 0x03,
- };
- int main(int argc, char *argv[])
- {
- struct gatt_db *service_db_1, *service_db_2, *service_db_3;
- struct gatt_db *ts_small_db, *ts_large_db_1;
- tester_init(&argc, &argv);
- service_db_1 = make_service_data_1_db();
- service_db_2 = make_service_data_2_db();
- service_db_3 = make_service_data_3_db();
- ts_small_db = make_test_spec_small_db();
- ts_large_db_1 = make_test_spec_large_db_1();
- /*
- * Server Configuration
- *
- * The test group objective is to verify Generic Attribute Profile
- * Server Configuration.
- */
- define_test_client("/TP/GAC/CL/BV-01-C", test_client, NULL, NULL,
- raw_pdu(0x02, 0x00, 0x02));
- define_test_server("/TP/GAC/SR/BV-01-C", test_server, service_db_1,
- NULL,
- raw_pdu(0x03, 0x00, 0x02));
- /*
- * Discovery
- *
- * The test group objective is to verify Generic Attribute Profile
- * Discovery of Services and Service Characteristics.
- */
- define_test_att("/TP/GAD/CL/BV-01-C", test_search_primary, NULL, NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x06, 0x10, 0x00, 0x13, 0x00, 0x00, 0x18,
- 0x20, 0x00, 0x29, 0x00, 0xb0, 0x68,
- 0x30, 0x00, 0x32, 0x00, 0x19, 0x18),
- raw_pdu(0x10, 0x33, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x14, 0x90, 0x00, 0x96, 0x00, 0xef, 0xcd,
- 0xab, 0x89, 0x67, 0x45, 0x23, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x85, 0x60,
- 0x00, 0x00),
- raw_pdu(0x10, 0x97, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x01, 0x10, 0x97, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-01-C-small", test_search_primary, NULL,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- PRIMARY_DISC_SMALL_DB);
- define_test_server("/TP/GAD/SR/BV-01-C", test_server, service_db_1,
- NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x10, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x11, 0x06, 0x01, 0x00, 0x04, 0x00, 0x01, 0x18,
- 0x05, 0x00, 0x08, 0x00, 0x0d, 0x18),
- raw_pdu(0x10, 0x06, 0x00, 0xff, 0xff, 0x00, 0x28),
- raw_pdu(0x01, 0x10, 0x06, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-01-C-small", test_server, ts_small_db,
- NULL,
- raw_pdu(0x03, 0x00, 0x02),
- PRIMARY_DISC_SMALL_DB);
- define_test_server("/TP/GAD/SR/BV-01-C-large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- PRIMARY_DISC_LARGE_DB_1);
- define_test_att("/TP/GAD/CL/BV-02-C-1", test_search_primary, &uuid_16,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00,
- 0x18),
- raw_pdu(0x07, 0x01, 0x00, 0x07, 0x00),
- raw_pdu(0x06, 0x08, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00,
- 0x18),
- raw_pdu(0x01, 0x06, 0x08, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-02-C-1-alternative",
- test_search_primary, &uuid_16,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00,
- 0x18),
- raw_pdu(0x07, 0x01, 0x00, 0xFF, 0xFF));
- define_test_att("/TP/GAD/CL/BV-02-C-2", test_search_primary, &uuid_128,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0xfb,
- 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00,
- 0x80, 0x00, 0x10, 0x00, 0x00, 0x0d,
- 0x18, 0x00, 0x00),
- raw_pdu(0x07, 0x10, 0x00, 0x17, 0x00),
- raw_pdu(0x06, 0x18, 0x00, 0xff, 0xff, 0x00, 0x28, 0xfb,
- 0x34, 0x9b, 0x5f, 0x80, 0x00, 0x00,
- 0x80, 0x00, 0x10, 0x00, 0x00, 0x0d,
- 0x18, 0x00, 0x00),
- raw_pdu(0x01, 0x06, 0x18, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/exists-16/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x00,
- 0x18),
- raw_pdu(0x07, 0x10, 0xf0, 0x18, 0xf0),
- raw_pdu(0x06, 0x18, 0xf0, 0xff, 0xff, 0x00, 0x28, 0x00,
- 0x18),
- raw_pdu(0x01, 0x06, 0x18, 0xf0, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/exists-16/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x0b,
- 0xa0),
- raw_pdu(0x07, 0x30, 0x00, 0x32, 0x00, 0x50, 0x00, 0x52,
- 0x00, 0x60, 0x00, 0x6b, 0x00, 0x70, 0x00, 0x76,
- 0x00, 0x80, 0x00, 0x86, 0x00),
- raw_pdu(0x06, 0x86, 0x00, 0xff, 0xff, 0x00, 0x28, 0x0b,
- 0xa0),
- raw_pdu(0x01, 0x06, 0x86, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/missing-16/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x01,
- 0x18),
- raw_pdu(0x01, 0x06, 0x01, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/missing-16/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0x0f,
- 0xf0),
- raw_pdu(0x01, 0x06, 0x01, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/exists-128/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0xef,
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00),
- raw_pdu(0x07, 0x90, 0x00, 0x96, 0x00, 0xc0, 0x00, 0xdd,
- 0x00),
- raw_pdu(0x06, 0xde, 0x00, 0xff, 0xff, 0x00, 0x28, 0xef,
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00),
- raw_pdu(0x01, 0x06, 0xde, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-02-C/missing-128/large-1",
- test_server, ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x06, 0x01, 0x00, 0xff, 0xff, 0x00, 0x28, 0xff,
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x0c, 0xa0, 0x00, 0x00),
- raw_pdu(0x01, 0x06, 0x01, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-03-C", test_search_included, NULL,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x02, 0x00, 0x10, 0x00, 0x1f, 0x00,
- 0x0f, 0x18),
- raw_pdu(0x08, 0x03, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x06, 0x03, 0x00, 0x20, 0x00, 0x2f, 0x00,
- 0x04, 0x00, 0x30, 0x00, 0x3f, 0x00),
- raw_pdu(0x0a, 0x20, 0x00),
- raw_pdu(0x0b, 0x00, 0x00, 0x3e, 0x39, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x23, 0x45, 0x67, 0x89,
- 0xab, 0xcd, 0xef),
- raw_pdu(0x0a, 0x30, 0x00),
- raw_pdu(0x0b, 0x00, 0x00, 0x3b, 0x39, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x23, 0x45, 0x67, 0x89,
- 0xab, 0xcd, 0xef),
- raw_pdu(0x08, 0x05, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x05, 0x00, 0x40, 0x00, 0x4f, 0x00,
- 0x0a, 0x18),
- raw_pdu(0x08, 0x06, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x06, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-03-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x11, 0xf0, 0x01, 0x00, 0x10, 0x00,
- 0x0a, 0x18),
- raw_pdu(0x08, 0x12, 0xf0, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x12, 0xf0, 0x0a));
- define_test_server("/TP/GAD/SR/BV-03-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x02, 0x00, 0x80, 0x00, 0x86, 0x00,
- 0x0b, 0xa0, 0x21, 0x00, 0x01, 0x00, 0x06, 0x00,
- 0x0d, 0xa0),
- raw_pdu(0x08, 0x22, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x09, 0x08, 0x91, 0x00, 0x01, 0x00, 0x06, 0x00,
- 0x0d, 0xa0),
- raw_pdu(0x08, 0x92, 0x00, 0xff, 0xff, 0x02, 0x28),
- raw_pdu(0x01, 0x08, 0x92, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-04-C", test_search_chars, NULL,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x10, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x11, 0x00, 0x02, 0x12, 0x00, 0x25,
- 0x2a),
- raw_pdu(0x08, 0x12, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x15, 0x13, 0x00, 0x02, 0x14, 0x00, 0x85,
- 0x00, 0xef, 0xcd, 0xab, 0x89, 0x67,
- 0x45, 0x23, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00),
- raw_pdu(0x08, 0x14, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x12, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-04-C/small/1", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x10, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00,
- 0x2a),
- raw_pdu(0x08, 0x13, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef,
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0xb0, 0x00, 0x00),
- raw_pdu(0x08, 0x15, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01,
- 0x2a),
- raw_pdu(0x08, 0x18, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a));
- define_test_server("/TP/GAD/SR/BV-04-C/small/2", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29,
- 0x2a, 0x07, 0x00, 0x22, 0x08, 0x00,
- 0x28, 0x2a),
- raw_pdu(0x08, 0x08, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x08, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-04-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x20, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x22, 0x00, 0x02, 0x23, 0x00, 0x01,
- 0xb0, 0x24, 0x00, 0x0a, 0x25, 0x00, 0x02, 0xb0,
- 0x26, 0x00, 0x08, 0x27, 0x00, 0x02, 0xb0),
- raw_pdu(0x08, 0x27, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x28, 0x00, 0x08, 0x29, 0x00, 0x03,
- 0xb0),
- raw_pdu(0x08, 0x29, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x29, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-05-C", test_search_chars, NULL,
- NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x10, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x11, 0x00, 0x02, 0x12, 0x00, 0x25,
- 0x2a),
- raw_pdu(0x08, 0x12, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x15, 0x13, 0x00, 0x02, 0x14, 0x00, 0x85,
- 0x00, 0xef, 0xcd, 0xab, 0x89, 0x67,
- 0x45, 0x23, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00),
- raw_pdu(0x08, 0x14, 0x00, 0x20, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x12, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-05-C/small/1", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x10, 0xf0, 0x17, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x12, 0xf0, 0x02, 0x13, 0xf0, 0x00,
- 0x2a),
- raw_pdu(0x08, 0x13, 0xf0, 0x17, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x15, 0x14, 0xf0, 0x82, 0x15, 0xf0, 0xef,
- 0xcd, 0xab, 0x89, 0x67, 0x45, 0x23,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0xb0, 0x00, 0x00),
- raw_pdu(0x08, 0x15, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x17, 0xf0, 0x02, 0x18, 0xf0, 0x01,
- 0x2a),
- raw_pdu(0x08, 0x18, 0xf0, 0x18, 0xf0, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x18, 0xf0, 0x0a));
- define_test_server("/TP/GAD/SR/BV-05-C/small/2", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x02, 0x00, 0xb2, 0x03, 0x00, 0x29,
- 0x2a, 0x07, 0x00, 0x22, 0x08, 0x00,
- 0x28, 0x2a),
- raw_pdu(0x08, 0x08, 0x00, 0x0f, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x08, 0x00, 0x0a));
- define_test_server("/TP/GAD/SR/BV-05-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x20, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x22, 0x00, 0x02, 0x23, 0x00, 0x01,
- 0xb0, 0x24, 0x00, 0x0a, 0x25, 0x00, 0x02, 0xb0,
- 0x26, 0x00, 0x08, 0x27, 0x00, 0x02, 0xb0),
- raw_pdu(0x08, 0x27, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x09, 0x07, 0x28, 0x00, 0x08, 0x29, 0x00, 0x03,
- 0xb0),
- raw_pdu(0x08, 0x29, 0x00, 0x29, 0x00, 0x03, 0x28),
- raw_pdu(0x01, 0x08, 0x29, 0x00, 0x0a));
- define_test_att("/TP/GAD/CL/BV-06-C", test_search_descs, NULL, NULL,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x04, 0x13, 0x00, 0x16, 0x00),
- raw_pdu(0x05, 0x01, 0x13, 0x00, 0x02, 0x29, 0x14, 0x00,
- 0x03, 0x29),
- raw_pdu(0x04, 0x15, 0x00, 0x16, 0x00),
- raw_pdu(0x05, 0x01, 0x15, 0x00, 0x04, 0x29, 0x16, 0x00,
- 0x05, 0x29));
- define_test_client("/TP/GAD/CL/BV-06-C/client-1", test_client,
- service_db_1, NULL,
- SERVICE_DATA_1_PDUS);
- define_test_client("/TP/GAD/CL/BV-06-C/client-2", test_client,
- service_db_2, NULL,
- SERVICE_DATA_2_PDUS);
- define_test_client("/TP/GAD/CL/BV-06-C/client-3", test_client,
- service_db_3, NULL,
- SERVICE_DATA_3_PDUS);
- define_test_server("/TP/GAD/SR/BV-06-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x04, 0x04, 0x00, 0x05, 0x00),
- raw_pdu(0x05, 0x01, 0x04, 0x00, 0x02, 0x29, 0x05, 0x00,
- 0x01, 0x29));
- define_test_server("/TP/GAD/SR/BV-06-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x04, 0x73, 0x00, 0x76, 0x00),
- raw_pdu(0x05, 0x01, 0x73, 0x00, 0x00, 0x29, 0x74, 0x00,
- 0x01, 0x29, 0x75, 0x00, 0x04, 0x29),
- raw_pdu(0x04, 0x76, 0x00, 0x76, 0x00),
- raw_pdu(0x05, 0x02, 0x76, 0x00, 0xef, 0xcd, 0xab, 0x89,
- 0x67, 0x45, 0x23, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0xd4, 0xd5, 0x00, 0x00));
- define_test_client("/TP/GAR/CL/BV-01-C", test_client, service_db_1,
- &test_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-01-C", test_client, service_db_1,
- &test_read_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x00, 0x00),
- raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAR/CL/BI-02-C", test_client, service_db_1,
- &test_read_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x02));
- define_test_client("/TP/GAR/CL/BI-03-C", test_client, service_db_1,
- &test_read_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x08));
- define_test_client("/TP/GAR/CL/BI-04-C", test_client, service_db_1,
- &test_read_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05));
- define_test_client("/TP/GAR/CL/BI-04-C/auto", test_client, service_db_1,
- &test_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-05-C", test_client, service_db_1,
- &test_read_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x0c));
- define_test_server("/TP/GAR/SR/BV-01-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x42, 0x6c, 0x75, 0x65, 0x5a));
- define_test_server("/TP/GAR/SR/BV-01-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0a, 0xc4, 0x00),
- raw_pdu(0x0b, '1', '1', '1', '1', '1', '2', '2', '2',
- '2', '2', '3', '3', '3', '3', '3', '4', '4',
- '4', '4', '4', '5'),
- raw_pdu(0x0a, 0xca, 0x00),
- raw_pdu(0x0b, '3', '3', '3', '3', '3', '4', '4', '4',
- '4', '4', '5', '5', '5', '5', '5', '6', '6',
- '6', '6', '6', '7', '7'));
- define_test_server("/TP/GAR/SR/BI-02-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0a, 0x00, 0x00),
- raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAR/SR/BI-02-C/large", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0a, 0x0f, 0xf0),
- raw_pdu(0x01, 0x0a, 0x0f, 0xf0, 0x01));
- define_test_att("/TP/GAR/CL/BV-03-C-1", test_read_by_type,
- &uuid_char_16, &test_read_by_type_1,
- raw_pdu(0x02, 0x00, 0x02),
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x09, 0x05, 0x0a, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x08, 0x0b, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x0a));
- define_test_att("/TP/GAR/CL/BV-03-C-2", test_read_by_type,
- &uuid_char_128, &test_read_by_type_1,
- raw_pdu(0x02, 0x00, 0x02),
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0f, 0x0e, 0x0d,
- 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07,
- 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- 0x00),
- raw_pdu(0x09, 0x05, 0x0a, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x08, 0x0b, 0x00, 0xff, 0xff, 0x0f, 0x0e, 0x0d,
- 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07,
- 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- 0x00),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x0a));
- define_test_att("/TP/GAR/CL/BI-06-C", test_read_by_type, &uuid_char_16,
- &test_read_by_type_2,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x02));
- define_test_att("/TP/GAR/CL/BI-07-C", test_read_by_type, &uuid_char_16,
- &test_read_by_type_3,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x0a));
- define_test_att("/TP/GAR/CL/BI-09-C", test_read_by_type, &uuid_char_16,
- &test_read_by_type_4,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x08));
- define_test_att("/TP/GAR/CL/BI-10-C", test_read_by_type, &uuid_char_16,
- &test_read_by_type_5,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x05));
- define_test_att("/TP/GAR/CL/BI-11-C", test_read_by_type, &uuid_char_16,
- &test_read_by_type_6,
- MTU_EXCHANGE_CLIENT_PDUS,
- raw_pdu(0x08, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x2a),
- raw_pdu(0x01, 0x08, 0x0b, 0x00, 0x0c));
- define_test_server("/TP/GAR/SR/BV-03-C/small", test_server, ts_small_db,
- NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xef, 0xcd, 0xab,
- 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x09, 0xB0, 0x00,
- 0x00),
- raw_pdu(0x09, 0x03, 0x15, 0xF0, 0x09),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x01, 0x2a),
- raw_pdu(0x09, 0x04, 0x18, 0xF0, 0x00, 0x00));
- define_test_server("/TP/GAR/SR/BV-03-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xef, 0xcd, 0xab,
- 0x89, 0x67, 0x45, 0x23, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0xd4, 0xd5, 0x00,
- 0x00),
- raw_pdu(0x09, 0x03, 0x76, 0x00, 0x44),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x02, 0xB0),
- raw_pdu(0x09, 0x15, 0x25, 0x00, '1', '1', '1', '1', '1',
- '2', '2', '2', '2', '2', '3', '3', '3', '3',
- '3', '4', '4', '4', '4'));
- define_test_server("/TP/GAR/SR/BI-06-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0x07, 0xB0),
- raw_pdu(0x01, 0x08, 0x32, 0x00, 0x02));
- define_test_server("/TP/GAR/SR/BI-07-C/small", test_server, ts_small_db,
- NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xF0, 0x0F),
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a));
- define_test_server("/TP/GAR/SR/BI-07-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x01, 0x00, 0xFF, 0xFF, 0xF0, 0x0F),
- raw_pdu(0x01, 0x08, 0x01, 0x00, 0x0a));
- define_test_server("/TP/GAR/SR/BI-08-C/small", test_server, ts_small_db,
- NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28),
- raw_pdu(0x01, 0x08, 0x02, 0x00, 0x01));
- define_test_server("/TP/GAR/SR/BI-08-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x08, 0x02, 0x00, 0x01, 0x00, 0x00, 0x28),
- raw_pdu(0x01, 0x08, 0x02, 0x00, 0x01));
- define_test_server("/TP/GAR/SR/BV-04-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xD3, 0x00, 0x00, 0x00),
- raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
- 0x66, 0x77, 0x88, 0x99, 0x00, 0x11, 0x22),
- raw_pdu(0x0C, 0xD3, 0x00, 0x16, 0x00),
- raw_pdu(0x0D, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44),
- raw_pdu(0x0C, 0xD3, 0x00, 0x2C, 0x00),
- raw_pdu(0x0D, 0x55),
- raw_pdu(0x0C, 0xD3, 0x00, 0x2D, 0x00),
- raw_pdu(0x0D));
- define_test_server("/TP/GAR/SR/BI-12-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0x27, 0x00, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0x27, 0x00, 0x02));
- define_test_server("/TP/GAR/SR/BI-13-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0x13, 0xF0, 0xF0, 0x00),
- raw_pdu(0x01, 0x0C, 0x13, 0xF0, 0x07));
- define_test_server("/TP/GAR/SR/BI-13-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xD3, 0x00, 0xF0, 0x00),
- raw_pdu(0x01, 0x0C, 0xD3, 0x00, 0x07));
- define_test_server("/TP/GAR/SR/BI-14-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BI-14-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
- define_test_client("/TP/GAR/CL/BV-04-C", test_client, service_db_1,
- &test_long_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BV-04-C/512B", test_client, service_db_1,
- &test_long_read_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff),
- raw_pdu(0x0c, 0x03, 0x00, 0xff, 0x01),
- raw_pdu(0x0d, 0xff));
- define_test_client("/TP/GAR/CL/BV-05-C", test_client, service_db_1,
- &test_multiple_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x0f, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-12-C", test_client, service_db_1,
- &test_long_read_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x02));
- define_test_client("/TP/GAR/CL/BI-13-C", test_client, service_db_1,
- &test_long_read_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x07));
- define_test_client("/TP/GAR/CL/BI-14-C", test_client, service_db_1,
- &test_long_read_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x00, 0x00),
- raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAR/CL/BI-15-C", test_client, service_db_1,
- &test_long_read_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x08));
- define_test_client("/TP/GAR/CL/BI-16-C", test_client, service_db_1,
- &test_long_read_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05));
- define_test_client("/TP/GAR/CL/BI-16-C/auto", test_client, service_db_1,
- &test_long_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x05),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-17-C", test_client, service_db_1,
- &test_long_read_8,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x0c));
- define_test_client("/TP/GAR/CL/BI-18-C", test_client, service_db_1,
- &test_multiple_read_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x02));
- define_test_client("/TP/GAR/CL/BI-19-C", test_client, service_db_1,
- &test_multiple_read_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x01));
- define_test_client("/TP/GAR/CL/BI-20-C", test_client, service_db_1,
- &test_multiple_read_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x08));
- define_test_client("/TP/GAR/CL/BI-21-C", test_client, service_db_1,
- &test_multiple_read_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x05));
- define_test_client("/TP/GAR/CL/BI-21-C/auto", test_client, service_db_1,
- &test_multiple_read_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x05),
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x0f, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-22-C", test_client, service_db_1,
- &test_multiple_read_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0e, 0x03, 0x00, 0x07, 0x00),
- raw_pdu(0x01, 0x0e, 0x03, 0x00, 0x0c));
- define_test_server("/TP/GAR/SR/BV-05-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0e, 0x15, 0xF0, 0x03, 0x00),
- raw_pdu(0x0f, 0x09, 'B', 'l', 'u', 'e', 'Z'));
- define_test_server("/TP/GAR/SR/BV-05-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0e, 0x44, 0x00, 0x06, 0x00, 0xC4, 0x00),
- raw_pdu(0x0f, 0x11, 0x0B, '1', '1', '1', '1', '1', '2',
- '2', '2', '2', '2', '3', '3', '3', '3', '3',
- '4', '4', '4', '4', '4'));
- define_test_server("/TP/GAR/SR/BI-18-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0e, 0x44, 0x00, 0x06, 0x00, 0x27, 0x00),
- raw_pdu(0x01, 0x0e, 0x27, 0x00, 0x02));
- define_test_server("/TP/GAR/SR/BI-19-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0e, 0x15, 0xF0, 0xF0, 0x0F),
- raw_pdu(0x01, 0x0e, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BI-19-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0e, 0x44, 0x00, 0xF0, 0x0F),
- raw_pdu(0x01, 0x0e, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BV-06-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0A, 0x05, 0x00),
- raw_pdu(0x0B, 'M', 'a', 'n', 'u', 'f', 'a', 'c', 't',
- 'u', 'r', 'e', 'r', ' ', 'N', 'a', 'm', 'e'));
- define_test_server("/TP/GAR/SR/BV-06-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0A, 0xD4, 0x00),
- raw_pdu(0x0B, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
- 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34));
- define_test_server("/TP/GAR/SR/BI-23-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0A, 0x96, 0x00),
- raw_pdu(0x01, 0x0A, 0x96, 0x00, 0x02));
- define_test_server("/TP/GAR/SR/BI-24-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0A, 0xF0, 0x0F),
- raw_pdu(0x01, 0x0A, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BI-24-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0A, 0xF0, 0x0F),
- raw_pdu(0x01, 0x0A, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BV-07-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xD1, 0x00, 0x00, 0x00),
- raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
- 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34),
- raw_pdu(0x0C, 0xD1, 0x00, 0x16, 0x00),
- raw_pdu(0x0D, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x11, 0x22, 0x33, 0x44),
- raw_pdu(0x0C, 0xD1, 0x00, 0x2C, 0x00),
- raw_pdu(0x0D));
- define_test_server("/TP/GAR/SR/BV-08-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xCE, 0x00, 0x00, 0x00),
- raw_pdu(0x0D, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x12, 0x34, 0x56, 0x78, 0x90,
- 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34),
- raw_pdu(0x0C, 0xCE, 0x00, 0x16, 0x00),
- raw_pdu(0x0D, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, 0x78,
- 0x90, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0x00, 0x11, 0x22, 0x33),
- raw_pdu(0x0C, 0xCE, 0x00, 0x2B, 0x00),
- raw_pdu(0x0D));
- define_test_server("/TP/GAR/SR/BI-28-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0x96, 0x00, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0x96, 0x00, 0x02));
- define_test_server("/TP/GAR/SR/BI-29-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0x05, 0x00, 0xF0, 0x00),
- raw_pdu(0x01, 0x0C, 0x05, 0x00, 0x07));
- define_test_server("/TP/GAR/SR/BI-29-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xCE, 0x00, 0xF0, 0x00),
- raw_pdu(0x01, 0x0C, 0xCE, 0x00, 0x07));
- define_test_server("/TP/GAR/SR/BI-30-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
- define_test_server("/TP/GAR/SR/BI-30-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x0C, 0xF0, 0x0F, 0x00, 0x00),
- raw_pdu(0x01, 0x0C, 0xF0, 0x0F, 0x01));
- define_test_client("/TP/GAN/CL/BV-01-C", test_client, ts_small_db,
- &test_notification_1,
- CLIENT_INIT_PDUS,
- SMALL_DB_DISCOVERY_PDUS,
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x00),
- raw_pdu(0x13),
- raw_pdu(),
- raw_pdu(0x1B, 0x03, 0x00, 0x01, 0x02, 0x03));
- define_test_server("/TP/GAN/SR/BV-01-C", test_server, ts_small_db,
- &test_notification_server_1,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x00),
- raw_pdu(0x13),
- raw_pdu(),
- raw_pdu(0x1B, 0x03, 0x00, 0x01, 0x02, 0x03));
- define_test_server("/TP/GAI/SR/BV-01-C", test_server, ts_small_db,
- &test_indication_server_1,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x04, 0x00, 0x02, 0x00),
- raw_pdu(0x13),
- raw_pdu(),
- raw_pdu(0x1D, 0x03, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x1E));
- define_test_client("/TP/GAI/CL/BV-01-C", test_client, ts_small_db,
- &test_indication_1,
- CLIENT_INIT_PDUS,
- SMALL_DB_DISCOVERY_PDUS,
- raw_pdu(0x12, 0x09, 0x00, 0x02, 0x00),
- raw_pdu(0x13),
- raw_pdu(),
- raw_pdu(0x1D, 0x03, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x1E));
- define_test_client("/TP/GAR/CL/BV-06-C", test_client, service_db_1,
- &test_read_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-23-C", test_client, service_db_1,
- &test_read_8,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x02));
- define_test_client("/TP/GAR/CL/BI-24-C", test_client, service_db_1,
- &test_read_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x00, 0x00),
- raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAR/CL/BI-25-C", test_client, service_db_1,
- &test_read_9,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08));
- define_test_client("/TP/GAR/CL/BI-26-C", test_client, service_db_1,
- &test_read_10,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05));
- define_test_client("/TP/GAR/CL/BI-26-C/auto", test_client, service_db_1,
- &test_read_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05),
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-27-C", test_client, service_db_1,
- &test_read_11,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x0c));
- define_test_client("/TP/GAR/CL/BV-07-C", test_client, service_db_1,
- &test_long_read_9,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BV-07-C/512B", test_client, service_db_1,
- &test_long_read_10,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff),
- raw_pdu(0x0c, 0x04, 0x00, 0xff, 0x01),
- raw_pdu(0x0d, 0xff));
- define_test_client("/TP/GAR/CL/BI-28-C", test_client, service_db_1,
- &test_long_read_11,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x02));
- define_test_client("/TP/GAR/CL/BI-29-C", test_client, service_db_1,
- &test_long_read_12,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x07));
- define_test_client("/TP/GAR/CL/BI-30-C", test_client, service_db_1,
- &test_long_read_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x00, 0x00),
- raw_pdu(0x01, 0x0a, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAR/CL/BI-31-C", test_client, service_db_1,
- &test_long_read_13,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x08));
- define_test_client("/TP/GAR/CL/BI-32-C", test_client, service_db_1,
- &test_long_read_14,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05));
- define_test_client("/TP/GAR/CL/BI-32-C/auto", test_client, service_db_1,
- &test_long_read_9,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x05),
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x0b, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAR/CL/BI-33-C", test_client, service_db_1,
- &test_long_read_15,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x04, 0x00),
- raw_pdu(0x01, 0x0a, 0x04, 0x00, 0x0c));
- define_test_client("/TP/GAR/CL/BI-34-C", test_client, service_db_1,
- &test_read_12,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x80));
- define_test_client("/TP/GAR/CL/BI-35-C", test_client, service_db_1,
- &test_read_12,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x01, 0x0a, 0x03, 0x00, 0x80));
- define_test_client("/TP/GAW/CL/BV-01-C", test_client, service_db_1,
- &test_write_without_response_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x52, 0x07, 0x00, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAW/CL/BV-02-C", test_client, service_db_1,
- &test_signed_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0xd2, 0x07, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00,
- 0x00, 0x00, 0x31, 0x1f, 0x0a, 0xcd, 0x1c, 0x3a,
- 0x5b, 0x0a));
- define_test_client("/TP/GAW/CL/BV-02-C/seclevel", test_client,
- service_db_1, &test_signed_write_seclevel_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x52, 0x07, 0x00, 0x01, 0x02, 0x03));
- define_test_client("/TP/GAW/CL/BV-03-C", test_client, service_db_1,
- &test_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_client("/TP/GAW/CL/BI-02-C", test_client, service_db_1,
- &test_write_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAW/CL/BI-03-C", test_client, service_db_1,
- &test_write_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x07, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BI-04-C", test_client, service_db_1,
- &test_write_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x07, 0x00, 0x08));
- define_test_client("/TP/GAW/CL/BI-05-C", test_client, service_db_1,
- &test_write_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x07, 0x00, 0x05));
- define_test_client("/TP/GAW/CL/BI-05-C/auto", test_client, service_db_1,
- &test_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x07, 0x00, 0x05),
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_client("/TP/GAW/CL/BI-06-C", test_client, service_db_1,
- &test_write_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x07, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x07, 0x00, 0x0c));
- define_test_server("/TP/GAW/SR/BV-07-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19),
- raw_pdu(0x0a, 0x03, 0x00),
- raw_pdu(0x0b, 0x42, 0x6c, 0x75, 0x65, 0x5a));
- define_test_server("/TP/GAW/SR/BV-07-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0xc4, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0xc4, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19),
- raw_pdu(0x0a, 0xc4, 0x00),
- raw_pdu(0x0b, '1', '1', '1', '1', '1', '2', '2', '2',
- '2', '2', '3', '3', '3', '3', '3', '4', '4',
- '4', '4', '4', '5'));
- define_test_server("/TP/GAW/SR/BV-03-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x03, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_server("/TP/GAW/SR/BV-03-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x82, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_server("/TP/GAW/SR/BI-02-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAW/SR/BI-02-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x0f, 0xf0, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x0f, 0xf0, 0x01));
- define_test_server("/TP/GAW/SR/BI-03-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x13, 0xf0, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x13, 0xf0, 0x03));
- define_test_server("/TP/GAW/SR/BI-03-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x04, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BV-05-C", test_client, service_db_1,
- &test_long_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff),
- raw_pdu(0x17, 0x07, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff),
- raw_pdu(0x16, 0x07, 0x00, 0xfb, 0x01,
- 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x07, 0x00, 0xfb, 0x01,
- 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-07-C", test_client, service_db_1,
- &test_long_write_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-08-C", test_client, service_db_1,
- &test_long_write_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x03, 0x00, 0x03),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-11-C", test_client, service_db_1,
- &test_long_write_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x08),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-12-C", test_client, service_db_1,
- &test_long_write_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x05),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-13-C", test_client, service_db_1,
- &test_long_write_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x0c),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-05-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x16, 0x03, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x17, 0x03, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-05-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x16, 0x82, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x17, 0x82, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BI-07-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAW/SR/BI-07-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x0f, 0xf0, 0x01));
- define_test_server("/TP/GAW/SR/BI-08-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x05, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x05, 0x00, 0x03));
- define_test_server("/TP/GAW/SR/BI-08-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x73, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x73, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BV-06-C", test_client, service_db_1,
- &test_reliable_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-14-C", test_client, service_db_1,
- &test_reliable_write_2,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-15-C", test_client, service_db_1,
- &test_reliable_write_3,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x03, 0x00, 0x03),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-17-C", test_client, service_db_1,
- &test_reliable_write_4,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x08),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-18-C", test_client, service_db_1,
- &test_reliable_write_5,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x05),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-18-C/auto", test_client, service_db_1,
- &test_reliable_write_1,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x05),
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-19-C", test_client, service_db_1,
- &test_reliable_write_6,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x07, 0x00, 0x0c),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-06-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-06-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-10-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x15, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x15, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x03, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x03, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x16, 0x15, 0xf0, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x15, 0xf0, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-10-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x72, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x72, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x16, 0x72, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x72, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BI-14-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAW/SR/BI-14-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x0f, 0xf0, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x0f, 0xf0, 0x01));
- define_test_server("/TP/GAW/SR/BI-15-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x05, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x05, 0x00, 0x03));
- define_test_server("/TP/GAW/SR/BI-15-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x73, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x73, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BV-08-C", test_client, service_db_1,
- &test_write_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_client("/TP/GAW/CL/BI-20-C", test_client, service_db_1,
- &test_write_8,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
- define_test_client("/TP/GAW/CL/BI-21-C", test_client, service_db_1,
- &test_write_9,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x08, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BI-22-C", test_client, service_db_1,
- &test_write_10,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x08, 0x00, 0x08));
- define_test_client("/TP/GAW/CL/BI-23-C", test_client, service_db_1,
- &test_write_11,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x08, 0x00, 0x05));
- define_test_client("/TP/GAW/CL/BI-23-C/auto", test_client, service_db_1,
- &test_write_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x08, 0x00, 0x05),
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_client("/TP/GAW/CL/BI-24-C", test_client, service_db_1,
- &test_write_12,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x12, 0x08, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x08, 0x00, 0x0c));
- define_test_server("/TP/GAW/SR/BV-08-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_server("/TP/GAW/SR/BV-08-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x83, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x13));
- define_test_server("/TP/GAW/SR/BI-20-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAW/SR/BI-20-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x0f, 0xf0, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x0f, 0xf0, 0x01));
- define_test_server("/TP/GAW/SR/BI-21-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x13, 0xf0, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x13, 0xf0, 0x03));
- define_test_server("/TP/GAW/SR/BI-21-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x12, 0x04, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x12, 0x04, 0x00, 0x03));
- define_test_client("/TP/GAW/CL/BV-09-C", test_client, service_db_1,
- &test_long_write_7,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x08, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff),
- raw_pdu(0x17, 0x08, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff),
- raw_pdu(0x16, 0x08, 0x00, 0xfb, 0x01,
- 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x08, 0x00, 0xfb, 0x01,
- 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-25-C", test_client, service_db_1,
- &test_long_write_8,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-26-C", test_client, service_db_1,
- &test_long_write_9,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x08, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x08, 0x00, 0x03),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-29-C", test_client, service_db_1,
- &test_long_write_10,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x08, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x08, 0x00, 0x08),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-30-C", test_client, service_db_1,
- &test_long_write_11,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x08, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x08, 0x00, 0x05),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_client("/TP/GAW/CL/BI-31-C", test_client, service_db_1,
- &test_long_write_12,
- SERVICE_DATA_1_PDUS,
- raw_pdu(0x16, 0x08, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x01, 0x16, 0x08, 0x00, 0x0c),
- raw_pdu(0x18, 0x00),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-09-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x16, 0x04, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x17, 0x04, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BV-09-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x17, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x16, 0x83, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x17, 0x83, 0x00, 0x12, 0x00, 0xff),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x19));
- define_test_server("/TP/GAW/SR/BI-25-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x00, 0x00, 0x01));
- define_test_server("/TP/GAW/SR/BI-25-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x0f, 0xf0, 0x01));
- define_test_server("/TP/GAW/SR/BI-26-C/small", test_server,
- ts_small_db, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x13, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x13, 0xf0, 0x03));
- define_test_server("/TP/GAW/SR/BI-26-C/large-1", test_server,
- ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff),
- raw_pdu(0x01, 0x16, 0x04, 0x00, 0x03));
- define_test_server("/robustness/no-reliable-characteristic",
- test_server, ts_large_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0x16, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x82, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x17, 0x25, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03),
- raw_pdu(0x16, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x82, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x16, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x17, 0x25, 0x00, 0x03, 0x00, 0x04, 0x05, 0x06),
- raw_pdu(0x18, 0x01),
- raw_pdu(0x01, 0x18, 0x25, 0x00, 0x06));
- define_test_server("/robustness/unkown-request",
- test_server, service_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0xbf, 0x00),
- raw_pdu(0x01, 0xbf, 0x00, 0x00, 0x06));
- define_test_server("/robustness/unkown-command",
- test_server, service_db_1, NULL,
- raw_pdu(0x03, 0x00, 0x02),
- raw_pdu(0xff, 0x00),
- raw_pdu());
- return tester_run();
- }
|